com.sun.xml.xsom.impl.util
Class SchemaTreeTraverser

java.lang.Object
  extended by com.sun.xml.xsom.impl.util.SchemaTreeTraverser
All Implemented Interfaces:
XSContentTypeVisitor, XSSimpleTypeVisitor, XSTermVisitor, XSVisitor

public class SchemaTreeTraverser
extends 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

  1. Create a new instance.
  2. Call visit(com.sun.xml.xsom.XSSchemaSet) function on your schema set.>/li>
  3. Retrieve the model using getModel().
Every node in the resulting tree is a SchemaTreeTraverser.SchemaTreeNode, and the model itself is SchemaTreeTraverser.SchemaTreeModel. You can use SchemaTreeTraverser.SchemaTreeCellRenderer as a cell renderer for your tree.

Author:
Kirill Grouchnikov (kirillcool@yahoo.com)

Nested Class Summary
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.
 
Constructor Summary
SchemaTreeTraverser()
          Simple constructor.
 
Method Summary
 void annotation(XSAnnotation ann)
           
 void attGroupDecl(XSAttGroupDecl decl)
           
 void attributeDecl(XSAttributeDecl decl)
           
 void attributeUse(XSAttributeUse use)
           
 void complexType(XSComplexType type)
           
 void dumpRef(XSAttGroupDecl decl)
          Creates node of attribute group decalration reference.
 void elementDecl(XSElementDecl decl)
           
 void empty(XSContentType t)
           
 void facet(XSFacet facet)
           
 SchemaTreeTraverser.SchemaTreeModel getModel()
          Retrieves the tree model of this traverser.
 void identityConstraint(XSIdentityConstraint ic)
           
 void listSimpleType(XSListSimpleType type)
           
 void modelGroup(XSModelGroup group)
           
 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)
           
 void xpath(XSXPath xp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaTreeTraverser

public SchemaTreeTraverser()
Simple constructor.

Method Detail

getModel

public SchemaTreeTraverser.SchemaTreeModel getModel()
Retrieves the tree model of this traverser.

Returns:
Tree model of this traverser.

visit

public void visit(XSSchemaSet s)
Visits the root schema set.

Parameters:
s - Root schema set.

schema

public void schema(XSSchema s)
Specified by:
schema in interface XSVisitor

attGroupDecl

public void attGroupDecl(XSAttGroupDecl decl)
Specified by:
attGroupDecl in interface XSVisitor

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 interface XSVisitor

attributeDecl

public void attributeDecl(XSAttributeDecl decl)
Specified by:
attributeDecl in interface XSVisitor

simpleType

public void simpleType(XSSimpleType type)
Specified by:
simpleType in interface XSContentTypeVisitor

listSimpleType

public void listSimpleType(XSListSimpleType type)
Specified by:
listSimpleType in interface XSSimpleTypeVisitor

unionSimpleType

public void unionSimpleType(XSUnionSimpleType type)
Specified by:
unionSimpleType in interface XSSimpleTypeVisitor

restrictionSimpleType

public void restrictionSimpleType(XSRestrictionSimpleType type)
Specified by:
restrictionSimpleType in interface XSSimpleTypeVisitor

facet

public void facet(XSFacet facet)
Specified by:
facet in interface XSVisitor

notation

public void notation(XSNotation notation)
Specified by:
notation in interface XSVisitor

complexType

public void complexType(XSComplexType type)
Specified by:
complexType in interface XSVisitor

elementDecl

public void elementDecl(XSElementDecl decl)
Specified by:
elementDecl in interface XSTermVisitor

modelGroupDecl

public void modelGroupDecl(XSModelGroupDecl decl)
Specified by:
modelGroupDecl in interface XSTermVisitor

modelGroup

public void modelGroup(XSModelGroup group)
Specified by:
modelGroup in interface XSTermVisitor

particle

public void particle(XSParticle part)
Specified by:
particle in interface XSContentTypeVisitor

wildcard

public void wildcard(XSWildcard wc)
Specified by:
wildcard in interface XSTermVisitor

annotation

public void annotation(XSAnnotation ann)
Specified by:
annotation in interface XSVisitor

empty

public void empty(XSContentType t)
Specified by:
empty in interface XSContentTypeVisitor

identityConstraint

public void identityConstraint(XSIdentityConstraint ic)
Specified by:
identityConstraint in interface XSVisitor

xpath

public void xpath(XSXPath xp)
Specified by:
xpath in interface XSVisitor


Copyright © 2012 Oracle. All Rights Reserved.