Package org.jibx.schema.codegen
Class ItemVisitor
java.lang.Object
org.jibx.schema.SchemaVisitor
org.jibx.schema.codegen.ItemVisitor
Visitor to build the code generation items corresponding to a component.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate GlobalExtensionExtension information for the global definition being constructed.private GroupItemGroup currently being constructed.private intNesting depth, tracked for indenting of debug information.private static final LoggerLogger for class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddReference(AnnotatedBase comp, AnnotatedBase ref) Add a reference to a global definition to the structure.private voidaddTypeRefItem(AnnotatedBase comp, CommonTypeDefinition def) Build an item from a type reference.buildGlobal(AnnotatedBase comp) Build the item structure corresponding to a schema global definition component.private GroupItembuildStructure(boolean isenum, AnnotatedBase comp) Build the item structure corresponding to a particular schema component.private JavaTypeGet the data type information for a built-in schema type.booleanvisit(AnyElement node) Visit <any> definition.booleanvisit(AttributeElement node) Visit <attribute> definition.booleanVisit <attributeGroup> reference.booleanVisit compositor.booleanvisit(ComplexExtensionElement node) Visit complex type <extension> definition.booleanVisit complex type <restriction> definition.booleanvisit(ElementElement node) Visit <element> definition.booleanvisit(GroupRefElement node) Visit <group> reference.booleanvisit(ListElement node) Visit <list> element.booleanvisit(SimpleExtensionElement node) Visit simple type <extension> element.booleanVisit simple type <restriction> element.booleanvisit(SimpleTypeElement node) Visit <simpleType> element.booleanvisit(UnionElement node) Visit <union> element.Methods inherited from class org.jibx.schema.SchemaVisitor
exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, exit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Field Details
-
s_logger
private static final Logger s_loggerLogger for class. -
m_global
Extension information for the global definition being constructed. -
m_group
Group currently being constructed. -
m_nestingDepth
private int m_nestingDepthNesting depth, tracked for indenting of debug information.
-
-
Constructor Details
-
ItemVisitor
public ItemVisitor()
-
-
Method Details
-
buildGlobal
Build the item structure corresponding to a schema global definition component. This sets the structure on the global component extension before filling in the details, so that circular references won't cause a problem.- Parameters:
comp-- Returns:
- constructed structure
-
buildStructure
Build the item structure corresponding to a particular schema component. The supplied component can be a nested type definition or a nested compositor. This method may be called recursively, so it needs to save and restore the entry state.- Parameters:
isenum- enumeration flagcomp- schema component (should be the simpleType component in the case of an enumeration)- Returns:
- constructed structure
-
addReference
Add a reference to a global definition to the structure.- Parameters:
comp- referencing schema componentref- referenced schema component
-
getSchemaType
Get the data type information for a built-in schema type.- Parameters:
def- schema type definition- Returns:
- type information
-
addTypeRefItem
Build an item from a type reference. For a predefined schema type this will be a simpleValueItemwrapped in aGroupItem; for a global type it will be a reference to a global definition.- Parameters:
comp-def-
-
visit
Visit <any> definition.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseto block further expansion
-
visit
Visit <attribute> definition.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseto block further expansion
-
visit
Visit <attributeGroup> reference.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseto block further expansion
-
visit
Visit compositor.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseto block further expansion
-
visit
Visit complex type <extension> definition. This adds a reference item for the base type, then continues expansion to handle the items added by extension.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
trueto continue expansion
-
visit
Visit complex type <restriction> definition. This adds a reference item for the base type, blocking further expansion.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseto end expansion
-
visit
Visit <element> definition.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseto block further expansion
-
visit
Visit <group> reference.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseto block further expansion
-
visit
Visit <list> element. This adds a collection value matching the type of list.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseto block further expansion
-
visit
Visit simple type <extension> element.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
trueto continue expansion
-
visit
Visit simple type <restriction> element.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
falseto block further expansion
-
visit
Visit <simpleType> element. This checks for the special case of a type definition which consists of an enumeration, and adds a group to represent the enumeration if found.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
trueto continue expansion, unless processed as group
-
visit
Visit <union> element. This directly builds a structure matching the component types of the union, with the nested types handled directly and the referenced types added separately.- Overrides:
visitin classSchemaVisitor- Parameters:
node-- Returns:
trueto expand any inline types
-