|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
java.io.BufferedReader
java.io.LineNumberReader
org.apache.commons.configuration.PropertiesConfiguration.PropertiesReader
public static class PropertiesConfiguration.PropertiesReader
This class is used to read properties lines. These lines do not terminate with new-line chars but rather when there is no backslash sign a the end of the line. This is used to concatenate multiple lines for readability.
Field Summary | |
---|---|
private java.util.List |
commentLines
Stores the comment lines for the currently processed property. |
private char |
delimiter
Stores the list delimiter character. |
private java.lang.String |
propertyName
Stores the name of the last read property. |
private java.lang.String |
propertyValue
Stores the value of the last read property. |
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
PropertiesConfiguration.PropertiesReader(java.io.Reader reader)
Constructor. |
|
PropertiesConfiguration.PropertiesReader(java.io.Reader reader,
char listDelimiter)
Creates a new instance of PropertiesReader and sets
the underlaying reader and the list delimiter. |
Method Summary | |
---|---|
private static boolean |
checkCombineLines(java.lang.String line)
Checks if the passed in line should be combined with the following. |
java.util.List |
getCommentLines()
Returns the comment lines that have been read for the last property. |
java.lang.String |
getPropertyName()
Returns the name of the last read property. |
java.lang.String |
getPropertyValue()
Returns the value of the last read property. |
boolean |
nextProperty()
Parses the next property from the input stream and stores the found name and value in internal fields. |
private static java.lang.String[] |
parseProperty(java.lang.String line)
Parse a property line and return the key and the value in an array. |
java.lang.String |
readProperty()
Reads a property line. |
Methods inherited from class java.io.LineNumberReader |
---|
getLineNumber, mark, read, read, readLine, reset, setLineNumber, skip |
Methods inherited from class java.io.BufferedReader |
---|
close, markSupported, ready |
Methods inherited from class java.io.Reader |
---|
read, read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.List commentLines
private java.lang.String propertyName
private java.lang.String propertyValue
private char delimiter
Constructor Detail |
---|
public PropertiesConfiguration.PropertiesReader(java.io.Reader reader)
reader
- A Reader.public PropertiesConfiguration.PropertiesReader(java.io.Reader reader, char listDelimiter)
PropertiesReader
and sets
the underlaying reader and the list delimiter.
reader
- the readerlistDelimiter
- the list delimiter characterMethod Detail |
---|
public java.lang.String readProperty() throws java.io.IOException
<name>
= <value>
)
java.io.IOException
- in case of an I/O errorpublic boolean nextProperty() throws java.io.IOException
java.io.IOException
- if an error occurspublic java.util.List getCommentLines()
readProperty()
public java.lang.String getPropertyName()
nextProperty()
was invoked and its
return value was true.
public java.lang.String getPropertyValue()
nextProperty()
was invoked and
its return value was true.
private static boolean checkCombineLines(java.lang.String line)
line
- the line
private static java.lang.String[] parseProperty(java.lang.String line)
line
- the line to parse
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |