net.dpml.util
Class PropertyResolver

java.lang.Object
  extended by net.dpml.util.PropertyResolver

public final class PropertyResolver
extends Object

Utility class that handles substitution of property names in the string for ${value} relative to a supplied set of properties.

Version:
1.1.0
Author:
Digital Product Meta Library

Method Summary
static Properties resolve(Properties properties)
          System property symbol substitution from properties.
static String resolve(Properties props, String value)
          Symbol substitution from properties.
static String resolve(String value)
          System property symbol substitution from properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

resolve

public static String resolve(String value)
System property symbol substitution from properties. Replace any occurances of ${[key]} with the value of the property assigned to the [key] in the system properties.

Parameters:
value - a string containing possibly multiple ${[value]} sequences
Returns:
the expanded string

resolve

public static Properties resolve(Properties properties)
System property symbol substitution from properties. Replace any occurances of ${[key]} with the value of the property assigned to the [key] in the system properties or supplied properties.

Parameters:
properties - an arbitary properties file containing unresolved properties
Returns:
the property file with expended properties

resolve

public static String resolve(Properties props,
                             String value)
Symbol substitution from properties. Replace any occurances of ${[key]} with the value of the property assigned to the [key] in the supplied properties argument.

Parameters:
props - the source properties from which substitution is resolved
value - a string containing possibly multiple ${[value]} sequences
Returns:
the expanded string