Package org.jibx.schema
Class SchemaHolder
java.lang.Object
org.jibx.util.HolderBase
org.jibx.schema.SchemaHolder
External data for a schema definition. This tracks references to other schemas, along with the associated namespace
information. The
finish()
method actually generates the includes.- Author:
- Dennis M. Sosnoski
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final UniqueNameSet
Set of element names defined in schema (also used for group/attributeGroup; only for new definitions).private Set
Set of schemas imported into this schema.private final SchemaElement
Actual schema definition.private final UniqueNameSet
Set of type names defined in schema (only for new schema definitions). -
Constructor Summary
ConstructorsConstructorDescriptionSchemaHolder
(String uri) Constructor for new schema definition file.SchemaHolder
(SchemaElement schema) Constructor for existing schema definition file. -
Method Summary
Modifier and TypeMethodDescriptionaddElementName
(String base) Add element name to set defined.protected void
addNamespaceDecl
(String prefix, String uri) Implementation method to handle adding a namespace declaration.addTypeName
(String base) Add type name to set defined.void
finish()
Implementation method to handle references from this schema to other schemas.Get the schema definition.Methods inherited from class org.jibx.util.HolderBase
addReference, getFileName, getNamespace, getPrefix, getReferences, isExistingFile, isModifiable, setFileName
-
Field Details
-
m_schema
Actual schema definition. -
m_typeNameSet
Set of type names defined in schema (only for new schema definitions). -
m_elementNameSet
Set of element names defined in schema (also used for group/attributeGroup; only for new definitions). -
m_fixedSet
Set of schemas imported into this schema.
-
-
Constructor Details
-
SchemaHolder
Constructor for new schema definition file.- Parameters:
uri
- (null
if no-namespace schema)
-
SchemaHolder
Constructor for existing schema definition file.- Parameters:
schema
- schema definition
-
-
Method Details
-
getSchema
Get the schema definition.- Returns:
- definition
-
addTypeName
Add type name to set defined. This assures uniqueness of the name used, if necessary modifying the supplied base name to a unique alternative.- Parameters:
base
- name to try adding- Returns:
- name to be used for type
-
addElementName
Add element name to set defined. This assures uniqueness of the name used, if necessary modifying the supplied base name to a unique alternative. The same set of names is also used for groups and attributeGroups, even though these name sets are separate in schema terms. Doing things this way avoids the possibility of an element name matching a group name with the two representing different structures.- Parameters:
base
- name to try adding- Returns:
- name to be used for element
-
addNamespaceDecl
Implementation method to handle adding a namespace declaration. This sets up the namespace declaration for output in the generated XML.- Specified by:
addNamespaceDecl
in classHolderBase
- Parameters:
prefix
-uri
-
-
finish
public void finish()Implementation method to handle references from this schema to other schemas. This adds import elements to the constructed schema for all referenced schemas.- Overrides:
finish
in classHolderBase
-