TOP

wrap.method

Description

Wrap a model element and invoke the specified method on the wrapper. Store the method's result in a specified property.

Implementation class

net.mdatools.modelant.core.task.wrapper.CallWrapperMethod

Parameters

Attribute Description Type
method The name of the method to call String
name This is the mandatory name where to store the method's result. Default: this String
property This is the name of the property that holds the model element to call the method of. Default: this 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/core/antlib.xml"/>
Documentation generated by ant.doc Ant macro from ModelAnt by MDA Tools