|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.textx.VariableResolverPool
public class VariableResolverPool
Instances of this class can pool several VariableResolver. It provides a single entry point to them by implementing the interface VariableResolver itself and redirecting it to one of the pooled variable resolver.
| Constructor Summary | |
|---|---|
VariableResolverPool()
Initialize the new instance with default values. |
|
VariableResolverPool(java.util.Map aMap)
Initialize the new instance with the given map to hold the pooled objects. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.String resolverName,
VariableResolver resolver)
Add the given resolver under the given name to the pool. |
java.lang.Object |
getValue(java.lang.String varName)
Returns the value for the variable with the given name. |
boolean |
isKnownVariable(java.lang.String varName)
Returns if the variable with the given name can be resolved by the receiver. |
java.util.Set |
knownVariableNames()
Returns all variable name the resolver currently knows |
void |
remove(java.lang.String resolverName)
Remove the resolver with the given name from the pool. |
void |
replace(java.lang.String resolverName,
VariableResolver resolver)
Replace the resolver under the given name to the pool. |
VariableResolver |
resolverNamed(java.lang.String resolverName)
Return the resolver that was registered under the specified name in this pool. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VariableResolverPool()
public VariableResolverPool(java.util.Map aMap)
aMap - The instance of a Map interface compliant class.| Method Detail |
|---|
public java.lang.Object getValue(java.lang.String varName)
throws UnknownVariableException
getValue in interface VariableResolvervarName - The case sensitive name of the variable.
UnknownVariableException - The receiver is not knowing the variable.public boolean isKnownVariable(java.lang.String varName)
isKnownVariable in interface VariableResolvervarName - The case sensitive name of the variable.
public java.util.Set knownVariableNames()
knownVariableNames in interface VariableResolver
public void add(java.lang.String resolverName,
VariableResolver resolver)
resolverName - The unique name of the resolver in the pool.resolver - The variable resolver to add.
public void replace(java.lang.String resolverName,
VariableResolver resolver)
resolverName - The unique name of the resolver in the pool.resolver - The replacing variable resolver.public void remove(java.lang.String resolverName)
resolverName - The unique name of the resolver in the pool.public VariableResolver resolverNamed(java.lang.String resolverName)
resolverName - The unique name of the resolver in the pool.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||