|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Context
Contains the global context for the evaluation of a machine profile. Separate hashes are kept for functions, types, and variables allowing them to have identical names. The root element allows properties or resources to be found in the tree of configuration information.
| Field Summary | |
|---|---|
static java.lang.String |
TPL_VAR
|
| Method Summary | |
|---|---|
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(java.lang.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)
|
java.util.Map<Path,java.util.List<FullType>> |
getBindings()
This method returns an unmodifiable, ordered map of the type bindings. |
int |
getCallLimit()
|
Template |
getCurrentTemplate()
|
java.util.Set<SourceFile> |
getDependencies()
Returns an unmodifiable copy of the dependencies. |
int |
getDeprecationLevel()
|
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. |
boolean |
getFailOnWarn()
|
java.lang.String |
getFinalReason(Path p)
|
FullType |
getFullType(java.lang.String name)
Return the type associated with the given name or null if it doesn't exist. |
FunctionDefinition |
getFunction(java.lang.String name)
Return the function definition associated with the given name or null if it doesn't exist. |
Element |
getGlobalVariable(java.lang.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(java.lang.String name)
Return the value associated with a local variable. |
java.util.Set<java.lang.String> |
getObjectDependencies()
Returns an unmodifiable copy of the object dependencies. |
Template |
getObjectTemplate()
Returns the object Template which is the basis of this ObjectContext. |
java.util.List<java.lang.String> |
getRelativeLoadpaths()
|
HashResource |
getRoot()
Returns the root element for this context. |
Element |
getSelf()
|
java.lang.String |
getTraceback(SourceRange sourceRange)
|
Element |
getVariable(java.lang.String name)
Return the Element which corresponds to the given variable name. |
Template |
globalLoad(java.lang.String name)
A method to load a template from the global cache. |
Template |
globalLoad(java.lang.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(java.lang.String name,
boolean lookupOnly)
|
Template |
localLoad(java.lang.String name)
A method to load a template from the local cache. |
SourceFile |
lookupFile(java.lang.String name)
|
void |
popTemplate(java.util.logging.Level logLevel,
java.lang.String logMessage)
|
void |
printTraceback(SourceRange sourceRange)
|
void |
pushTemplate(Template template,
SourceRange sourceRange,
java.util.logging.Level logLevel,
java.lang.String logMessage)
|
void |
putElement(Path path,
Element value)
|
void |
removeGlobalVariable(java.lang.String name)
Unconditionally remove a global variable. |
GlobalVariable |
replaceGlobalVariable(java.lang.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(java.lang.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(java.lang.String name,
FullType fullType,
Template template,
SourceRange sourceRange)
Associate the given type with the given name within this ObjectContext. |
void |
setFunction(java.lang.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(java.lang.String name,
Element value)
Set the variable to the given value, preserving the status of the final flag. |
void |
setGlobalVariable(java.lang.String name,
Element value,
boolean finalFlag)
Set the variable to the given value. |
void |
setGlobalVariable(java.lang.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(java.lang.String name,
Element value)
Set the local variable to the given value. |
void |
setLocalVariable(java.lang.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(java.util.List<java.lang.String> rpaths)
|
void |
turnOffObjectDependencyChecking()
Turn off the object dependency checking. |
| Field Detail |
|---|
static final java.lang.String TPL_VAR
| Method Detail |
|---|
Template getObjectTemplate()
HashResource getRoot()
HashResource restoreRelativeRoot(HashResource previousValue)
previousValue - previous value of the relative root to restore
HashResource createRelativeRoot()
java.util.Set<SourceFile> getDependencies()
java.util.Set<java.lang.String> getObjectDependencies()
void turnOffObjectDependencyChecking()
Template localLoad(java.lang.String name)
Template globalLoad(java.lang.String name)
Template localAndGlobalLoad(java.lang.String name,
boolean lookupOnly)
Template globalLoad(java.lang.String name,
boolean lookupOnly)
SourceFile lookupFile(java.lang.String name)
LocalVariableMap createLocalVariableMap(ListResource argv)
void restoreLocalVariableMap(LocalVariableMap localVariableHolder)
IteratorMap createIteratorMap()
void restoreIteratorMap(IteratorMap iteratorMap)
void setObjectAndLoadpath()
FunctionDefinition getFunction(java.lang.String name)
name - name of the function to retrieve
void setFunction(java.lang.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 existsjava.util.Map<Path,java.util.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(java.lang.String name)
name - name of the type to retrieve
void setFullType(java.lang.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 name
void setGlobalVariable(java.lang.String name,
Element value)
void setGlobalVariable(java.lang.String name,
GlobalVariable variable)
name - global variable namevariable - GlobalVariable to associate with name
GlobalVariable replaceGlobalVariable(java.lang.String name,
Element value,
boolean finalFlag)
void setGlobalVariable(java.lang.String name,
Element value,
boolean finalFlag)
void setIterator(Resource resource,
Resource.Iterator iterator)
Resource.Iterator getIterator(Resource resource)
void removeGlobalVariable(java.lang.String name)
Element getGlobalVariable(java.lang.String name)
GlobalVariable retrieveGlobalVariable(java.lang.String name)
void pushTemplate(Template template,
SourceRange sourceRange,
java.util.logging.Level logLevel,
java.lang.String logMessage)
void popTemplate(java.util.logging.Level logLevel,
java.lang.String logMessage)
void printTraceback(SourceRange sourceRange)
java.lang.String getTraceback(SourceRange sourceRange)
void setCurrentTemplate(Template template)
Template getCurrentTemplate()
Element getElement(Path path)
throws EvaluationException,
ValidationException
path - absolute or external path to lookup
EvaluationException - if the path cannot be found or the path is relative
ValidationException
Element getElement(Path path,
boolean errorIfNotFound)
throws EvaluationException
path - path to lookuperrorIfNotFound - if true an EvaluationException will be thrown if the path
can't be found
EvaluationException - if the path can't be found and errorIfNotFound is set, or if
the path is relative and relativeRoot isn't set
void putElement(Path path,
Element value)
Element executeDmlBlock(Operation dml)
boolean executeDmlValidationBlock(Operation dml,
Element self)
throws ValidationException
ValidationExceptionElement getLocalVariable(java.lang.String name)
name - name of the variable to lookup
Element getVariable(java.lang.String name)
name - name of the variable to lookup
Element dereferenceVariable(java.lang.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 variable
InvalidTermException
void setLocalVariable(java.lang.String name,
Element value)
throws EvaluationException
name - name of the local variablevalue - value to use or null to remove the variable
EvaluationException - if there is a global variable with the same name as the local
variable
void setLocalVariable(java.lang.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 variable
EvaluationException - if there is a global variable with the same name as the local
variableint getCallLimit()
int getIterationLimit()
boolean isFinal(Path p)
java.lang.String getFinalReason(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)
void setRelativeLoadpaths(java.util.List<java.lang.String> rpaths)
java.util.List<java.lang.String> getRelativeLoadpaths()
int getDeprecationLevel()
boolean getFailOnWarn()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||