Class PropertyCopy

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
net.sf.antcontrib.property.AbstractPropertySetterTask
net.sf.antcontrib.property.PropertyCopy
All Implemented Interfaces:
Cloneable

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
  • Field Summary

    Fields inherited from class org.apache.tools.ant.Task

    target, taskName, taskType, wrapper

    Fields inherited from class org.apache.tools.ant.ProjectComponent

    description, location, project
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    void
     
    void
    setSilent(boolean silent)
     
    protected void
     

    Methods inherited from class net.sf.antcontrib.property.AbstractPropertySetterTask

    setOverride, setProperty, setPropertyValue

    Methods inherited from class org.apache.tools.ant.Task

    bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

    Methods inherited from class org.apache.tools.ant.ProjectComponent

    clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PropertyCopy

      public PropertyCopy()
      Default Constructor
  • Method Details

    • setName

      public void setName(String name)
    • setFrom

      public void setFrom(String from)
    • setSilent

      public void setSilent(boolean silent)
    • validate

      protected void validate()
      Overrides:
      validate in class AbstractPropertySetterTask
    • execute

      public void execute() throws org.apache.tools.ant.BuildException
      Overrides:
      execute in class org.apache.tools.ant.Task
      Throws:
      org.apache.tools.ant.BuildException