simple.util.parse
Class PropertyBuffer

java.lang.Object
  extended by simple.util.parse.ParseBuffer
      extended by simple.util.parse.PropertyBuffer
All Implemented Interfaces:
java.io.Serializable

public class PropertyBuffer
extends ParseBuffer

The PropertyBuffer object is used to create strings which have system variable names replaced with their values. This is used by the FileProperties object to ensure that values taken from a Java properties file, or an XML file will have values augmented with system variable values.


    tools=${java.home}/lib/tools.jar
 
 
Above is an example of the use of an system variable that has been inserted into a plain Java properties file. This will be converted to the full path to tools.jar when the system variable JAVA_HOME is replaced with the matching value.

Author:
Niall Gallagher
See Also:
Serialized Form

Field Summary
 
Fields inherited from class simple.util.parse.ParseBuffer
buf, cache, count
 
Constructor Summary
PropertyBuffer()
          Constructor for the PropertyBuffer object.
 
Method Summary
 void clear()
          This method is used to clear the contents of the buffer.
 java.lang.String getValue()
          This method is used to parse the value of the buffered text and return the corrosponding string.
 java.lang.String toString()
          This method is used to parse the value of the buffered text and return the corrosponding string.
 
Methods inherited from class simple.util.parse.ParseBuffer
append, append, append, append, append, append, ensureCapacity, length
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyBuffer

public PropertyBuffer()
Constructor for the PropertyBuffer object. This is used to create a parsing buffer, which can be used to replace system variable names with their corrosponding values.

Method Detail

getValue

public java.lang.String getValue()
This method is used to parse the value of the buffered text and return the corrosponding string. The contents of this buffer remain unmodified when this method is invoked. The transformed value is stored in a seperate text buffer.

Returns:
this returns the value of the converted string

clear

public void clear()
This method is used to clear the contents of the buffer. This includes the contents of all buffers used to transform the value of the buffered text with system variable values. Once invoked the instance can be reused as a clean buffer.

Overrides:
clear in class ParseBuffer

toString

public java.lang.String toString()
This method is used to parse the value of the buffered text and return the corrosponding string. The contents of this buffer remain unmodified when this method is invoked. The transformed value is stored in a seperate text buffer.

Overrides:
toString in class ParseBuffer
Returns:
this returns the value of the converted string