|
Oracle Fusion Applications Java API Reference for Oracle Enterprise Scheduler Service 11g Release 1 (11.1.1.5) E20742-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.as.scheduler.substitution.AbstractSubstitutor
public abstract class AbstractSubstitutor
Perform token substitutions on a string using a
set of SubstitutionHandlers.
This class provides much of the functionality needed to create a
Substitutor. A concrete implementation of this class will typically
be paired with an interface that extends SubstitutionHandler with
implementation-specific initialization.
Substitution tokens can take any of the following forms:
${NAME}
${ID:NAME}
${ID1,ID2:NAME}
The NAME portion of the token is passed to
SubstitutionHandler.containsKey(String) and
SubstitutionHandler.get(String).
The ID portion of the token is matched with the value of
SubstitutionHandler.getId(). If no ID is specified, the
first handler in the list that responds to NAME is used.
If one or more IDs are specified, then only handlers reporting
matching IDs will be queried for the given NAME.
# see SubstitutionHandler
| Constructor Summary | |
|---|---|
AbstractSubstitutor()
|
|
| Method Summary | |
|---|---|
void |
close()
Cleanup substitutor state and release all handlers. |
protected void |
closeHandlers()
Call close() on all instantiated handlers, and release the instances. |
protected SubstitutionHandler |
getMatchingHandler(java.lang.String subId,
java.lang.String name)
Find the first handler in the list that matches on substitution ID and name. |
protected boolean |
initializeHandler(SubstitutionHandler handler)
Implementations of AbstractSubstitutor may override this
method to perform implementation specific initialization for each handler
instance. |
void |
setSubstitutionHandlers(java.util.List<SubstitutionHandler> handlers)
Set the list of SubstitutionHandlers to use. |
void |
setSubstitutionHandlers(java.lang.String subsHandlerNames)
Set the list of SubstitutionHandlers to use. |
protected java.util.List<SubstitutionHandler> |
stringToHandlers(java.lang.String subsHandlerNames)
Parse the subsHandlerNamesstring, instantiate the named
SubstitutionHandler classes, and return them in a list. |
java.lang.String |
substitute(java.lang.String original)
Recursively replaces all tokens in the string original
with the results from matching handlers. |
protected java.lang.String |
substituteTokens(java.lang.String valueTokens,
java.util.List<java.lang.String> tokenHistory)
Takes a string with tokens and returns the values; called recursively |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractSubstitutor()
| Method Detail |
|---|
public void setSubstitutionHandlers(java.lang.String subsHandlerNames)
SubstitutionHandlers to use.
setSubstitutionHandlers in interface SubstitutorsubsHandlerNames - Comma-separated list of class names that implement
SubstitutionHandlerpublic void setSubstitutionHandlers(java.util.List<SubstitutionHandler> handlers)
SubstitutionHandlers to use.
setSubstitutionHandlers in interface Substitutorhandlers - List of SubstitutionHandlerspublic void close()
close in interface Substitutorprotected void closeHandlers()
close() on all instantiated handlers, and release the instances.
protected java.util.List<SubstitutionHandler> stringToHandlers(java.lang.String subsHandlerNames)
subsHandlerNamesstring, instantiate the named
SubstitutionHandler classes, and return them in a list.
Any names that cannot be instantiated as a valid
SubstitutionHandler will be skipped.
subsHandlerNames - Comma-separated list substitution handler class names.
protected boolean initializeHandler(SubstitutionHandler handler)
AbstractSubstitutor may override this
method to perform implementation specific initialization for each handler
instance.
public java.lang.String substitute(java.lang.String original)
original
with the results from matching handlers. Any tokens that are not
recognized by any handlers will remain in the string.
substitute in interface Substitutororiginal -
protected java.lang.String substituteTokens(java.lang.String valueTokens,
java.util.List<java.lang.String> tokenHistory)
valueTokens - Input string containing zero or more tokens to be replacedtokenHistory - List of substitutions that got us here; used for
circular reference detection.
Should be an empty (not null) list on first invocation.
protected SubstitutionHandler getMatchingHandler(java.lang.String subId,
java.lang.String name)
SubstitutionHandlers passed to the Substitutor,
and the first match is the one used. The order of the IDs
in the token has no effect.
subId - - Comma-separated list if IDs to match. If null, match any handler.name - - the name of to key to search for.
subId and name.
|
Oracle Fusion Applications Java API Reference for Oracle Enterprise Scheduler Service 11g Release 1 (11.1.1.5) E20742-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||