|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.binding.model.ClassHierarchyContext
public class ClassHierarchyContext
Context for components using a hierarchy of definitions based on class type. This is used to track conversion definitions in the form of format and template elements. The access methods take the different levels of nesting into account, automatically delegating to the containing context (if defined) when a lookup fails.
Field Summary | |
---|---|
private java.util.HashSet |
m_compatibleTypeSet
Set of compatible type names. |
private java.util.HashMap |
m_nameToComponentMap
Map from format names to String conversions (lazy create). |
private ClassHierarchyContext |
m_outerContext
Link to containing context. |
private java.util.HashMap |
m_typeToComponentMap
Map from type name to binding component. |
Constructor Summary | |
---|---|
protected |
ClassHierarchyContext(ClassHierarchyContext outer)
Constructor. |
Method Summary | |
---|---|
private void |
accumulateInterfaces(IClass clas,
java.util.Set intfset)
Accumulate all the interfaces implemented (both directly and indirectly) by a class. |
void |
addNamedComponent(java.lang.String label,
ElementBase comp,
ValidationContext vctx)
Add named component to set defined at this level. |
void |
addTypedComponent(IClass clas,
ElementBase comp,
ValidationContext vctx)
Add typed component to set defined at this level. |
ClassHierarchyContext |
getContaining()
Get containing context. |
ElementBase |
getMostSpecificComponent(IClass clas)
Get best binding component for class. |
ElementBase |
getNamedComponent(java.lang.String name)
Get named binding component definition. |
ElementBase |
getSpecificComponent(java.lang.String name)
Get specific binding component for type. |
boolean |
isCompatibleType(IClass clas)
Checks if a class is compatible with one or more components. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final ClassHierarchyContext m_outerContext
private java.util.HashMap m_typeToComponentMap
private java.util.HashSet m_compatibleTypeSet
private java.util.HashMap m_nameToComponentMap
String
conversions (lazy create).
Constructor Detail |
---|
protected ClassHierarchyContext(ClassHierarchyContext outer)
outer
- containing context (null
if at root of tree)Method Detail |
---|
public ClassHierarchyContext getContaining()
null
if at root of
tree)private void accumulateInterfaces(IClass clas, java.util.Set intfset)
clas
- intfset
- set of interfacespublic void addTypedComponent(IClass clas, ElementBase comp, ValidationContext vctx)
clas
- class information to be associated with componentcomp
- definition component to be addedvctx
- validation context in usepublic void addNamedComponent(java.lang.String label, ElementBase comp, ValidationContext vctx)
label
- name to be associated with componentcomp
- definition component to be addedvctx
- validation context in usepublic ElementBase getSpecificComponent(java.lang.String name)
name
- fully qualified class name to be converted
null
if not
foundpublic ElementBase getNamedComponent(java.lang.String name)
name
- component name to be found
null
if not
foundpublic ElementBase getMostSpecificComponent(IClass clas)
clas
- information for target class
null
if
none foundpublic boolean isCompatibleType(IClass clas)
clas
- information for target class
true
if compatible type, false
if not
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |