org.apache.xerces.impl.dtd

## Class XMLDTDDescription

- java.lang.Object
- - org.apache.xerces.util.XMLResourceIdentifierImpl
  - - org.apache.xerces.impl.dtd.XMLDTDDescription

- All Implemented Interfaces:
    org.apache.xerces.xni.grammars.XMLDTDDescription, org.apache.xerces.xni.grammars.XMLGrammarDescription, org.apache.xerces.xni.XMLResourceIdentifier

      public class XMLDTDDescription
      extends XMLResourceIdentifierImpl
      implements org.apache.xerces.xni.grammars.XMLDTDDescription

  All information specific to DTD grammars.
  Version:
    $Id: XMLDTDDescription.java 883491 2009-11-23 20:32:14Z knoaman $
  Author:
    Neil Graham, 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
    --- | ---
    `protected java.util.ArrayList` | `fPossibleRoots`
    `protected java.lang.String` | `fRootName`

    - ### Fields inherited from class org.apache.xerces.util.XMLResourceIdentifierImpl

      `fBaseSystemId, fExpandedSystemId, fLiteralSystemId, fNamespace, fPublicId`

    - ### Fields inherited from interface org.apache.xerces.xni.grammars.XMLGrammarDescription

      `XML_DTD, XML_SCHEMA`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLDTDDescription(java.lang.String publicId, java.lang.String literalId, java.lang.String baseId, java.lang.String expandedId, java.lang.String rootName)`
    `XMLDTDDescription(org.apache.xerces.xni.parser.XMLInputSource source)`
    `XMLDTDDescription(org.apache.xerces.xni.XMLResourceIdentifier id, java.lang.String rootName)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object desc)` Compares this grammar with the given grammar.
    `java.lang.String` | `getGrammarType()` Return the type of this grammar.
    `java.lang.String` | `getRootName()` Return the root name of this DTD.
    `int` | `hashCode()` Returns the hash code of this grammar Because our .equals method is so complex, we just return a very simple hash that might avoid calls to the equals method a bit...
    `void` | `setPossibleRoots(java.util.ArrayList possibleRoots)` Set possible roots
    `void` | `setPossibleRoots(java.util.Vector possibleRoots)` Set possible roots
    `void` | `setRootName(java.lang.String rootName)` Set the root name

    - ### Methods inherited from class org.apache.xerces.util.XMLResourceIdentifierImpl

      `clear, getBaseSystemId, getExpandedSystemId, getLiteralSystemId, getNamespace, getPublicId, setBaseSystemId, setExpandedSystemId, setLiteralSystemId, setNamespace, setPublicId, setValues, setValues, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.xerces.xni.XMLResourceIdentifier

      `getBaseSystemId, getExpandedSystemId, getLiteralSystemId, getNamespace, getPublicId, setBaseSystemId, setExpandedSystemId, setLiteralSystemId, setNamespace, setPublicId`

- - ### Field Detail

    - #### fRootName

          protected java.lang.String fRootName

    - #### fPossibleRoots

          protected java.util.ArrayList fPossibleRoots

  - ### Constructor Detail

    - #### XMLDTDDescription

          public XMLDTDDescription(org.apache.xerces.xni.XMLResourceIdentifier id,
                           java.lang.String rootName)

    - #### XMLDTDDescription

          public XMLDTDDescription(java.lang.String publicId,
                           java.lang.String literalId,
                           java.lang.String baseId,
                           java.lang.String expandedId,
                           java.lang.String rootName)

    - #### XMLDTDDescription

          public XMLDTDDescription(org.apache.xerces.xni.parser.XMLInputSource source)

  - ### Method Detail

    - #### getGrammarType

          public java.lang.String getGrammarType()

      Description copied from interface: `org.apache.xerces.xni.grammars.XMLGrammarDescription`
      Return the type of this grammar.
      Specified by:
        `getGrammarType` in interface `org.apache.xerces.xni.grammars.XMLGrammarDescription`
      Returns:
        the type of this grammar

    - #### getRootName

          public java.lang.String getRootName()

      Description copied from interface: `org.apache.xerces.xni.grammars.XMLDTDDescription`
      Return the root name of this DTD.
      Specified by:
        `getRootName` in interface `org.apache.xerces.xni.grammars.XMLDTDDescription`
      Returns:
        the root name of this DTD or null if root name is unknown

    - #### setRootName

          public void setRootName(java.lang.String rootName)

      Set the root name

    - #### setPossibleRoots

          public void setPossibleRoots(java.util.ArrayList possibleRoots)

      Set possible roots

    - #### setPossibleRoots

          public void setPossibleRoots(java.util.Vector possibleRoots)

      Set possible roots

    - #### equals

          public boolean equals(java.lang.Object desc)

      Compares this grammar with the given grammar. Currently, we compare as follows: - if grammar type not equal return false immediately - try and find a common root name: - if both have roots, use them - else if one has a root, examine other's possible root's for a match; - else try all combinations - test fExpandedSystemId and fPublicId as above
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `desc` - The description of the grammar to be compared with
      Returns:
        True if they are equal, else false

    - #### hashCode

          public int hashCode()

      Returns the hash code of this grammar Because our .equals method is so complex, we just return a very simple hash that might avoid calls to the equals method a bit...
      Overrides:
        `hashCode` in class `XMLResourceIdentifierImpl`
      Returns:
        The hash code

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