Package com.sun.xml.xsom.impl.util
Class SchemaTreeTraverser
java.lang.Object
com.sun.xml.xsom.impl.util.SchemaTreeTraverser
- All Implemented Interfaces:
XSContentTypeVisitor
,XSSimpleTypeVisitor
,XSTermVisitor
,XSVisitor
Generates approximated tree model for XML from a schema component. This is
not intended to be a fully-fledged round-trippable tree model.
Usage of this class
- Create a new instance.
- Call
visit(com.sun.xml.xsom.XSSchemaSet)
function on your schema set.>/li> - Retrieve the model using
getModel()
.
SchemaTreeTraverser.SchemaTreeNode
,
and the model itself is SchemaTreeTraverser.SchemaTreeModel
. You can
use SchemaTreeTraverser.SchemaTreeCellRenderer
as a cell renderer for
your tree.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The root node of the schema hierarchy tree.static class
Sample cell renderer for the schema tree.static final class
Tree model for schema hierarchy tree.static class
The node of the schema hierarchy tree. -
Field Summary
FieldsModifier and TypeFieldDescriptionThe current node in the tree.The associated tree model. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
annotation
(XSAnnotation ann) void
attGroupDecl
(XSAttGroupDecl decl) void
attributeDecl
(XSAttributeDecl decl) void
void
complexType
(XSComplexType type) private void
dump
(XSAttributeDecl decl, String additionalAtts) Creates node for attribute declaration with additional attributes.private void
Creates node for complex type.void
dumpRef
(XSAttGroupDecl decl) Creates node of attribute group decalration reference.void
elementDecl
(XSElementDecl decl) private void
elementDecl
(XSElementDecl decl, String extraAtts) Creates node for element declaration with additional attributes.void
void
getModel()
Retrieves the tree model ofthis
traverser.void
void
void
modelGroup
(XSModelGroup group) private void
modelGroup
(XSModelGroup group, String extraAtts) Creates node for model group with additional attributes.void
void
notation
(XSNotation notation) void
particle
(XSParticle part) void
void
void
simpleType
(XSSimpleType type) void
void
visit
(XSSchemaSet s) Visits the root schema set.void
wildcard
(XSWildcard wc) private void
wildcard
(XSWildcard wc, String extraAtts) Creates node for wild card with additional attributes.void
-
Field Details
-
model
The associated tree model. -
currNode
The current node in the tree.
-
-
Constructor Details
-
SchemaTreeTraverser
public SchemaTreeTraverser()Simple constructor.
-
-
Method Details
-
getModel
Retrieves the tree model ofthis
traverser.- Returns:
- Tree model of
this
traverser.
-
visit
Visits the root schema set.- Parameters:
s
- Root schema set.
-
schema
-
attGroupDecl
- Specified by:
attGroupDecl
in interfaceXSVisitor
-
dumpRef
Creates node of attribute group decalration reference.- Parameters:
decl
- Attribute group decalration reference.
-
attributeUse
- Specified by:
attributeUse
in interfaceXSVisitor
-
attributeDecl
- Specified by:
attributeDecl
in interfaceXSVisitor
-
dump
Creates node for attribute declaration with additional attributes.- Parameters:
decl
- Attribute declaration.additionalAtts
- Additional attributes.
-
simpleType
- Specified by:
simpleType
in interfaceXSContentTypeVisitor
-
listSimpleType
- Specified by:
listSimpleType
in interfaceXSSimpleTypeVisitor
-
unionSimpleType
- Specified by:
unionSimpleType
in interfaceXSSimpleTypeVisitor
-
restrictionSimpleType
- Specified by:
restrictionSimpleType
in interfaceXSSimpleTypeVisitor
-
facet
-
notation
-
complexType
- Specified by:
complexType
in interfaceXSVisitor
-
dumpComplexTypeAttribute
Creates node for complex type.- Parameters:
type
- Complex type.
-
elementDecl
- Specified by:
elementDecl
in interfaceXSTermVisitor
-
elementDecl
Creates node for element declaration with additional attributes.- Parameters:
decl
- Element declaration.extraAtts
- Additional attributes.
-
modelGroupDecl
- Specified by:
modelGroupDecl
in interfaceXSTermVisitor
-
modelGroup
- Specified by:
modelGroup
in interfaceXSTermVisitor
-
modelGroup
Creates node for model group with additional attributes.- Parameters:
group
- Model group.extraAtts
- Additional attributes.
-
particle
- Specified by:
particle
in interfaceXSContentTypeVisitor
-
wildcard
- Specified by:
wildcard
in interfaceXSTermVisitor
-
wildcard
Creates node for wild card with additional attributes.- Parameters:
wc
- Wild card.extraAtts
- Additional attributes.
-
annotation
- Specified by:
annotation
in interfaceXSVisitor
-
empty
- Specified by:
empty
in interfaceXSContentTypeVisitor
-
identityConstraint
- Specified by:
identityConstraint
in interfaceXSVisitor
-
xpath
-