|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.util.MacroExpander
public class MacroExpander
Parses and substitites macros with literal values or other macros.
Constructor Summary | |
---|---|
MacroExpander() Initiate a parser for parsing macros of the form "${xxx}". |
|
MacroExpander(java.lang.String startDelim, java.lang.String endDelim, boolean recursiveParse, boolean sanitizedMacroKeys) |
Method Summary | |
---|---|
java.lang.String |
expand(java.lang.String macro, java.util.Map<java.lang.String,java.lang.String> macroValues) Expand macros substituting macro-values from a Map. |
boolean |
isRecursiveParse() |
boolean |
isSanitizedMacroKeys() |
void |
setRecursiveParse(boolean recursiveParse) |
void |
setSanitizedMacroKeys(boolean sanitizedMacroKeys) Should macro keys passed in the Map of macro values be considered to be free of the macro delimiters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MacroExpander()
public MacroExpander(java.lang.String startDelim, java.lang.String endDelim, boolean recursiveParse, boolean sanitizedMacroKeys)
startDelim
- starting delimitedendDelim
- ending delimiterrecursiveParse
- whether substituted values should be parsed again, this allows macros within macro-values, for e.g. if macro is ${${component}} and key-value Map issanitizedMacroKeys
- whether the keys in the 'macrovalues' Map passed to expand() are stripped of delimiters. Default is false.Method Detail |
---|
public java.lang.String expand(java.lang.String macro, java.util.Map<java.lang.String,java.lang.String> macroValues)
macro
- the macro to parse.macroValues
- a Map contain macro key-value pairs. If sanitizedMacroValues is true then the keys should not contain delimiters.java.lang.IllegalArgumentException
- if the macro has syntax errorsjava.util.NoSuchElementException
- if a macro could not be resolved by the Map and if recursive parsing is enabled (default). If recursive parsing is disabled, the macro is left unexpanded.public void setRecursiveParse(boolean recursiveParse)
public boolean isRecursiveParse()
public void setSanitizedMacroKeys(boolean sanitizedMacroKeys)
sanitizedMacroKeys
- set to false if MacroExpander should strip delimiters from the keys before considering them for a match.public boolean isSanitizedMacroKeys()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |