org.apache.xerces.impl.xs.traversers

## Class XSAttributeChecker

- java.lang.Object
- - org.apache.xerces.impl.xs.traversers.XSAttributeChecker

-     public class XSAttributeChecker
      extends java.lang.Object

  Class `XSAttributeCheck` is used to check the validity of attributes appearing in the schema document. It - reports an error for invalid element (invalid namespace, invalid name) - reports an error for invalid attribute (invalid namespace, invalid name) - reports an error for invalid attribute value - return compiled values for attribute values - provide default value for missing optional attributes - provide default value for incorrect attribute values But it's the caller's responsibility to check whether a required attribute is present. Things need revisiting: - Whether to return non-schema attributes/values - Do we need to update NamespaceScope and ErrorReporter when reset()? - Should have the datatype validators return compiled value - use symbol table instead of many hashtables
  Version:
    $Id: XSAttributeChecker.java 1381986 2012-09-07 12:03:52Z mukulg $
  Author:
    Sandy Gao, IBM

  # INTERNAL:

    Usage of this class is not supported. It may be altered or removed at any time.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ATTIDX_ABSTRACT`
    `static int` | `ATTIDX_AFORMDEFAULT`
    `static int` | `ATTIDX_APPLIESTOEMPTY`
    `static int` | `ATTIDX_BASE`
    `static int` | `ATTIDX_BLOCK`
    `static int` | `ATTIDX_BLOCKDEFAULT`
    `static int` | `ATTIDX_DEFAULT`
    `static int` | `ATTIDX_DEFAULTATTRAPPLY`
    `static int` | `ATTIDX_DEFAULTATTRIBUTES`
    `static int` | `ATTIDX_EFORMDEFAULT`
    `static int` | `ATTIDX_ENUMNSDECLS`
    `static int` | `ATTIDX_FINAL`
    `static int` | `ATTIDX_FINALDEFAULT`
    `static int` | `ATTIDX_FIXED`
    `static int` | `ATTIDX_FORM`
    `static int` | `ATTIDX_FROMDEFAULT`
    `static int` | `ATTIDX_ID`
    `static int` | `ATTIDX_INHERITABLE`
    `static int` | `ATTIDX_ISRETURNED`
    `static int` | `ATTIDX_ITEMTYPE`
    `static int` | `ATTIDX_MAXOCCURS`
    `static int` | `ATTIDX_MEMBERTYPES`
    `static int` | `ATTIDX_MINOCCURS`
    `static int` | `ATTIDX_MIXED`
    `static int` | `ATTIDX_MODE`
    `static int` | `ATTIDX_NAME`
    `static int` | `ATTIDX_NAMESPACE`
    `static int` | `ATTIDX_NAMESPACE_LIST`
    `static int` | `ATTIDX_NILLABLE`
    `static int` | `ATTIDX_NONSCHEMA`
    `static int` | `ATTIDX_NOTNAMESPACE`
    `static int` | `ATTIDX_NOTQNAME`
    `static int` | `ATTIDX_PROCESSCONTENTS`
    `static int` | `ATTIDX_PUBLIC`
    `static int` | `ATTIDX_REF`
    `static int` | `ATTIDX_REFER`
    `static int` | `ATTIDX_SCHEMALOCATION`
    `static int` | `ATTIDX_SOURCE`
    `static int` | `ATTIDX_SUBSGROUP`
    `static int` | `ATTIDX_SYSTEM`
    `static int` | `ATTIDX_TARGETNAMESPACE`
    `static int` | `ATTIDX_TYPE`
    `static int` | `ATTIDX_USE`
    `static int` | `ATTIDX_VALUE`
    `static int` | `ATTIDX_VERSION`
    `static int` | `ATTIDX_XML_LANG`
    `static int` | `ATTIDX_XPATH`
    `static int` | `ATTIDX_XPATHDEFAULTNS`
    `static int` | `ATTIDX_XPATHDEFAULTNS_TWOPOUNDDFLT`
    `protected static int` | `DT_ANYURI`
    `protected static int` | `DT_BLOCK`
    `protected static int` | `DT_BLOCK1`
    `protected static int` | `DT_BOOLEAN`
    `protected static int` | `DT_COUNT`
    `protected static int` | `DT_EXPLICITTIMEZONE`
    `protected static int` | `DT_FINAL`
    `protected static int` | `DT_FINAL1`
    `protected static int` | `DT_FINAL2`
    `protected static int` | `DT_FORM`
    `protected static int` | `DT_ID`
    `protected static int` | `DT_INT`
    `protected static int` | `DT_LANGUAGE`
    `protected static int` | `DT_MAXOCCURS`
    `protected static int` | `DT_MAXOCCURS1`
    `protected static int` | `DT_MEMBERTYPES`
    `protected static int` | `DT_MINOCCURS1`
    `protected static int` | `DT_MODE`
    `protected static int` | `DT_MODE1`
    `protected static int` | `DT_NAMESPACE`
    `protected static int` | `DT_NCNAME`
    `protected static int` | `DT_NONNEGINT`
    `protected static int` | `DT_NOTNAMESPACE`
    `protected static int` | `DT_NOTQNAME`
    `protected static int` | `DT_POSINT`
    `protected static int` | `DT_PROCESSCONTENTS`
    `protected static int` | `DT_QNAME`
    `protected static int` | `DT_STRING`
    `protected static int` | `DT_TOKEN`
    `protected static int` | `DT_USE`
    `protected static int` | `DT_WHITESPACE`
    `protected static int` | `DT_XPATH`
    `protected static int` | `DT_XPATH_DEFAULT_NS`
    `protected static int` | `DT_XPATH1`
    `protected java.util.Vector` | `fNamespaceList`
    `protected java.util.Hashtable` | `fNonSchemaAttrs`
    `protected XSDHandler` | `fSchemaHandler`
    `protected boolean[]` | `fSeen`
    `protected SymbolTable` | `fSymbolTable`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XSAttributeChecker(XSDHandler schemaHandler)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object[]` | `checkAttributes(org.w3c.dom.Element element, boolean isGlobal, org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)` Check whether the specified element conforms to the attributes restriction.
    `java.lang.Object[]` | `checkAttributes(org.w3c.dom.Element element, boolean isGlobal, org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc, boolean enumAsQName)` Check whether the specified element conforms to the attributes restriction.
    `void` | `checkNonSchemaAttributes(XSGrammarBucket grammarBucket)`
    `java.lang.String` | `checkTargetNamespace(org.w3c.dom.Element element, org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)`
    `protected java.lang.Object[]` | `getAvailableArray()`
    `static java.lang.String` | `normalize(java.lang.String content, short ws)`
    `void` | `reset(SymbolTable symbolTable)`
    `void` | `resolveNamespace(org.w3c.dom.Element element, org.w3c.dom.Attr[] attrs, SchemaNamespaceSupport nsSupport)`
    `void` | `returnAttrArray(java.lang.Object[] attrArray, org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)`

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

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

- - ### Field Detail

    - #### ATTIDX_ABSTRACT

          public static final int ATTIDX_ABSTRACT

    - #### ATTIDX_AFORMDEFAULT

          public static final int ATTIDX_AFORMDEFAULT

    - #### ATTIDX_BASE

          public static final int ATTIDX_BASE

    - #### ATTIDX_BLOCK

          public static final int ATTIDX_BLOCK

    - #### ATTIDX_BLOCKDEFAULT

          public static final int ATTIDX_BLOCKDEFAULT

    - #### ATTIDX_DEFAULT

          public static final int ATTIDX_DEFAULT

    - #### ATTIDX_EFORMDEFAULT

          public static final int ATTIDX_EFORMDEFAULT

    - #### ATTIDX_FINAL

          public static final int ATTIDX_FINAL

    - #### ATTIDX_FINALDEFAULT

          public static final int ATTIDX_FINALDEFAULT

    - #### ATTIDX_FIXED

          public static final int ATTIDX_FIXED

    - #### ATTIDX_FORM

          public static final int ATTIDX_FORM

    - #### ATTIDX_ID

          public static final int ATTIDX_ID

    - #### ATTIDX_ITEMTYPE

          public static final int ATTIDX_ITEMTYPE

    - #### ATTIDX_MAXOCCURS

          public static final int ATTIDX_MAXOCCURS

    - #### ATTIDX_MEMBERTYPES

          public static final int ATTIDX_MEMBERTYPES

    - #### ATTIDX_MINOCCURS

          public static final int ATTIDX_MINOCCURS

    - #### ATTIDX_MIXED

          public static final int ATTIDX_MIXED

    - #### ATTIDX_NAME

          public static final int ATTIDX_NAME

    - #### ATTIDX_NAMESPACE

          public static final int ATTIDX_NAMESPACE

    - #### ATTIDX_NAMESPACE_LIST

          public static final int ATTIDX_NAMESPACE_LIST

    - #### ATTIDX_NILLABLE

          public static final int ATTIDX_NILLABLE

    - #### ATTIDX_NONSCHEMA

          public static final int ATTIDX_NONSCHEMA

    - #### ATTIDX_PROCESSCONTENTS

          public static final int ATTIDX_PROCESSCONTENTS

    - #### ATTIDX_PUBLIC

          public static final int ATTIDX_PUBLIC

    - #### ATTIDX_REF

          public static final int ATTIDX_REF

    - #### ATTIDX_REFER

          public static final int ATTIDX_REFER

    - #### ATTIDX_SCHEMALOCATION

          public static final int ATTIDX_SCHEMALOCATION

    - #### ATTIDX_SOURCE

          public static final int ATTIDX_SOURCE

    - #### ATTIDX_SUBSGROUP

          public static final int ATTIDX_SUBSGROUP

    - #### ATTIDX_SYSTEM

          public static final int ATTIDX_SYSTEM

    - #### ATTIDX_TARGETNAMESPACE

          public static final int ATTIDX_TARGETNAMESPACE

    - #### ATTIDX_TYPE

          public static final int ATTIDX_TYPE

    - #### ATTIDX_USE

          public static final int ATTIDX_USE

    - #### ATTIDX_VALUE

          public static final int ATTIDX_VALUE

    - #### ATTIDX_ENUMNSDECLS

          public static final int ATTIDX_ENUMNSDECLS

    - #### ATTIDX_VERSION

          public static final int ATTIDX_VERSION

    - #### ATTIDX_XML_LANG

          public static final int ATTIDX_XML_LANG

    - #### ATTIDX_XPATH

          public static final int ATTIDX_XPATH

    - #### ATTIDX_FROMDEFAULT

          public static final int ATTIDX_FROMDEFAULT

    - #### ATTIDX_ISRETURNED

          public static final int ATTIDX_ISRETURNED

    - #### ATTIDX_APPLIESTOEMPTY

          public static final int ATTIDX_APPLIESTOEMPTY

    - #### ATTIDX_DEFAULTATTRAPPLY

          public static final int ATTIDX_DEFAULTATTRAPPLY

    - #### ATTIDX_DEFAULTATTRIBUTES

          public static final int ATTIDX_DEFAULTATTRIBUTES

    - #### ATTIDX_MODE

          public static final int ATTIDX_MODE

    - #### ATTIDX_NOTNAMESPACE

          public static final int ATTIDX_NOTNAMESPACE

    - #### ATTIDX_NOTQNAME

          public static final int ATTIDX_NOTQNAME

    - #### ATTIDX_XPATHDEFAULTNS

          public static final int ATTIDX_XPATHDEFAULTNS

    - #### ATTIDX_INHERITABLE

          public static final int ATTIDX_INHERITABLE

    - #### ATTIDX_XPATHDEFAULTNS_TWOPOUNDDFLT

          public static final int ATTIDX_XPATHDEFAULTNS_TWOPOUNDDFLT

    - #### DT_ANYURI

          protected static final int DT_ANYURI

      See Also:
        Constant Field Values

    - #### DT_ID

          protected static final int DT_ID

      See Also:
        Constant Field Values

    - #### DT_QNAME

          protected static final int DT_QNAME

      See Also:
        Constant Field Values

    - #### DT_STRING

          protected static final int DT_STRING

      See Also:
        Constant Field Values

    - #### DT_TOKEN

          protected static final int DT_TOKEN

      See Also:
        Constant Field Values

    - #### DT_NCNAME

          protected static final int DT_NCNAME

      See Also:
        Constant Field Values

    - #### DT_XPATH

          protected static final int DT_XPATH

      See Also:
        Constant Field Values

    - #### DT_XPATH1

          protected static final int DT_XPATH1

      See Also:
        Constant Field Values

    - #### DT_LANGUAGE

          protected static final int DT_LANGUAGE

      See Also:
        Constant Field Values

    - #### DT_COUNT

          protected static final int DT_COUNT

      See Also:
        Constant Field Values

    - #### DT_BLOCK

          protected static final int DT_BLOCK

      See Also:
        Constant Field Values

    - #### DT_BLOCK1

          protected static final int DT_BLOCK1

      See Also:
        Constant Field Values

    - #### DT_FINAL

          protected static final int DT_FINAL

      See Also:
        Constant Field Values

    - #### DT_FINAL1

          protected static final int DT_FINAL1

      See Also:
        Constant Field Values

    - #### DT_FINAL2

          protected static final int DT_FINAL2

      See Also:
        Constant Field Values

    - #### DT_FORM

          protected static final int DT_FORM

      See Also:
        Constant Field Values

    - #### DT_MAXOCCURS

          protected static final int DT_MAXOCCURS

      See Also:
        Constant Field Values

    - #### DT_MAXOCCURS1

          protected static final int DT_MAXOCCURS1

      See Also:
        Constant Field Values

    - #### DT_MEMBERTYPES

          protected static final int DT_MEMBERTYPES

      See Also:
        Constant Field Values

    - #### DT_MINOCCURS1

          protected static final int DT_MINOCCURS1

      See Also:
        Constant Field Values

    - #### DT_NAMESPACE

          protected static final int DT_NAMESPACE

      See Also:
        Constant Field Values

    - #### DT_PROCESSCONTENTS

          protected static final int DT_PROCESSCONTENTS

      See Also:
        Constant Field Values

    - #### DT_USE

          protected static final int DT_USE

      See Also:
        Constant Field Values

    - #### DT_WHITESPACE

          protected static final int DT_WHITESPACE

      See Also:
        Constant Field Values

    - #### DT_BOOLEAN

          protected static final int DT_BOOLEAN

      See Also:
        Constant Field Values

    - #### DT_NONNEGINT

          protected static final int DT_NONNEGINT

      See Also:
        Constant Field Values

    - #### DT_POSINT

          protected static final int DT_POSINT

      See Also:
        Constant Field Values

    - #### DT_XPATH_DEFAULT_NS

          protected static final int DT_XPATH_DEFAULT_NS

      See Also:
        Constant Field Values

    - #### DT_MODE

          protected static final int DT_MODE

      See Also:
        Constant Field Values

    - #### DT_MODE1

          protected static final int DT_MODE1

      See Also:
        Constant Field Values

    - #### DT_NOTNAMESPACE

          protected static final int DT_NOTNAMESPACE

      See Also:
        Constant Field Values

    - #### DT_NOTQNAME

          protected static final int DT_NOTQNAME

      See Also:
        Constant Field Values

    - #### DT_INT

          protected static final int DT_INT

      See Also:
        Constant Field Values

    - #### DT_EXPLICITTIMEZONE

          protected static final int DT_EXPLICITTIMEZONE

      See Also:
        Constant Field Values

    - #### fSchemaHandler

          protected XSDHandler fSchemaHandler

    - #### fSymbolTable

          protected SymbolTable fSymbolTable

    - #### fNonSchemaAttrs

          protected java.util.Hashtable fNonSchemaAttrs

    - #### fNamespaceList

          protected java.util.Vector fNamespaceList

    - #### fSeen

          protected boolean[] fSeen

  - ### Constructor Detail

    - #### XSAttributeChecker

          public XSAttributeChecker(XSDHandler schemaHandler)

  - ### Method Detail

    - #### reset

          public void reset(SymbolTable symbolTable)

    - #### checkTargetNamespace

          public java.lang.String checkTargetNamespace(org.w3c.dom.Element element,
                                              org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)

    - #### checkAttributes

          public java.lang.Object[] checkAttributes(org.w3c.dom.Element element,
                                           boolean isGlobal,
                                           org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)

      Check whether the specified element conforms to the attributes restriction. an array of attribute values is returned. the caller must call `returnAttrArray` to return that array.
      Parameters:
        `element` - which element to check
        `isGlobal` - whether a child of <schema> or <redefine>
        `schemaDoc` - the document where the element lives in
      Returns:
        an array containing attribute values

    - #### checkAttributes

          public java.lang.Object[] checkAttributes(org.w3c.dom.Element element,
                                           boolean isGlobal,
                                           org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc,
                                           boolean enumAsQName)

      Check whether the specified element conforms to the attributes restriction. an array of attribute values is returned. the caller must call `returnAttrArray` to return that array. This method also takes an extra parameter: if the element is "enumeration", whether to make a copy of the namespace context, so that the value can be resolved as a QName later.
      Parameters:
        `element` - which element to check
        `isGlobal` - whether a child of <schema> or <redefine>
        `schemaDoc` - the document where the element lives in
        `enumAsQName` - whether to tread enumeration value as QName
      Returns:
        an array containing attribute values

    - #### checkNonSchemaAttributes

          public void checkNonSchemaAttributes(XSGrammarBucket grammarBucket)

    - #### normalize

          public static java.lang.String normalize(java.lang.String content,
                                   short ws)

    - #### getAvailableArray

          protected java.lang.Object[] getAvailableArray()

    - #### returnAttrArray

          public void returnAttrArray(java.lang.Object[] attrArray,
                             org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)

    - #### resolveNamespace

          public void resolveNamespace(org.w3c.dom.Element element,
                              org.w3c.dom.Attr[] attrs,
                              SchemaNamespaceSupport nsSupport)

Copyright © 1999-2022 The Apache Software Foundation. All Rights Reserved.