net.sf.antcontrib.property

Class PropertyCopy

public class PropertyCopy extends AbstractPropertySetterTask

Task definition for the propertycopy task, which copies the value of a named property to another property. This is useful when you need to plug in the value of another property in order to get a property name and then want to get the value of that property name.
 Usage:

   Task declaration in the project:
   
     <taskdef name="propertycopy" classname="net.sf.antcontrib.property.PropertyCopy" />
   

   Call Syntax:
   
     <propertycopy name="propname" from="copyfrom" (silent="true|false")? />
   

   Attributes:
     name      --> The name of the property you wish to set with the value
     from      --> The name of the property you wish to copy the value from
     silent    --> Do you want to suppress the error if the "from" property
                   does not exist, and just not set the property "name".  Default
                   is false.

   Example:
     <property name="org" value="MyOrg" />
     <property name="org.MyOrg.DisplayName" value="My Organiziation" />
     <propertycopy name="displayName" from="org.${org}.DisplayName" />
     <echo message="${displayName}" />
 

Author: Matthew Inger

Constructor Summary
PropertyCopy()
Default Constructor
Method Summary
voidexecute()
voidsetFrom(String from)
voidsetName(String name)
voidsetSilent(boolean silent)
protected voidvalidate()

Constructor Detail

PropertyCopy

public PropertyCopy()
Default Constructor

Method Detail

execute

public void execute()

setFrom

public void setFrom(String from)

setName

public void setName(String name)

setSilent

public void setSilent(boolean silent)

validate

protected void validate()