TOP

method.condition

Description

Call a boolean method on a Java object and use it as a condition Call the boolean method with the name and parameters provided on the named object.

Implementation class

net.mdatools.modelant.util.condition.CallMethodCondition

Parameters

Attribute Description Type
class The optional class to call a static method of String
classpath The classpath as a string to search for the class Path
classpathRef The classpath as a reference to search for the class Reference
method The name of the method to call String
parentFirst Indicates if the classpath should be searched first, before the standard classes (false) or use the standard classes first (true). Note that false might make different versions of the same class. Default: true boolean
property Set the name of the property that holds the object to process String

Nested elements

Element Description
parameter Support of nested <parameter> element describing the signature of the method and the actual parameter to call it with A single parameter and of a method call & its description. It holds class name, an explicit string value or a name to find the value bound to. Invariant:
  1. when class name is null or empty (not provided), then String class is implied. The class is searched in the standard class loader.
  2. if value name is provided, then it defines the value to use. No type conversion is done. If no property with that name is bound, null value will be used.
  3. if no value name provided, then the string value is used, no matter if it is provided or not and it is converted to the target class using a constructor with a single String parameter. If no string value provided, null value will be used.
 Usage: 
   
   class X extends Task {
     private final TypeValueDescriptor parameter = new TypeValueDescriptor(this); // used the constructor with Task 
   }
   
   or
 
   class X extends Task {
     public void addConfiguredY(TypeValueDescriptor parameter) { // ANT calls the constructor with the Project parameter
        parameter.setTask( this );
        ...
     }
   }
 

Parameters

Attribute Description Type
class The name of the class of this parameter. Default: String String
classpath The classpath to search for the parameter's class. Default: the ANT class path Path
classpathRef The reference to classpath to search for the parameter's class. Default: the ANT class path Reference
parentFirst The if the classpath provided should be searched after the ANT classpath. Default: true boolean
property The name of the property that holds the value to send as a parameter value. Default: this String
signature The class to be used in the method' signature. Thus, a singing value and valueClassName could describe an Object parameter as a signature class name. String
value An explicit String value to send as a parameter value. If provided valueName is disregarded String

Use <typedef resource="net/mdatools/modelant/util/antlib.xml"/>
Documentation generated by ant.doc Ant macro from ModelAnt by MDA Tools