Class SchemaGrammar

    • Constructor Detail

      • SchemaGrammar

        protected SchemaGrammar()
      • SchemaGrammar

        public SchemaGrammar​(String targetNamespace,
                             XSDDescription grammarDesc,
                             SymbolTable symbolTable)
        Default constructor.
        Parameters:
        targetNamespace -
        grammarDesc - the XMLGrammarDescription corresponding to this objec at the least a systemId should always be known.
        symbolTable - needed for annotation support
    • Method Detail

      • isNamespaceAware

        public boolean isNamespaceAware()
      • setImportedGrammars

        public void setImportedGrammars​(Vector importedGrammars)
      • getImportedGrammars

        public Vector getImportedGrammars()
      • getTargetNamespace

        public final String getTargetNamespace()
        Returns this grammar's target namespace.
      • addGlobalAttributeDecl

        public void addGlobalAttributeDecl​(XSAttributeDecl decl)
        register one global attribute
      • addGlobalAttributeDecl

        public void addGlobalAttributeDecl​(XSAttributeDecl decl,
                                           String location)
      • addGlobalAttributeGroupDecl

        public void addGlobalAttributeGroupDecl​(XSAttributeGroupDecl decl)
        register one global attribute group
      • addGlobalElementDeclAll

        public void addGlobalElementDeclAll​(XSElementDecl decl)
        register one global element
      • addGlobalElementDecl

        public void addGlobalElementDecl​(XSElementDecl decl)
      • addGlobalElementDecl

        public void addGlobalElementDecl​(XSElementDecl decl,
                                         String location)
      • addGlobalGroupDecl

        public void addGlobalGroupDecl​(XSGroupDecl decl)
        register one global group
      • addGlobalGroupDecl

        public void addGlobalGroupDecl​(XSGroupDecl decl,
                                       String location)
      • addGlobalNotationDecl

        public void addGlobalNotationDecl​(XSNotationDecl decl)
        register one global notation
      • addGlobalNotationDecl

        public void addGlobalNotationDecl​(XSNotationDecl decl,
                                          String location)
      • addGlobalTypeDecl

        public void addGlobalTypeDecl​(XSTypeDefinition decl)
        register one global type
      • addGlobalComplexTypeDecl

        public void addGlobalComplexTypeDecl​(XSComplexTypeDecl decl)
        register one global complex type
      • addGlobalSimpleTypeDecl

        public void addGlobalSimpleTypeDecl​(XSSimpleType decl)
        register one global simple type
      • addGlobalSimpleTypeDecl

        public void addGlobalSimpleTypeDecl​(XSSimpleType decl,
                                            String location)
      • getGlobalAttributeDecl

        public final XSAttributeDecl getGlobalAttributeDecl​(String declName)
        get one global attribute
      • getGlobalAttributeGroupDecl

        public final XSAttributeGroupDecl getGlobalAttributeGroupDecl​(String declName)
        get one global attribute group
      • getGlobalElementDecl

        public final XSElementDecl getGlobalElementDecl​(String declName)
        get one global element
      • getGlobalGroupDecl

        public final XSGroupDecl getGlobalGroupDecl​(String declName)
        get one global group
      • getGlobalNotationDecl

        public final XSNotationDecl getGlobalNotationDecl​(String declName)
        get one global notation
      • getGlobalTypeDecl

        public final XSTypeDefinition getGlobalTypeDecl​(String declName)
        get one global type
      • getIDConstraintDecl

        public final IdentityConstraint getIDConstraintDecl​(String declName)
        get one identity constraint
      • hasIDConstraints

        public final boolean hasIDConstraints()
        get one identity constraint
      • addComplexTypeDecl

        public void addComplexTypeDecl​(XSComplexTypeDecl decl,
                                       SimpleLocator locator)
        add one complex type decl: for later constraint checking
      • addRedefinedGroupDecl

        public void addRedefinedGroupDecl​(XSGroupDecl derived,
                                          XSGroupDecl base,
                                          SimpleLocator locator)
        add a group redefined by restriction: for later constraint checking
      • getS4SGrammar

        public static SchemaGrammar getS4SGrammar​(short schemaVersion)
      • addDocument

        public void addDocument​(Object document,
                                String location)
      • removeDocument

        public void removeDocument​(int index)
      • getComponents

        public XSNamedMap getComponents​(short objectType)
        [schema components]: a list of top-level components, i.e. element declarations, attribute declarations, etc.
        Specified by:
        getComponents in interface XSNamespaceItem
        Parameters:
        objectType - The type of the declaration, i.e. ELEMENT_DECLARATION. Note that XSTypeDefinition.SIMPLE_TYPE and XSTypeDefinition.COMPLEX_TYPE can also be used as the objectType to retrieve only complex types or simple types, instead of all types.
        Returns:
        A list of top-level definition of the specified type in objectType or an empty XSNamedMap if no such definitions exist.
      • getComponentsExt

        public ObjectList getComponentsExt​(short objectType)
      • resetComponents

        public void resetComponents()
      • getTypeDefinition

        public XSTypeDefinition getTypeDefinition​(String name)
        Convenience method. Returns a top-level simple or complex type definition.
        Specified by:
        getTypeDefinition in interface XSNamespaceItem
        Parameters:
        name - The name of the definition.
        Returns:
        An XSTypeDefinition or null if such definition does not exist.
      • getAttributeDeclaration

        public XSAttributeDeclaration getAttributeDeclaration​(String name)
        Convenience method. Returns a top-level attribute declaration.
        Specified by:
        getAttributeDeclaration in interface XSNamespaceItem
        Parameters:
        name - The name of the declaration.
        Returns:
        A top-level attribute declaration or null if such declaration does not exist.
      • getElementDeclaration

        public XSElementDeclaration getElementDeclaration​(String name)
        Convenience method. Returns a top-level element declaration.
        Specified by:
        getElementDeclaration in interface XSNamespaceItem
        Parameters:
        name - The name of the declaration.
        Returns:
        A top-level element declaration or null if such declaration does not exist.
      • getAttributeGroup

        public XSAttributeGroupDefinition getAttributeGroup​(String name)
        Convenience method. Returns a top-level attribute group definition.
        Specified by:
        getAttributeGroup in interface XSNamespaceItem
        Parameters:
        name - The name of the definition.
        Returns:
        A top-level attribute group definition or null if such definition does not exist.
      • getModelGroupDefinition

        public XSModelGroupDefinition getModelGroupDefinition​(String name)
        Convenience method. Returns a top-level model group definition.
        Specified by:
        getModelGroupDefinition in interface XSNamespaceItem
        Parameters:
        name - The name of the definition.
        Returns:
        A top-level model group definition definition or null if such definition does not exist.
      • getNotationDeclaration

        public XSNotationDeclaration getNotationDeclaration​(String name)
        Convenience method. Returns a top-level notation declaration.
        Specified by:
        getNotationDeclaration in interface XSNamespaceItem
        Parameters:
        name - The name of the declaration.
        Returns:
        A top-level notation declaration or null if such declaration does not exist.
      • getIDCDefinition

        public XSIDCDefinition getIDCDefinition​(String name)
        Description copied from interface: XSNamespaceItem
        Convenience method. Returns an identity-constraint definition.
        Specified by:
        getIDCDefinition in interface XSNamespaceItem
        Parameters:
        name - The name of the definition.
        Returns:
        An identity-constraint definition or null if such a declaration does not exist.
      • toXSModel

        public XSModel toXSModel()
        Return an XSModel that represents components in this schema grammar.
        Specified by:
        toXSModel in interface XSGrammar
        Returns:
        an XSModel representing this schema grammar
      • toXSModel

        public XSModel toXSModel​(XSGrammar[] grammars)
        Description copied from interface: XSGrammar
        Return an XSModel that represents components in this schema grammar and the grammars in the grammarsparameter, any schema grammars that are imported by them directly or indirectly.
        Specified by:
        toXSModel in interface XSGrammar
        Returns:
        an XSModel representing these schema grammars
      • setImmutable

        public void setImmutable​(boolean isImmutable)
      • isImmutable

        public boolean isImmutable()