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 classThe root node of the schema hierarchy tree.static classSample cell renderer for the schema tree.static final classTree model for schema hierarchy tree.static classThe 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 TypeMethodDescriptionvoidannotation(XSAnnotation ann) voidattGroupDecl(XSAttGroupDecl decl) voidattributeDecl(XSAttributeDecl decl) voidvoidcomplexType(XSComplexType type) private voiddump(XSAttributeDecl decl, String additionalAtts) Creates node for attribute declaration with additional attributes.private voidCreates node for complex type.voiddumpRef(XSAttGroupDecl decl) Creates node of attribute group decalration reference.voidelementDecl(XSElementDecl decl) private voidelementDecl(XSElementDecl decl, String extraAtts) Creates node for element declaration with additional attributes.voidvoidgetModel()Retrieves the tree model ofthistraverser.voidvoidvoidmodelGroup(XSModelGroup group) private voidmodelGroup(XSModelGroup group, String extraAtts) Creates node for model group with additional attributes.voidvoidnotation(XSNotation notation) voidparticle(XSParticle part) voidvoidvoidsimpleType(XSSimpleType type) voidvoidvisit(XSSchemaSet s) Visits the root schema set.voidwildcard(XSWildcard wc) private voidwildcard(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 ofthistraverser.- Returns:
- Tree model of
thistraverser.
-
visit
Visits the root schema set.- Parameters:
s- Root schema set.
-
schema
-
attGroupDecl
- Specified by:
attGroupDeclin interfaceXSVisitor
-
dumpRef
Creates node of attribute group decalration reference.- Parameters:
decl- Attribute group decalration reference.
-
attributeUse
- Specified by:
attributeUsein interfaceXSVisitor
-
attributeDecl
- Specified by:
attributeDeclin interfaceXSVisitor
-
dump
Creates node for attribute declaration with additional attributes.- Parameters:
decl- Attribute declaration.additionalAtts- Additional attributes.
-
simpleType
- Specified by:
simpleTypein interfaceXSContentTypeVisitor
-
listSimpleType
- Specified by:
listSimpleTypein interfaceXSSimpleTypeVisitor
-
unionSimpleType
- Specified by:
unionSimpleTypein interfaceXSSimpleTypeVisitor
-
restrictionSimpleType
- Specified by:
restrictionSimpleTypein interfaceXSSimpleTypeVisitor
-
facet
-
notation
-
complexType
- Specified by:
complexTypein interfaceXSVisitor
-
dumpComplexTypeAttribute
Creates node for complex type.- Parameters:
type- Complex type.
-
elementDecl
- Specified by:
elementDeclin interfaceXSTermVisitor
-
elementDecl
Creates node for element declaration with additional attributes.- Parameters:
decl- Element declaration.extraAtts- Additional attributes.
-
modelGroupDecl
- Specified by:
modelGroupDeclin interfaceXSTermVisitor
-
modelGroup
- Specified by:
modelGroupin interfaceXSTermVisitor
-
modelGroup
Creates node for model group with additional attributes.- Parameters:
group- Model group.extraAtts- Additional attributes.
-
particle
- Specified by:
particlein interfaceXSContentTypeVisitor
-
wildcard
- Specified by:
wildcardin interfaceXSTermVisitor
-
wildcard
Creates node for wild card with additional attributes.- Parameters:
wc- Wild card.extraAtts- Additional attributes.
-
annotation
- Specified by:
annotationin interfaceXSVisitor
-
empty
- Specified by:
emptyin interfaceXSContentTypeVisitor
-
identityConstraint
- Specified by:
identityConstraintin interfaceXSVisitor
-
xpath
-