org.xfp
Class PropertyHelper

java.lang.Object
  extended byorg.xfp.PropertyHelper

public class PropertyHelper
extends java.lang.Object

Helper class for ${} expressions. Includes code extracted and adapted from Apache Ant org.apache.tools.ant.ProjectHelper class. The original code could not be used here because of Ant custom log statements.

Version:
$Id: PropertyHelper.java,v 1.1 2004/03/19 15:56:43 flaviotordini Exp $
Author:
duncan@x180.com, Flavio Tordini

Method Summary
static java.lang.Object replaceProperties(java.lang.String value, java.util.Map keys)
          Replaces ${xxx} style constructions in the given value with the string value of the corresponding data types.
static void setProperties(java.lang.Object bean, org.w3c.dom.Node node, org.w3c.dom.xpath.XPathEvaluator evaluator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

replaceProperties

public static java.lang.Object replaceProperties(java.lang.String value,
                                                 java.util.Map keys)
                                          throws java.lang.Exception
Replaces ${xxx} style constructions in the given value with the string value of the corresponding data types. (Stolen from Apache Ant. org.apache.tools.ant.PropertyHelper) See org.apache.tools.ant.ProjectHelper#replaceProperties(Project,String,HashTable)

Parameters:
value - The string to be scanned for property references. May be null, in which case this method returns immediately with no effect.
keys - Mapping (String to String) of property names to their values. Must not be null.
Returns:
the original string with the properties replaced, or null if the original string is null. FT: if value contains only a single ${} expression, this method returns the Object mapped to the property.
Throws:
java.lang.Exception

setProperties

public static void setProperties(java.lang.Object bean,
                                 org.w3c.dom.Node node,
                                 org.w3c.dom.xpath.XPathEvaluator evaluator)
                          throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2003-2004 XFP Team. All Rights Reserved.