xdocs/tag-reference/ant_setProperty.xml (49 lines of code) (raw):

<?xml version="1.0"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <document> <properties> <title>Jelly Tag Reference (ant:setProperty)</title> </properties> <body> <section name="Home Page"> <p>See <a href="http://commons.apache.org/jelly/libs/ant/">http://commons.apache.org/jelly/libs/ant/</a> </p> </section> <section name="Description"> <p> This tag sets an attribute of an Ant task or datatype if the given value is not null. This is very useful in allowing attributes of ant tasks to be set conditionally without ugly if/then/else logic. </p> </section> <section name="Attributes"> <table> <tr> <th>Name</th> <th>Description</th> <th>Required</th> </tr> <tr> <td>name</td> <td>The name of the attribute of the ant task to set</td> <td>Yes</td> </tr> <tr> <td>value</td> <td>The value to give the attribute of the ant task</td> <td>Yes.</td> </tr> <tr> <td>default</td> <td>The default value to give the attribute of the ant task, if the <code>value</code> provided is null.</td> <td>No</td> </tr> </table> </section> <section name="Nested Elements"> <p>None</p> </section> <section name="Examples"> <p> This tag is <strong>always</strong> nested inside of another Ant task, target or datatype. </p> <source><![CDATA[ <j:jelly xmlns:j="jelly:core" xmlns:ant="jelly:ant"> <ant:javac destdir="${maven.build.dest}" excludes="**/package.html" debug="${maven.compile.debug}" deprecation="${maven.compile.deprecation}" optimize="${maven.compile.optimize}"> <ant:setProperty name="encoding" value="${maven.compile.encoding}" /> <ant:setProperty name="executable" value="${maven.compile.executable}" /> </ant:javac> </j:jelly> ]]></source> </section> </body> </document>