public interface Context
| Modifier and Type | Method and Description |
|---|---|
void |
clearSelf() |
IteratorMap |
createIteratorMap() |
LocalVariableMap |
createLocalVariableMap(ListResource argv) |
HashResource |
createRelativeRoot()
Initializes the relative root for this context and returns the old
relative root.
|
Element |
dereferenceVariable(String name,
boolean lookupOnly,
Term[] terms)
Return the Element which corresponds to the given variable name.
|
Element |
executeDmlBlock(Operation dml) |
boolean |
executeDmlValidationBlock(Operation dml,
Element self) |
Map<Path,List<FullType>> |
getBindings()
This method returns an unmodifiable, ordered map of the type bindings.
|
int |
getCallLimit() |
Template |
getCurrentTemplate() |
Set<SourceFile> |
getDependencies()
Returns an unmodifiable copy of the dependencies.
|
CompilerOptions.DeprecationWarnings |
getDeprecationWarnings() |
Element |
getElement(Path path)
Pull the value of an element from a configuration tree.
|
Element |
getElement(Path path,
boolean errorIfNotFound)
Pull the value of an element from a configuration tree.
|
String |
getFinalReason(Path p) |
FullType |
getFullType(String name)
Return the type associated with the given name or null if it doesn't
exist.
|
FunctionDefinition |
getFunction(String name)
Return the function definition associated with the given name or null if
it doesn't exist.
|
Element |
getGlobalVariable(String name)
Return the Element which corresponds to the given variable name without
duplicating the value.
|
int |
getIterationLimit() |
Resource.Iterator |
getIterator(Resource resource)
Get the iterator for the given resource or null if the iterator has not
been registered.
|
Element |
getLocalVariable(String name)
Return the value associated with a local variable.
|
Set<String> |
getObjectDependencies()
Returns an unmodifiable copy of the object dependencies.
|
String |
getObjectName()
Get the name of the object template.
|
Template |
getObjectTemplate()
Returns the object Template which is the basis of this ObjectContext.
|
List<String> |
getRelativeLoadpaths() |
HashResource |
getRoot()
Returns the root element for this context.
|
Element |
getSelf() |
String |
getTraceback(SourceRange sourceRange) |
Element |
getVariable(String name)
Return the Element which corresponds to the given variable name.
|
Template |
globalLoad(String name)
A method to load a template from the global cache.
|
Template |
globalLoad(String name,
boolean lookupOnly)
A method to load a template from the global cache.
|
void |
initializeSelfHolder(SelfHolder selfHolder) |
boolean |
isCompileTimeContext()
This flag indicates if this context is a special one used for the
compile-time evaluation of DML blocks.
|
boolean |
isFinal(Path p) |
boolean |
isSelfFinal() |
Template |
localAndGlobalLoad(String name,
boolean lookupOnly) |
Template |
localLoad(String name)
A method to load a template from the local cache.
|
SourceFile |
lookupFile(String name) |
void |
popTemplate(Level logLevel,
String logMessage) |
void |
printTraceback(SourceRange sourceRange) |
void |
pushTemplate(Template template,
SourceRange sourceRange,
Level logLevel,
String logMessage) |
void |
putElement(Path path,
Element value) |
void |
removeGlobalVariable(String name)
Unconditionally remove a global variable.
|
GlobalVariable |
replaceGlobalVariable(String name,
Element value,
boolean finalFlag)
Replaces the given global variable with the given value.
|
void |
resetSelf(Element newValue) |
void |
restoreIteratorMap(IteratorMap iteratorMap) |
void |
restoreLocalVariableMap(LocalVariableMap localVariableHolder) |
HashResource |
restoreRelativeRoot(HashResource previousValue)
Retrieve and clear the relative root for this context.
|
void |
restoreSelf(SelfHolder self) |
GlobalVariable |
retrieveGlobalVariable(String name) |
SelfHolder |
saveSelf() |
void |
setBinding(Path path,
FullType fullType,
Template template,
SourceRange sourceRange)
This method associates a type definition to a path.
|
void |
setCurrentTemplate(Template template) |
void |
setFinal(Path p) |
void |
setFullType(String name,
FullType fullType,
Template template,
SourceRange sourceRange)
Associate the given type with the given name within this ObjectContext.
|
void |
setFunction(String name,
Operation function,
Template template,
SourceRange sourceRange)
Define the given DML block as a function with the given name in this
context.
|
void |
setGlobalVariable(String name,
Element value)
Set the variable to the given value, preserving the status of the final
flag.
|
void |
setGlobalVariable(String name,
Element value,
boolean finalFlag)
Set the variable to the given value.
|
void |
setGlobalVariable(String name,
GlobalVariable variable)
Set the variable to the given GlobalVariable.
|
void |
setIterator(Resource resource,
Resource.Iterator iterator)
Register a Resource iterator in the context.
|
void |
setLocalVariable(String name,
Element value)
Set the local variable to the given value.
|
void |
setLocalVariable(String name,
Term[] terms,
Element value)
Set the local variable to the given value.
|
void |
setObjectAndLoadpath()
Set the name of the object template.
|
void |
setRelativeLoadpaths(List<String> rpaths) |
void |
turnOffObjectDependencyChecking()
Turn off the object dependency checking.
|
static final String TPL_VAR
Template getObjectTemplate()
HashResource getRoot()
HashResource restoreRelativeRoot(HashResource previousValue)
previousValue - previous value of the relative root to restoreHashResource createRelativeRoot()
Set<SourceFile> getDependencies()
Set<String> getObjectDependencies()
void turnOffObjectDependencyChecking()
Template localLoad(String name)
Template globalLoad(String name)
Template globalLoad(String name, boolean lookupOnly)
SourceFile lookupFile(String name)
LocalVariableMap createLocalVariableMap(ListResource argv)
void restoreLocalVariableMap(LocalVariableMap localVariableHolder)
IteratorMap createIteratorMap()
void restoreIteratorMap(IteratorMap iteratorMap)
void setObjectAndLoadpath()
String getObjectName()
FunctionDefinition getFunction(String name)
name - name of the function to retrievevoid setFunction(String name, Operation function, Template template, SourceRange sourceRange) throws EvaluationException
name - name for the functionfunction - code for the function as a DML blocktemplate - template in which this function is defined (used for error
handling)sourceRange - location in the template where this function is defined (used
for error handling)EvaluationException - if a function with the given name already existsMap<Path,List<FullType>> getBindings()
void setBinding(Path path, FullType fullType, Template template, SourceRange sourceRange)
path - absolute path to bind to the typefullType - data type to usetemplate - template where the binding was defined (used for error
handling)sourceRange - location in the template where the binding was defined (used
for error handling)FullType getFullType(String name)
name - name of the type to retrievevoid setFullType(String name, FullType fullType, Template template, SourceRange sourceRange) throws EvaluationException
name - name to associate to the typefullType - data type to use for the definitiontemplate - template where the type is defined (used for error handling)sourceRange - location in the template where the type is defined (used for
error handling)EvaluationException - if there is already a type associated with the given namevoid setGlobalVariable(String name, Element value)
void setGlobalVariable(String name, GlobalVariable variable)
name - global variable namevariable - GlobalVariable to associate with nameGlobalVariable replaceGlobalVariable(String name, Element value, boolean finalFlag)
void setGlobalVariable(String name, Element value, boolean finalFlag)
void setIterator(Resource resource, Resource.Iterator iterator)
Resource.Iterator getIterator(Resource resource)
void removeGlobalVariable(String name)
Element getGlobalVariable(String name)
GlobalVariable retrieveGlobalVariable(String name)
void pushTemplate(Template template, SourceRange sourceRange, Level logLevel, String logMessage)
void printTraceback(SourceRange sourceRange)
String getTraceback(SourceRange sourceRange)
void setCurrentTemplate(Template template)
Template getCurrentTemplate()
Element getElement(Path path) throws EvaluationException, ValidationException
path - absolute or external path to lookupEvaluationException - if the path cannot be found or the path is relativeValidationExceptionElement getElement(Path path, boolean errorIfNotFound) throws EvaluationException
path - path to lookuperrorIfNotFound - if true an EvaluationException will be thrown if the path
can't be foundEvaluationException - if the path can't be found and errorIfNotFound is set, or if
the path is relative and relativeRoot isn't setboolean executeDmlValidationBlock(Operation dml, Element self) throws ValidationException
ValidationExceptionElement getLocalVariable(String name)
name - name of the variable to lookupElement getVariable(String name)
name - name of the variable to lookupElement dereferenceVariable(String name, boolean lookupOnly, Term[] terms) throws InvalidTermException
name - name of the variable to lookuplookupOnly - flag indicating if only a lookup should be doneterms - values for dereferencing the given variableInvalidTermExceptionvoid setLocalVariable(String name, Element value) throws EvaluationException
name - name of the local variablevalue - value to use or null to remove the variableEvaluationException - if there is a global variable with the same name as the local
variablevoid setLocalVariable(String name, Term[] terms, Element value) throws EvaluationException
name - name of the local variableterms - terms used to dereference the variable, or null if the
variable is to be used directlyvalue - value to use or null to remove the variableEvaluationException - if there is a global variable with the same name as the local
variableint getCallLimit()
int getIterationLimit()
boolean isFinal(Path p)
void setFinal(Path p)
boolean isCompileTimeContext()
void initializeSelfHolder(SelfHolder selfHolder)
boolean isSelfFinal()
Element getSelf()
void clearSelf()
SelfHolder saveSelf()
void restoreSelf(SelfHolder self)
void resetSelf(Element newValue)
CompilerOptions.DeprecationWarnings getDeprecationWarnings()
Copyright © 2014 Quattor. All Rights Reserved.