|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pf.textx.BasicVariableContainer
This is a basic implementation of the interface VariableResolver. It provides a container for a simple mapping of variable name to their corresponding values.
| Constructor Summary | |
BasicVariableContainer()
Initialize the new instance with default values. |
|
BasicVariableContainer(java.util.Map mapping)
Initialize the new instance with the given mapping. |
|
| Method Summary | |
void |
addFrom(java.util.Map vars)
Adds all key value pairs from the given map to the variables, if the key is a String. |
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 |
removeVariable(java.lang.String varName)
Remove the variable with the specified name. |
void |
setValue(java.lang.String varName,
java.lang.String value)
Sets the value of the variable with the given name. |
void |
setValueFor(java.lang.String varName,
boolean value)
Sets the boolean value of the variable with the given name. |
void |
setValueFor(java.lang.String varName,
java.lang.Object value)
Sets the value of the variable with the given name. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BasicVariableContainer()
public BasicVariableContainer(java.util.Map mapping)
mapping - The instance of a Map interface compliant class.| Method Detail |
public java.util.Set knownVariableNames()
knownVariableNames in interface VariableResolver
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 void setValueFor(java.lang.String varName,
java.lang.Object value)
setValueFor in interface VariableContainervarName - The case sensitive name of the variable. Must not be null !value - The new value of the variable. Must not be null !
public void setValueFor(java.lang.String varName,
boolean value)
varName - The case sensitive name of the variable. Must not be null !value - The boolean value
public void setValue(java.lang.String varName,
java.lang.String value)
setValue in interface VariableContainervarName - The case sensitive name of the variable. Must not be null !value - The new value of the variable. Must not be null !public void removeVariable(java.lang.String varName)
removeVariable in interface VariableContainervarName - The name of the variable to be removedpublic void addFrom(java.util.Map vars)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||