Class ResourceExists

  • All Implemented Interfaces:
    java.lang.Cloneable, org.apache.tools.ant.taskdefs.condition.Condition

    public class ResourceExists
    extends org.apache.tools.ant.ProjectComponent
    implements org.apache.tools.ant.taskdefs.condition.Condition
    A condition that tests whether a given resource exists.
    Since:
    AntUnit 1.2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String refid  
      private org.apache.tools.ant.types.Resource resource  
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Constructor Summary

      Constructors 
      Constructor Description
      ResourceExists()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(org.apache.tools.ant.types.Resource r)
      The resource to check as nested element.
      boolean eval()  
      private org.apache.tools.ant.types.Resource expandRefId()  
      private void onlyOne()  
      void setRefid​(java.lang.String refid)
      The resource to check as a refid.
      void setResource​(org.apache.tools.ant.types.Resource r)
      The resource to check as attribute.
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • resource

        private org.apache.tools.ant.types.Resource resource
      • refid

        private java.lang.String refid
    • Constructor Detail

      • ResourceExists

        public ResourceExists()
    • Method Detail

      • setResource

        public void setResource​(org.apache.tools.ant.types.Resource r)
        The resource to check as attribute.

        Exactly one resource must be specfied either as attribute or nested element.

        Parameters:
        r - resource to check
      • setRefid

        public void setRefid​(java.lang.String refid)
        The resource to check as a refid.
        Parameters:
        refid - resource to check as a refid
        Since:
        AntUnit 1.3
      • add

        public void add​(org.apache.tools.ant.types.Resource r)
        The resource to check as nested element.

        Exactly one resource must be specfied either as attribute or nested element.

        Parameters:
        r - resource to check
      • eval

        public boolean eval()
        Specified by:
        eval in interface org.apache.tools.ant.taskdefs.condition.Condition
      • onlyOne

        private void onlyOne()
      • expandRefId

        private org.apache.tools.ant.types.Resource expandRefId()