| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Ant-contrib Tasks: Propertycopy</title> |
| 5 | </head> |
| 6 | |
| 7 | <body> |
| 8 | <h1>Propertycopy</h1> |
| 9 | |
| 10 | <p>Copies the value of a named property to another property. This |
| 11 | is useful when you need to plug in the value of another property |
| 12 | in order to get a property name and then want to get the value of |
| 13 | that property name.</p> |
| 14 | |
| 15 | <h2>Parameters</h2> |
| 16 | <table border="1" cellpadding="2" cellspacing="0"> |
| 17 | <tr> |
| 18 | <th>Attribute</th> |
| 19 | <th>Description</th> |
| 20 | <th>Required</th> |
| 21 | </tr> |
| 22 | <tr> |
| 23 | <td valign="top">property</td> |
| 24 | <td valign="top">The name of the property to set.</td> |
| 25 | <td align="center" valign="top">Yes.</td> |
| 26 | </tr> |
| 27 | <tr> |
| 28 | <td valign="top">override</td> |
| 29 | <td valign="top">If the property is already set, should we change it's value. |
| 30 | Can be <code>true</code> or <code>false</code></td> |
| 31 | <td align="center" valign="top">No. Defaults to <code>false</code></td> |
| 32 | </tr> |
| 33 | <tr> |
| 34 | <td valign="top">name <i>Deprecated</i></td> |
| 35 | <td valign="top">The name of the property to set.</td> |
| 36 | <td align="center" valign="top">No. Use the <code>property</code> attribute |
| 37 | instead</td> |
| 38 | </tr> |
| 39 | <tr> |
| 40 | <td valign="top">from</td> |
| 41 | <td valign="top">The name of the property you wish to copy the |
| 42 | value from.</td> |
| 43 | <td align="center" valign="top">Yes.</td> |
| 44 | </tr> |
| 45 | <tr> |
| 46 | <td valign="top">silent</td> |
| 47 | <td valign="top">Do you want to suppress the error if the |
| 48 | "from" property does not exist, and just not set the |
| 49 | property "name".</td> |
| 50 | <td align="center" valign="top">No, default is "false".</td> |
| 51 | </tr> |
| 52 | </table> |
| 53 | |
| 54 | <h2>Example</h2> |
| 55 | <pre> |
| 56 | <property name="org" value="MyOrg" /> |
| 57 | <property name="org.MyOrg.DisplayName" value="My Organiziation" /> |
| 58 | <propertycopy name="displayName" from="org.${org}.DisplayName" /> |
| 59 | </pre> |
| 60 | |
| 61 | <p>Sets <code>displayName</code> to "My |
| 62 | Organiziation".</p> |
| 63 | |
| 64 | <hr> |
| 65 | <p align="center">Copyright © 2002 Ant-Contrib Project. All |
| 66 | rights Reserved.</p> |
| 67 | |
| 68 | </body> |
| 69 | </html> |