ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wascally Wabbit <>
Subject Re: recursive expansion of property names
Date Fri, 25 Jun 2004 14:58:24 GMT
At 10:29 AM 6/25/2004, you wrote:
>I think it must be that since I'm encapsulating the default property 
>handler, I need to pass EVERY get/set method to the encapsulated property 
>handler and also run them through my recursive resolution algorithm to get 
>them to resolve.
>Jeffrey Bacon
>Creative Developer

Correct. Think of your class as a simple proxy for the real thing.
Your sample works for my test because I have wrapped *ALL* the methods to
delegate to the Ant helper except the replace method.

Here is a snip:

--- [ snip (.java) ] ---

     public String replaceProperties(String ns, String value, Hashtable 
keys) throws BuildException {
         return replacePropertiesRecursively(ns, value, keys);

     public Object getProperty(String ns, String name)
         return defImpl.getProperty(ns,name);

     public Object getUserProperty(String ns, String name)
         return defImpl.getUserProperty(ns,name);

     public boolean setProperty(String ns, String name, Object value, 
boolean verbose)
         return defImpl.setProperty(ns,name,value,verbose);

     public void setNewProperty(String ns, String name, Object value)

     public void setUserProperty(String ns, String name, Object value)

     public void setInheritedProperty(String ns, String name,  Object value)

     public Object getPropertyHook(String ns, String name, boolean userOnly)
         return defImpl.getPropertyHook(ns,name,userOnly);

     public Hashtable getProperties()
         return defImpl.getProperties();

     public Hashtable getUserProperties()
         return defImpl.getUserProperties();

     public  void copyInheritedProperties(Project other)

     public void copyUserProperties(Project other)

--- [[ snip ( too) ]] ---

<?xml version="1.0"?>

<project name="RPH-verify" basedir="." default="default">

   <taskdef name="rph" classname="tests.RecursivePropertyHelperInstaller"/>

   <macrodef name="echoEEHome">
       <echo message="'ee.HOME(macro)': ${ee.HOME}"/>

   <macrodef name="echop">
     <attribute name="pn"/>
       <echo message="'@{pn}(macro)': ${@{pn}}"/>

   <target name="default">

         <property name="afN" value=".file"/>
     <property name="_dot" value ="."/>
     <property name="_ant" value="ant"/>
     <property name="_file" value="file"/>

     <echo message="Plain 'HOME': ${HOME}"/>

     <property environment="ee"/>
     <echo message="'ee.HOME(0)': ${ee.HOME}"/>

         <rph action="install"/>

         <echo message="'ant.file(0)': ${ant${afN}}"/>
         <echo message="'ant.file(1)': ${${_ant}${_dot}${_file}}"/>
         <echo message="'ee.HOME(1)': ${ee.HOME}"/>

         <property environment="pp"/>
         <echo message="'pp.HOME(0)':${pp.HOME}"/>

         <property file=""/>
         <echo message="'longname(file)': ${longname}"/>

         <echop pn="longname"/>
         <echop pn="name"/>
         <echop pn="ant.file"/>



The Wabbit 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message