Class VariableStore
java.lang.Object
org.apache.torque.generator.variable.VariableStore
Stores all variables which are currently accessible.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all variables from this store.voidendFile()Signals this store that the processing of one file has ended.voidSignals this store that generation has ended.voidSignals this store that the processing of a outlet has ended.Returns a map with the variables contained in this store.Returns the most specific variable which is visible from the key's namespace and has the same name as the key's name.voidremoves a variable from the store.voidSets a variable.voidSignals this store that the processing of a outlet has started.
-
Constructor Details
-
VariableStore
public VariableStore()
-
-
Method Details
-
set
Sets a variable.- Parameters:
variable- the variable to set.- Throws:
NullPointerException- if variable is null.
-
remove
removes a variable from the store.- Parameters:
variable- the variable to remove, not null.- Throws:
NullPointerException- if variable is null.
-
startOutlet
public void startOutlet()Signals this store that the processing of a outlet has started. -
endOutlet
public void endOutlet()Signals this store that the processing of a outlet has ended. Removes all variables with the scopeVariable.Scope.OUTLET, and all variables with the scopeVariable.Scope.CHILDRENwhich were set by the outlet which processing ended. -
endFile
public void endFile()Signals this store that the processing of one file has ended. Removes all variables with the scopeFILE. -
endGeneration
public void endGeneration()Signals this store that generation has ended. Removes the variables from all scopes. -
clear
public void clear()Removes all variables from this store. -
getContent
Returns a map with the variables contained in this store. Note that if one variable is hidden by another with a more specific scope, only the variable with the more specific scope is returned.The Map is not backed by this stores, i.e. adding and removing variables to the returned nmap has no effect on this store. However, the variables in the returned map are the variables in this store, i.e. setting the value of the variable will change the variable in this store.
Note: The current store content is rebuilt each time this method is called. For this reason,
store.getInHierarchy(qualifiedName)is much faster thanstore.getContent().get(qualifiedName).- Returns:
- a map with the variables contained ins this store, never null.
-
getInHierarchy
Returns the most specific variable which is visible from the key's namespace and has the same name as the key's name. if several most specific variables are found in the different scopes, the one with the most specific scope is returned.- Parameters:
key- The key for the variable.- Returns:
- the most specific matching variable, or null if no variable matches.
-