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.SchemaTreeCellRendereras a cell renderer for your tree.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSchemaTreeTraverser.SchemaRootNodeThe root node of the schema hierarchy tree.static classSchemaTreeTraverser.SchemaTreeCellRendererSample cell renderer for the schema tree.static classSchemaTreeTraverser.SchemaTreeModelTree model for schema hierarchy tree.static classSchemaTreeTraverser.SchemaTreeNodeThe node of the schema hierarchy tree.
-
Field Summary
Fields Modifier and Type Field Description private SchemaTreeTraverser.SchemaTreeNodecurrNodeThe current node in the tree.private SchemaTreeTraverser.SchemaTreeModelmodelThe associated tree model.
-
Constructor Summary
Constructors Constructor Description SchemaTreeTraverser()Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidannotation(XSAnnotation ann)voidattGroupDecl(XSAttGroupDecl decl)voidattributeDecl(XSAttributeDecl decl)voidattributeUse(XSAttributeUse use)voidcomplexType(XSComplexType type)private voiddump(XSAttributeDecl decl, java.lang.String additionalAtts)Creates node for attribute declaration with additional attributes.private voiddumpComplexTypeAttribute(XSComplexType type)Creates node for complex type.voiddumpRef(XSAttGroupDecl decl)Creates node of attribute group decalration reference.voidelementDecl(XSElementDecl decl)private voidelementDecl(XSElementDecl decl, java.lang.String extraAtts)Creates node for element declaration with additional attributes.voidempty(XSContentType t)voidfacet(XSFacet facet)SchemaTreeTraverser.SchemaTreeModelgetModel()Retrieves the tree model ofthistraverser.voididentityConstraint(XSIdentityConstraint ic)voidlistSimpleType(XSListSimpleType type)voidmodelGroup(XSModelGroup group)private voidmodelGroup(XSModelGroup group, java.lang.String extraAtts)Creates node for model group with additional attributes.voidmodelGroupDecl(XSModelGroupDecl decl)voidnotation(XSNotation notation)voidparticle(XSParticle part)voidrestrictionSimpleType(XSRestrictionSimpleType type)voidschema(XSSchema s)voidsimpleType(XSSimpleType type)voidunionSimpleType(XSUnionSimpleType type)voidvisit(XSSchemaSet s)Visits the root schema set.voidwildcard(XSWildcard wc)private voidwildcard(XSWildcard wc, java.lang.String extraAtts)Creates node for wild card with additional attributes.voidxpath(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 ofthistraverser.- Returns:
- Tree model of
thistraverser.
-
visit
public void visit(XSSchemaSet s)
Visits the root schema set.- Parameters:
s- Root schema set.
-
attGroupDecl
public void attGroupDecl(XSAttGroupDecl decl)
- Specified by:
attGroupDeclin 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:
attributeUsein interfaceXSVisitor
-
attributeDecl
public void attributeDecl(XSAttributeDecl decl)
- Specified by:
attributeDeclin 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:
simpleTypein interfaceXSContentTypeVisitor
-
listSimpleType
public void listSimpleType(XSListSimpleType type)
- Specified by:
listSimpleTypein interfaceXSSimpleTypeVisitor
-
unionSimpleType
public void unionSimpleType(XSUnionSimpleType type)
- Specified by:
unionSimpleTypein interfaceXSSimpleTypeVisitor
-
restrictionSimpleType
public void restrictionSimpleType(XSRestrictionSimpleType type)
- Specified by:
restrictionSimpleTypein interfaceXSSimpleTypeVisitor
-
notation
public void notation(XSNotation notation)
-
complexType
public void complexType(XSComplexType type)
- Specified by:
complexTypein interfaceXSVisitor
-
dumpComplexTypeAttribute
private void dumpComplexTypeAttribute(XSComplexType type)
Creates node for complex type.- Parameters:
type- Complex type.
-
elementDecl
public void elementDecl(XSElementDecl decl)
- Specified by:
elementDeclin 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:
modelGroupDeclin interfaceXSTermVisitor
-
modelGroup
public void modelGroup(XSModelGroup group)
- Specified by:
modelGroupin 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:
particlein interfaceXSContentTypeVisitor
-
wildcard
public void wildcard(XSWildcard wc)
- Specified by:
wildcardin 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:
annotationin interfaceXSVisitor
-
empty
public void empty(XSContentType t)
- Specified by:
emptyin interfaceXSContentTypeVisitor
-
identityConstraint
public void identityConstraint(XSIdentityConstraint ic)
- Specified by:
identityConstraintin interfaceXSVisitor
-
-