org.modeshape.sequencer.xsd

## Class XsdReader

- java.lang.Object
- - org.modeshape.sequencer.sramp.AbstractResolvingReader
  - - org.modeshape.sequencer.xsd.XsdReader

-     @NotThreadSafe
      public class XsdReader
      extends AbstractResolvingReader

  A class that can parse XML Schema Documents and create a node structure based on the schema information.

  This class can be subclassed and any of the 'process' methods overridden to customize the derived graph structure.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static SymbolSpace` | `ATTRIBUTE_DECLARATIONS` In XML Schema, there is a distinct symbol space within each target namespace for each kind of declaration and definition component, except that within a target namespace the simple type definitions and complex type definitions share a single symbol space.
    `static SymbolSpace` | `ATTRIBUTE_GROUP_DEFINITIONS`
    `static SymbolSpace` | `ELEMENT_DECLARATION`
    `static SymbolSpace` | `IDENTITY_CONSTRAINT_DEFINITIONS`
    `static SymbolSpace` | `MODEL_GROUP_DEFINITIONS`
    `static SymbolSpace` | `TYPE_DEFINITIONS`

    - ### Fields inherited from class org.modeshape.sequencer.sramp.AbstractResolvingReader

      `context, logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XsdReader(Sequencer.Context context)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `process(org.eclipse.xsd.XSDSchema schema, String encoding, long contentSize, Node rootNode)` Read an XSDSchema instance and create the node hierarchy under the given root node.
    `protected void` | `processAnnotation(org.eclipse.xsd.XSDAnnotation annotation, Node node)`
    `protected void` | `processAnnotations(List<org.eclipse.xsd.XSDAnnotation> annotations, Node parentNode)`
    `protected Node` | `processAttributeDeclaration(org.eclipse.xsd.XSDAttributeDeclaration decl, Node parentNode, boolean isUse)`
    `protected void` | `processAttributeGroupContent(org.eclipse.xsd.XSDAttributeGroupContent content, Node parentNode)`
    `protected void` | `processAttributeGroupDefinition(org.eclipse.xsd.XSDAttributeGroupDefinition defn, Node parentNode)`
    `protected void` | `processAttributeUse(org.eclipse.xsd.XSDAttributeUse use, Node parentNode)`
    `protected void` | `processComplexTypeContent(org.eclipse.xsd.XSDComplexTypeContent content, Node parentNode)`
    `protected void` | `processComplexTypeDefinition(org.eclipse.xsd.XSDComplexTypeDefinition type, Node parentNode)`
    `protected Node` | `processElementDeclaration(org.eclipse.xsd.XSDElementDeclaration decl, Node parentNode)`
    `protected <Enumerator extends org.eclipse.emf.common.util.AbstractEnumerator> void` | `processEnumerator(Enumerator enumerator, Node node, String propertyName)`
    `protected <Enumerator extends org.eclipse.emf.common.util.AbstractEnumerator> void` | `processEnumerators(List<Enumerator> enumerators, Node node, String propertyName)`
    `protected void` | `processFacet(org.eclipse.xsd.XSDFacet facet, Node node, String propertyName, int propertyType)`
    `protected <Facet extends org.eclipse.xsd.XSDFacet> void` | `processFacetsList(List<Facet> facets, Node node, String propertyName)`
    `protected void` | `processImport(org.eclipse.xsd.XSDImport xsdImport, Node parentNode)`
    `protected void` | `processInclude(org.eclipse.xsd.XSDInclude xsdInclude, Node parentNode)`
    `protected Node` | `processModelGroup(org.eclipse.xsd.XSDModelGroup group, Node parentNode)`
    `protected Node` | `processModelGroupDefinition(org.eclipse.xsd.XSDModelGroupDefinition defn, Node parentNode)`
    `protected void` | `processNonSchemaAttributes(org.eclipse.xsd.XSDConcreteComponent component, Node node, Set<String> excludeAttributes)`
    `protected void` | `processParticle(org.eclipse.xsd.XSDParticle content, Node node)`
    `protected void` | `processRedefine(org.eclipse.xsd.XSDRedefine redefine, Node parentNode)`
    `protected void` | `processSimpleTypeDefinition(org.eclipse.xsd.XSDSimpleTypeDefinition type, Node node)`
    `protected void` | `processTypeFacets(org.eclipse.xsd.XSDSimpleTypeDefinition type, Node typeNode, org.eclipse.xsd.XSDTypeDefinition baseType)`
    `protected Node` | `processWildcard(org.eclipse.xsd.XSDWildcard wildcard, Node parentNode)`
    `void` | `read(InputSource source, Node outputNode)` Read the document from the supplied stream, and produce the derived content.
    `protected static Set<String>` | `removePrefix(String... attributeNames)`

    - ### Methods inherited from class org.modeshape.sequencer.sramp.AbstractResolvingReader

      `getContext, getResolvers, read, registerForSymbolSpace, registerNamespace, resolveReferences, setReference`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ATTRIBUTE_DECLARATIONS

          public static final SymbolSpace ATTRIBUTE_DECLARATIONS

      In XML Schema, there is a distinct symbol space within each target namespace for each kind of declaration and definition component, except that within a target namespace the simple type definitions and complex type definitions share a single symbol space. See the specification for details.

    - #### ELEMENT_DECLARATION

          public static final SymbolSpace ELEMENT_DECLARATION

    - #### TYPE_DEFINITIONS

          public static final SymbolSpace TYPE_DEFINITIONS

    - #### ATTRIBUTE_GROUP_DEFINITIONS

          public static final SymbolSpace ATTRIBUTE_GROUP_DEFINITIONS

    - #### MODEL_GROUP_DEFINITIONS

          public static final SymbolSpace MODEL_GROUP_DEFINITIONS

    - #### IDENTITY_CONSTRAINT_DEFINITIONS

          public static final SymbolSpace IDENTITY_CONSTRAINT_DEFINITIONS

  - ### Constructor Detail

    - #### XsdReader

          public XsdReader(Sequencer.Context context)

  - ### Method Detail

    - #### read

          public void read(InputSource source,
                  Node outputNode)
                    throws Exception

      Description copied from class: `AbstractResolvingReader`
      Read the document from the supplied stream, and produce the derived content.
      Specified by:
        `read` in class `AbstractResolvingReader`
      Parameters:
        `source` - the input source of the document; may not be null
        `outputNode` - the parent node at which the derived content should be written; may not be null
      Throws:
        `Exception` - if there is a problem reading the XSD content

    - #### process

          protected void process(org.eclipse.xsd.XSDSchema schema,
                     String encoding,
                     long contentSize,
                     Node rootNode)
                          throws Exception

      Read an XSDSchema instance and create the node hierarchy under the given root node.
      Parameters:
        `schema` - the schema object; may not be null
        `encoding` - the encoding for the XSD; may be null if the encoding is not specified
        `contentSize` - the size of the XML Schema Document content; may not be negative
        `rootNode` - the root node that will be populated with the XML Schema Document information
      Throws:
        `Exception` - if there is a probelm reading the XSD content

    - #### processImport

          protected void processImport(org.eclipse.xsd.XSDImport xsdImport,
                           Node parentNode)
                                throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processInclude

          protected void processInclude(org.eclipse.xsd.XSDInclude xsdInclude,
                            Node parentNode)
                                 throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processRedefine

          protected void processRedefine(org.eclipse.xsd.XSDRedefine redefine,
                             Node parentNode)
                                  throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processSimpleTypeDefinition

          protected void processSimpleTypeDefinition(org.eclipse.xsd.XSDSimpleTypeDefinition type,
                                         Node node)
                                              throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processTypeFacets

          protected void processTypeFacets(org.eclipse.xsd.XSDSimpleTypeDefinition type,
                               Node typeNode,
                               org.eclipse.xsd.XSDTypeDefinition baseType)
                                    throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processComplexTypeDefinition

          protected void processComplexTypeDefinition(org.eclipse.xsd.XSDComplexTypeDefinition type,
                                          Node parentNode)
                                               throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processElementDeclaration

          protected Node processElementDeclaration(org.eclipse.xsd.XSDElementDeclaration decl,
                                       Node parentNode)
                                            throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processAttributeDeclaration

          protected Node processAttributeDeclaration(org.eclipse.xsd.XSDAttributeDeclaration decl,
                                         Node parentNode,
                                         boolean isUse)
                                              throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processComplexTypeContent

          protected void processComplexTypeContent(org.eclipse.xsd.XSDComplexTypeContent content,
                                       Node parentNode)
                                            throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processParticle

          protected void processParticle(org.eclipse.xsd.XSDParticle content,
                             Node node)
                                  throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processModelGroupDefinition

          protected Node processModelGroupDefinition(org.eclipse.xsd.XSDModelGroupDefinition defn,
                                         Node parentNode)
                                              throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processModelGroup

          protected Node processModelGroup(org.eclipse.xsd.XSDModelGroup group,
                               Node parentNode)
                                    throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processAttributeGroupContent

          protected void processAttributeGroupContent(org.eclipse.xsd.XSDAttributeGroupContent content,
                                          Node parentNode)
                                               throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processAttributeGroupDefinition

          protected void processAttributeGroupDefinition(org.eclipse.xsd.XSDAttributeGroupDefinition defn,
                                             Node parentNode)
                                                  throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processWildcard

          protected Node processWildcard(org.eclipse.xsd.XSDWildcard wildcard,
                             Node parentNode)
                                  throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processAttributeUse

          protected void processAttributeUse(org.eclipse.xsd.XSDAttributeUse use,
                                 Node parentNode)
                                      throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processNonSchemaAttributes

          protected void processNonSchemaAttributes(org.eclipse.xsd.XSDConcreteComponent component,
                                        Node node,
                                        Set<String> excludeAttributes)
                                             throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processAnnotation

          protected void processAnnotation(org.eclipse.xsd.XSDAnnotation annotation,
                               Node node)
                                    throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processAnnotations

          protected void processAnnotations(List<org.eclipse.xsd.XSDAnnotation> annotations,
                                Node parentNode)
                                     throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processFacet

          protected void processFacet(org.eclipse.xsd.XSDFacet facet,
                          Node node,
                          String propertyName,
                          int propertyType)
                               throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processFacetsList

          protected <Facet extends org.eclipse.xsd.XSDFacet> void processFacetsList(List<Facet> facets,
                                                                        Node node,
                                                                        String propertyName)
                                    throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processEnumerators

          protected <Enumerator extends org.eclipse.emf.common.util.AbstractEnumerator> void processEnumerators(List<Enumerator> enumerators,
                                                                                                    Node node,
                                                                                                    String propertyName)
                                     throws RepositoryException

      Throws:
        `RepositoryException`

    - #### processEnumerator

          protected <Enumerator extends org.eclipse.emf.common.util.AbstractEnumerator> void processEnumerator(Enumerator enumerator,
                                                                                                   Node node,
                                                                                                   String propertyName)
                                    throws RepositoryException

      Throws:
        `RepositoryException`

    - #### removePrefix

          protected static Set<String> removePrefix(String... attributeNames)

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.