public class PropertiesParser extends Object
Populate a Properties object. Parser is a thread-safe one use object. The list of tokens normally is the output of a PropertiesLexer but can be generated in other ways, for example manually.
PropertiesLexer| Modifier and Type | Field and Description |
|---|---|
private Lock |
lock |
(package private) Properties |
properties |
(package private) Stack<PropertiesToken> |
tokens |
private boolean |
trimValues |
| Constructor and Description |
|---|
PropertiesParser(List<PropertiesToken> tokens)
This constructor expects the tokens to be in parse order, it reverses the order as it pushes them onto the stack
(so the stack order is backwards to the parse).
|
PropertiesParser(List<PropertiesToken> tokens,
Properties properties) |
PropertiesParser(Stack<PropertiesToken> tokens)
This constructor expects the tokens to be in reverse parse order, it uses the stack as-is
(the stack order is backwards to the parse order).
|
| Modifier and Type | Method and Description |
|---|---|
private void |
analyzeMetaData(String str) |
Properties |
getProperties() |
boolean |
isTrimValues() |
void |
parse() |
private PropertiesToken |
peek() |
private PropertiesToken |
pop() |
void |
setTrimValues(boolean trimValues) |
private String |
trimEndingWhiteSpace(String text) |
final Stack<PropertiesToken> tokens
final Properties properties
private final Lock lock
private boolean trimValues
public PropertiesParser(List<PropertiesToken> tokens, Properties properties)
public PropertiesParser(List<PropertiesToken> tokens)
tokens - public PropertiesParser(Stack<PropertiesToken> tokens)
tokens - public void parse()
private void analyzeMetaData(String str)
private PropertiesToken peek()
private PropertiesToken pop()
public Properties getProperties()
public boolean isTrimValues()
public void setTrimValues(boolean trimValues)
Copyright © 2011-2014 David R. Smith. All Rights Reserved.