From 69d85ab035ac0f844d21d1b33e7f508820942277 Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Wed, 16 Jul 2008 17:18:02 +0000 Subject: [PATCH] propertyHelper info git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@677346 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/propertyhelper.html | 3 ++- docs/manual/develop.html | 16 +++++++++++++++- docs/manual/tutorial-writing-tasks.html | 4 +++- docs/manual/using.html | 11 +++++++++++ docs/manual/usinglist.html | 1 + 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/docs/manual/CoreTasks/propertyhelper.html b/docs/manual/CoreTasks/propertyhelper.html index 63b6325b7..47f1a5046 100644 --- a/docs/manual/CoreTasks/propertyhelper.html +++ b/docs/manual/CoreTasks/propertyhelper.html @@ -30,7 +30,8 @@ (a) install a different PropertyHelper at runtime, or (b) (hopefully more often) install one or more PropertyHelper Delegates into the PropertyHelper active on the current Project. This is somewhat advanced Ant usage and -assumes a working familiarity with the modern Ant APIs. +assumes a working familiarity with the modern Ant APIs. See the description of Ant's +Property Helper for more information. Since Ant 1.8

Parameters specified as nested elements

diff --git a/docs/manual/develop.html b/docs/manual/develop.html index 1544aaeb8..9f8ce93cc 100644 --- a/docs/manual/develop.html +++ b/docs/manual/develop.html @@ -128,7 +128,14 @@ good convention, though.

Conversions Ant will perform for attributes

Ant will always expand properties before it passes the value of an -attribute to the corresponding setter method.

+attribute to the corresponding setter method. Since Ant 1.8, it is +possible to extend Ant's property handling +such that a non-string Object may be the result of the evaluation of a string +containing a single property reference. These will be assigned directly via +setter methods of matching type. Since it requires some beyond-the-basics +intervention to enable this behavior, it may be a good idea to flag attributes +intended to permit this usage paradigm. +

The most common way to write an attribute setter is to use a java.lang.String argument. In this case Ant will pass @@ -156,6 +163,13 @@ is more! If the argument of you setter method is

not, Ant will interpret the value as a path name relative to the project's basedir. +
  • org.apache.tools.ant.types.Resource + org.apache.tools.ant.types.Resource, Ant will + resolve the string as a java.io.File as above, then + pass in as a org.apache.tools.ant.types.resources.FileResource. + Since Ant 1.8 +
  • +
  • org.apache.tools.ant.types.Path, Ant will tokenize the value specified in the build file, accepting : and ; as path separators. Relative path names will be diff --git a/docs/manual/tutorial-writing-tasks.html b/docs/manual/tutorial-writing-tasks.html index 96ca63cc5..6e5a9b881 100644 --- a/docs/manual/tutorial-writing-tasks.html +++ b/docs/manual/tutorial-writing-tasks.html @@ -282,8 +282,10 @@ arguments of the set-method: Before calling the set-method all properties are resolved. So a <helloworld message="${msg}"/> would not set the message string to "${msg}" if there is a property "msg" with a set value. diff --git a/docs/manual/using.html b/docs/manual/using.html index 551fd1ae8..1418a7f6d 100644 --- a/docs/manual/using.html +++ b/docs/manual/using.html @@ -325,6 +325,17 @@ maybe not set inside IDEs:

    ant.home home directory of Ant +

    Property Helpers

    +Ant's property handling is accomplished by an instance of +org.apache.tools.ant.PropertyHelper associated with the current Project. +You can learn more about this class by examining Ant's Java API. In Ant 1.8 the +PropertyHelper class was much reworked and now itself employs a number of helper +classes (actually instances of the org.apache.tools.ant.PropertyHelper$Delegate +marker interface) to take care of discrete tasks such as property setting, retrieval, +parsing, etc. This makes Ant's property handling highly extensible; also of interest is the +new propertyhelper task used to manipulate the +PropertyHelper and its delegates from the context of the Ant buildfile. +

    Example Buildfile

     <project name="MyProject" default="dist" basedir=".">
    diff --git a/docs/manual/usinglist.html b/docs/manual/usinglist.html
    index 8d6982ca7..014c0b34d 100644
    --- a/docs/manual/usinglist.html
    +++ b/docs/manual/usinglist.html
    @@ -35,6 +35,7 @@
       Tasks
    Properties
    Built-in Properties
    + Property Helpers
    Example Buildfile
    Token Filters
    Path-like Structures