edu.emory.mathcs.util
Class PropertyUtils.PropertyExpansionMacro

java.lang.Object
  extended byedu.emory.mathcs.util.PropertyUtils.PropertyExpansionMacro
All Implemented Interfaces:
PropertyUtils.Macro
Enclosing class:
PropertyUtils

public static final class PropertyUtils.PropertyExpansionMacro
extends java.lang.Object
implements PropertyUtils.Macro

Property expansion template that resolves property names into values using specified properties. If no properties are given to the constructor, system properties are used. The input to the macro has the following syntax:

 name[,defaultValue]
 
For instance: "temp.dir,/tmp". If this template resolves against system properties (e.g. if no-arg constructor is used), two special-purpose names are supported: "/" resolves to File.separator, and ":" resolves to File.pathSeparator. This allows to use shortcuts like "${/}" and "${:}" in configuration files.

Version:
1.0
Author:
Dawid Kurzyniec

Constructor Summary
PropertyUtils.PropertyExpansionMacro()
          Creates a new property expansion macro template that resolves against system properties.
PropertyUtils.PropertyExpansionMacro(java.util.Properties props)
          Creates a new property expansion macro template that resolves against specified properties.
 
Method Summary
 java.lang.String process(java.lang.String input)
          Returns property value for the specified property name, possibly using specified default value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyUtils.PropertyExpansionMacro

public PropertyUtils.PropertyExpansionMacro()
Creates a new property expansion macro template that resolves against system properties.


PropertyUtils.PropertyExpansionMacro

public PropertyUtils.PropertyExpansionMacro(java.util.Properties props)
Creates a new property expansion macro template that resolves against specified properties.

Parameters:
props - the properties to resolve against
Method Detail

process

public java.lang.String process(java.lang.String input)
Returns property value for the specified property name, possibly using specified default value.

Specified by:
process in interface PropertyUtils.Macro
Parameters:
input - the property name
Returns:
the property value