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
public class SchemaTreeTraverser extends java.lang.Object implements XSVisitor, XSSimpleTypeVisitor
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 isSchemaTreeTraverser.SchemaTreeModel
. You can useSchemaTreeTraverser.SchemaTreeCellRenderer
as a cell renderer for your tree.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SchemaTreeTraverser.SchemaRootNode
The root node of the schema hierarchy tree.static class
SchemaTreeTraverser.SchemaTreeCellRenderer
Sample cell renderer for the schema tree.static class
SchemaTreeTraverser.SchemaTreeModel
Tree model for schema hierarchy tree.static class
SchemaTreeTraverser.SchemaTreeNode
The node of the schema hierarchy tree.
-
Field Summary
Fields Modifier and Type Field Description private SchemaTreeTraverser.SchemaTreeNode
currNode
The current node in the tree.private SchemaTreeTraverser.SchemaTreeModel
model
The associated tree model.
-
Constructor Summary
Constructors Constructor Description SchemaTreeTraverser()
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
annotation(XSAnnotation ann)
void
attGroupDecl(XSAttGroupDecl decl)
void
attributeDecl(XSAttributeDecl decl)
void
attributeUse(XSAttributeUse use)
void
complexType(XSComplexType type)
private void
dump(XSAttributeDecl decl, java.lang.String additionalAtts)
Creates node for attribute declaration with additional attributes.private void
dumpComplexTypeAttribute(XSComplexType type)
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, java.lang.String extraAtts)
Creates node for element declaration with additional attributes.void
empty(XSContentType t)
void
facet(XSFacet facet)
SchemaTreeTraverser.SchemaTreeModel
getModel()
Retrieves the tree model ofthis
traverser.void
identityConstraint(XSIdentityConstraint ic)
void
listSimpleType(XSListSimpleType type)
void
modelGroup(XSModelGroup group)
private void
modelGroup(XSModelGroup group, java.lang.String extraAtts)
Creates node for model group with additional attributes.void
modelGroupDecl(XSModelGroupDecl decl)
void
notation(XSNotation notation)
void
particle(XSParticle part)
void
restrictionSimpleType(XSRestrictionSimpleType type)
void
schema(XSSchema s)
void
simpleType(XSSimpleType type)
void
unionSimpleType(XSUnionSimpleType type)
void
visit(XSSchemaSet s)
Visits the root schema set.void
wildcard(XSWildcard wc)
private void
wildcard(XSWildcard wc, java.lang.String extraAtts)
Creates node for wild card with additional attributes.void
xpath(XSXPath xp)
-
-
-
Field Detail
-
model
private SchemaTreeTraverser.SchemaTreeModel model
The associated tree model.
-
currNode
private SchemaTreeTraverser.SchemaTreeNode currNode
The current node in the tree.
-
-
Method Detail
-
getModel
public SchemaTreeTraverser.SchemaTreeModel getModel()
Retrieves the tree model ofthis
traverser.- Returns:
- Tree model of
this
traverser.
-
visit
public void visit(XSSchemaSet s)
Visits the root schema set.- Parameters:
s
- Root schema set.
-
attGroupDecl
public void attGroupDecl(XSAttGroupDecl decl)
- Specified by:
attGroupDecl
in interfaceXSVisitor
-
dumpRef
public void dumpRef(XSAttGroupDecl decl)
Creates node of attribute group decalration reference.- Parameters:
decl
- Attribute group decalration reference.
-
attributeUse
public void attributeUse(XSAttributeUse use)
- Specified by:
attributeUse
in interfaceXSVisitor
-
attributeDecl
public void attributeDecl(XSAttributeDecl decl)
- Specified by:
attributeDecl
in interfaceXSVisitor
-
dump
private void dump(XSAttributeDecl decl, java.lang.String additionalAtts)
Creates node for attribute declaration with additional attributes.- Parameters:
decl
- Attribute declaration.additionalAtts
- Additional attributes.
-
simpleType
public void simpleType(XSSimpleType type)
- Specified by:
simpleType
in interfaceXSContentTypeVisitor
-
listSimpleType
public void listSimpleType(XSListSimpleType type)
- Specified by:
listSimpleType
in interfaceXSSimpleTypeVisitor
-
unionSimpleType
public void unionSimpleType(XSUnionSimpleType type)
- Specified by:
unionSimpleType
in interfaceXSSimpleTypeVisitor
-
restrictionSimpleType
public void restrictionSimpleType(XSRestrictionSimpleType type)
- Specified by:
restrictionSimpleType
in interfaceXSSimpleTypeVisitor
-
notation
public void notation(XSNotation notation)
-
complexType
public void complexType(XSComplexType type)
- Specified by:
complexType
in interfaceXSVisitor
-
dumpComplexTypeAttribute
private void dumpComplexTypeAttribute(XSComplexType type)
Creates node for complex type.- Parameters:
type
- Complex type.
-
elementDecl
public void elementDecl(XSElementDecl decl)
- Specified by:
elementDecl
in interfaceXSTermVisitor
-
elementDecl
private void elementDecl(XSElementDecl decl, java.lang.String extraAtts)
Creates node for element declaration with additional attributes.- Parameters:
decl
- Element declaration.extraAtts
- Additional attributes.
-
modelGroupDecl
public void modelGroupDecl(XSModelGroupDecl decl)
- Specified by:
modelGroupDecl
in interfaceXSTermVisitor
-
modelGroup
public void modelGroup(XSModelGroup group)
- Specified by:
modelGroup
in interfaceXSTermVisitor
-
modelGroup
private void modelGroup(XSModelGroup group, java.lang.String extraAtts)
Creates node for model group with additional attributes.- Parameters:
group
- Model group.extraAtts
- Additional attributes.
-
particle
public void particle(XSParticle part)
- Specified by:
particle
in interfaceXSContentTypeVisitor
-
wildcard
public void wildcard(XSWildcard wc)
- Specified by:
wildcard
in interfaceXSTermVisitor
-
wildcard
private void wildcard(XSWildcard wc, java.lang.String extraAtts)
Creates node for wild card with additional attributes.- Parameters:
wc
- Wild card.extraAtts
- Additional attributes.
-
annotation
public void annotation(XSAnnotation ann)
- Specified by:
annotation
in interfaceXSVisitor
-
empty
public void empty(XSContentType t)
- Specified by:
empty
in interfaceXSContentTypeVisitor
-
identityConstraint
public void identityConstraint(XSIdentityConstraint ic)
- Specified by:
identityConstraint
in interfaceXSVisitor
-
-