simple.util.parse
Class PropertyBuffer
java.lang.Object
simple.util.parse.ParseBuffer
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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.
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