public class TreeContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private BindingElement |
m_bindingRoot
Binding element model root (may be
null , if not configured
by caller). |
private DefinitionContext |
m_globalContext
Global definition context (outside of binding).
|
private IClassLocator |
m_locator
Class locator set by environment code.
|
private java.util.HashSet |
m_skipSet
Set of elements to be skipped in walking tree.
|
private ObjectStack |
m_treeHierarchy
Stack of items for parent hierarchy to current node in tree.
|
Modifier | Constructor and Description |
---|---|
private |
TreeContext()
Internal null constructor.
|
|
TreeContext(IClassLocator iloc)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addSkip(java.lang.Object skip)
Add element to set to be skipped.
|
BindingElement |
getBindingRoot()
Get root element of binding.
|
TreeContext |
getChildContext()
Get a secondary context for the same tree as this instance.
|
IClass |
getClassInfo(java.lang.String name)
Get class information.
|
ContainerElementBase |
getContextObject()
Get parent container with linked object.
|
DefinitionContext |
getCurrentDefinitions()
Get definition context for innermost nesting element.
|
DefinitionContext |
getDefinitions()
Get innermost containing definition context.
|
DefinitionContext |
getFormatDefinitions()
Get definition context for innermost nesting element for use by a
format (or namespace).
|
int |
getNestingDepth()
Get depth of nesting in binding.
|
ContainerElementBase |
getParentContainer()
Get parent container information.
|
NestingElementBase |
getParentElement()
Get containing element.
|
ElementBase |
getParentElement(int level)
Get containing element at generation level.
|
IClass |
getRequiredClassInfo(java.lang.String name)
Get required class information.
|
boolean |
isInBinding()
Check if binding supports input.
|
boolean |
isLookupSupported()
Check if class lookup is supported.
|
boolean |
isOutBinding()
Check if binding supports output.
|
boolean |
isSkipped(java.lang.Object obj)
Check if a component is being skipped due to a fatal error.
|
protected ElementBase |
peekElement()
Peek current element of hierarchy.
|
ElementBase |
popNode()
Pop node from tree.
|
void |
pushNode(ElementBase node)
Push node on tree.
|
void |
setBindingRoot(BindingElement root)
Set root element of binding.
|
void |
setGlobalDefinitions(DefinitionContext dctx)
Set the global definition context.
|
void |
tourTree(BindingElement root,
ModelVisitor visitor)
Tour complete binding model tree.
|
void |
tourTree(ElementBase root,
ModelVisitor visitor)
Tour binding model tree.
|
private DefinitionContext m_globalContext
private BindingElement m_bindingRoot
null
, if not configured
by caller).private ObjectStack m_treeHierarchy
private IClassLocator m_locator
private java.util.HashSet m_skipSet
private TreeContext()
public TreeContext(IClassLocator iloc)
iloc
- class locator to be usedpublic TreeContext getChildContext()
public void setGlobalDefinitions(DefinitionContext dctx)
dctx
- global definition contextpublic void tourTree(BindingElement root, ModelVisitor visitor)
root
- binding element root of treevisitor
- target visitor for element notificationspublic void tourTree(ElementBase root, ModelVisitor visitor)
root
- node of tree to be touredvisitor
- target visitor for element notificationspublic int getNestingDepth()
protected ElementBase peekElement()
public boolean isSkipped(java.lang.Object obj)
obj
- component to be checkedprotected void addSkip(java.lang.Object skip)
skip
- public BindingElement getBindingRoot()
java.lang.IllegalStateException
- if no root element knownpublic void setBindingRoot(BindingElement root)
root
- root element of bindingpublic NestingElementBase getParentElement()
1
parent, except that it checks for the case where there's
no parent present.null
if no parentpublic ElementBase getParentElement(int level)
NestingElementBase
.level
- generation level of parentpublic ContainerElementBase getParentContainer()
public ContainerElementBase getContextObject()
public boolean isInBinding()
true
if input binding, false
if notpublic boolean isOutBinding()
true
if output binding, false
if notpublic DefinitionContext getDefinitions()
public DefinitionContext getCurrentDefinitions()
public DefinitionContext getFormatDefinitions()
public boolean isLookupSupported()
false
,
lookup methods return only place holder class information.true
if class lookup supported, false
if only place holder information returnedpublic IClass getClassInfo(java.lang.String name)
name
- fully-qualified name of class to be foundnull
if class not foundpublic IClass getRequiredClassInfo(java.lang.String name)
name
- fully-qualified name of class to be foundpublic void pushNode(ElementBase node)
node
- public ElementBase popNode()