|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.codehaus.spice.configkit.PropertyExpander
This is a utility class designed for expanding propertys in configuration files. Propertys are stored in Map objects and any section that begins with "${" and ends with "}" will have inner name replaced with property value from map.
| Field Summary | |
static int |
EMPTY_ON_UNDEFINED
Flag indicating that undefined propertys should be replaced with a empty string "". |
static int |
EXCEPT_ON_UNDEFINED
Flag indicating that undefined propertys should cause an exception to be thrown. |
static int |
LEAVE_UNDEFINED
Flag indicating that undefined propertys should be not be replaced. |
| Constructor Summary | |
PropertyExpander()
Create property expander with EXCEPT_ON_UNDEFINED policy for undefined propertys. |
|
PropertyExpander(int onUndefined)
Create property expander with specified policy for undefined propertys. |
|
| Method Summary | |
void |
expandValues(org.w3c.dom.Element input,
Map data)
Expand all propertys in the input XML attributes and text contents. |
Properties |
expandValues(Properties input,
Map data)
Expand all propertys in the input Properties object. |
String |
expandValues(String input,
Map data)
Expand all propertys in input string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int LEAVE_UNDEFINED
public static final int EXCEPT_ON_UNDEFINED
public static final int EMPTY_ON_UNDEFINED
| Constructor Detail |
public PropertyExpander()
public PropertyExpander(int onUndefined)
onUndefined - the flag indicating behaviour when undefined property
is encountered. Must be one of the *_UNDEFINED constants.| Method Detail |
public Properties expandValues(Properties input,
Map data)
throws Exception
input - the Properties object to resolvedata - the data that holds property values
Exception - if an error occurs
public void expandValues(org.w3c.dom.Element input,
Map data)
throws Exception
input - the DOM element to resolvedata - the data that holds property values
Exception - if an error occurs
public String expandValues(String input,
Map data)
throws Exception
input - the string to resolvedata - the data that holds property values
Exception - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||