net.larsan.urd.ant.website
Class PropertySub

java.lang.Object
  |
  +--net.larsan.urd.ant.website.PropertySub
All Implemented Interfaces:
Substitution

public class PropertySub
extends java.lang.Object
implements Substitution

A property substitution object matches property templates with values and replaces them. A propeprty template has the syntax:

      ${xxx}
 
Where 'xxx' is the property name. This object contains a Properties object which matches property names to values. All found propertyes will be substituted.

Version:
Alpha-0.1 / 2002-10-06 21:37
Author:
Lars J. Nilsson

Constructor Summary
PropertySub()
          Create new substitution with an empty property set.
PropertySub(java.util.Properties props)
          Create substitution using an existing set of properties.
 
Method Summary
 java.util.Properties getProperties()
          Get a reference to the property collection used by this class.
 java.lang.String substitute(java.lang.String source)
          Do substitution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertySub

public PropertySub(java.util.Properties props)
Create substitution using an existing set of properties.

Parameters:
props - Properties to be replaces during substitution

PropertySub

public PropertySub()
Create new substitution with an empty property set.

Method Detail

substitute

public java.lang.String substitute(java.lang.String source)
Do substitution. All found instances of property templates ('${xxx}') will be replaced.

Specified by:
substitute in interface Substitution

getProperties

public java.util.Properties getProperties()
Get a reference to the property collection used by this class.