|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.schema.NameRegister
public class NameRegister
Holder for registration of all global components of a schema by name.
Field Summary | |
---|---|
private java.util.HashMap |
m_globalAttributeGroupMap
Direct attribute group definitions. |
private java.util.HashMap |
m_globalAttributeMap
Direct attribute definitions. |
private java.util.HashMap |
m_globalElementMap
Direct element definitions. |
private java.util.HashMap |
m_globalGroupMap
Direct group definitions. |
private java.util.HashMap |
m_globalTypeMap
Direct type definitions. |
private java.util.HashMap |
m_importedAttributeGroupMap
External attribute group definitions (lazy create, null if unused). |
private java.util.HashMap |
m_importedAttributeMap
External attribute definitions (lazy create, null if unused). |
private java.util.HashMap |
m_importedElementMap
External element definitions (lazy create, null if unused). |
private java.util.HashMap |
m_importedGroupMap
External group definitions (lazy create, null if unused). |
private java.util.HashMap |
m_importedTypeMap
External type definitions (lazy create, null if unused). |
Constructor Summary | |
---|---|
NameRegister()
Constructor. |
Method Summary | |
---|---|
AttributeElement |
findAttribute(QName qname)
Find global attribute by name. |
AttributeGroupElement |
findAttributeGroup(QName qname)
Find attribute group by name. |
ElementElement |
findElement(QName qname)
Find global element by name. |
GroupElement |
findGroup(QName qname)
Find group by name. |
private java.lang.Object |
findInMaps(java.lang.Object key,
java.util.HashMap map1,
java.util.HashMap map2)
Find value in main or backup map. |
CommonTypeDefinition |
findType(QName qname)
Find global type by name. |
void |
mergeDefinitions(NameRegister mrg)
Merge definitions directly into this register. |
void |
mergeDefinitionsNamespaced(java.lang.String uri,
NameRegister mrg)
Merge external definitions into this register. |
void |
mergeImportedDefinitions(NameRegister mrg)
Merge external definitions into this register. |
private java.util.HashMap |
mergeLazyMap(java.util.HashMap source,
java.util.HashMap target)
Merge one map into another, where the source map may be empty and the target map may be null . |
private void |
mergeMapNamespaced(java.lang.String uri,
java.util.HashMap source,
java.util.HashMap target)
Merge one QName map into another, changing the namespace URI for keys in the source map. |
AttributeElement |
registerAttribute(QName qname,
AttributeElement def)
Register global attribute in the current schema definition. |
AttributeGroupElement |
registerAttributeGroup(QName qname,
AttributeGroupElement def)
Register global attribute group in the current schema definition. |
ElementElement |
registerElement(QName qname,
ElementElement def)
Register global element in the current schema definition. |
GroupElement |
registerGroup(QName qname,
GroupElement def)
Register global group in the current schema definition. |
CommonTypeDefinition |
registerType(QName qname,
CommonTypeDefinition def)
Register global type in the current schema definition. |
void |
reset()
Reset register for reuse. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.HashMap m_globalAttributeMap
private java.util.HashMap m_importedAttributeMap
null
if unused).
private java.util.HashMap m_globalAttributeGroupMap
private java.util.HashMap m_importedAttributeGroupMap
null
if unused).
private java.util.HashMap m_globalElementMap
private java.util.HashMap m_importedElementMap
null
if unused).
private java.util.HashMap m_globalGroupMap
private java.util.HashMap m_importedGroupMap
null
if unused).
private java.util.HashMap m_globalTypeMap
private java.util.HashMap m_importedTypeMap
null
if unused).
Constructor Detail |
---|
public NameRegister()
Method Detail |
---|
public void reset()
public AttributeElement registerAttribute(QName qname, AttributeElement def)
qname
- namedef
- attribute definition
null
if none)public AttributeGroupElement registerAttributeGroup(QName qname, AttributeGroupElement def)
qname
- namedef
- attribute definition
null
if none)public ElementElement registerElement(QName qname, ElementElement def)
qname
- namedef
- element definition
null
if none)public GroupElement registerGroup(QName qname, GroupElement def)
qname
- namedef
- attribute definition
null
if none)public CommonTypeDefinition registerType(QName qname, CommonTypeDefinition def)
qname
- namedef
- attribute definition
null
if none)private java.lang.Object findInMaps(java.lang.Object key, java.util.HashMap map1, java.util.HashMap map2)
null
) value is present in the main map it is
returned directly; otherwise, if the backup map is non-null
it is checked.
key
- map1
- main mapmap2
- backup map (null
if none)
null
if value for key not in either map)public AttributeElement findAttribute(QName qname)
qname
- name
null
if not registeredpublic AttributeGroupElement findAttributeGroup(QName qname)
qname
- name
null
if not registeredpublic ElementElement findElement(QName qname)
qname
- name
null
if not registeredpublic GroupElement findGroup(QName qname)
qname
- name
null
if not registeredpublic CommonTypeDefinition findType(QName qname)
qname
- name
null
if not registeredpublic void mergeDefinitions(NameRegister mrg)
mrg
- register supplying definitions to be mergedprivate void mergeMapNamespaced(java.lang.String uri, java.util.HashMap source, java.util.HashMap target)
uri
- namespace URI to be used for keys from source mapsource
- target
- public void mergeDefinitionsNamespaced(java.lang.String uri, NameRegister mrg)
uri
- namespace URI to be used for merged external definitionsmrg
- register supplying external definitionsprivate java.util.HashMap mergeLazyMap(java.util.HashMap source, java.util.HashMap target)
null
. If
the source map is nonempty but the target is null
, this creates a new map for the target and
returns that map; otherwise, the map returned is always the same as the target map passed in.
source
- target
- (null
if none)
null
)public void mergeImportedDefinitions(NameRegister mrg)
mrg
- register supplying external definitions
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |