Package org.eclipse.lemminx.extensions.dtd.contentmodel

## Class CMDTDDocument

- java.lang.Object
- - org.apache.xerces.impl.dtd.XMLDTDProcessor
  - - org.apache.xerces.impl.dtd.XMLDTDLoader
    - - org.apache.xerces.impl.dtd.XML11DTDProcessor
      - - org.eclipse.lemminx.extensions.dtd.participants.diagnostics.LSPXML11DTDProcessor
        - - org.eclipse.lemminx.extensions.dtd.contentmodel.CMDTDDocument

All Implemented Interfaces:
  `org.apache.xerces.xni.grammars.XMLGrammarLoader`, `org.apache.xerces.xni.parser.XMLComponent`, `org.apache.xerces.xni.parser.XMLDTDContentModelFilter`, `org.apache.xerces.xni.parser.XMLDTDContentModelSource`, `org.apache.xerces.xni.parser.XMLDTDFilter`, `org.apache.xerces.xni.parser.XMLDTDSource`, `org.apache.xerces.xni.XMLDTDContentModelHandler`, `org.apache.xerces.xni.XMLDTDHandler`, `CMDocument`

    public class CMDTDDocument
    extends LSPXML11DTDProcessor
    implements CMDocument

DTD document.

Author:
  Angelo ZERR

### Field Summary

### Fields inherited from class org.apache.xerces.impl.dtd.XMLDTDLoader

`BALANCE_SYNTAX_TREES, ENTITY_RESOLVER, ERROR_HANDLER, fDTDScanner, fEntityManager, fEntityResolver, fLocale, LOCALE, STANDARD_URI_CONFORMANT_FEATURE`

### Fields inherited from class org.apache.xerces.impl.dtd.XMLDTDProcessor

`DTD_VALIDATOR, ERROR_REPORTER, fDTDContentModelHandler, fDTDContentModelSource, fDTDGrammar, fDTDHandler, fDTDSource, fDTDValidation, fErrorReporter, fGrammarBucket, fGrammarPool, fInDTDIgnore, fSymbolTable, fValidation, fValidator, fWarnDuplicateAttdef, fWarnOnUndeclaredElemdef, GRAMMAR_POOL, NOTIFY_CHAR_REFS, PARSER_SETTINGS, SYMBOL_TABLE, VALIDATION, WARN_ON_DUPLICATE_ATTDEF, WARN_ON_UNDECLARED_ELEMDEF`

### Fields inherited from interface org.apache.xerces.xni.XMLDTDContentModelHandler

`OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCE`

### Fields inherited from interface org.apache.xerces.xni.XMLDTDHandler

`CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE`

### Constructor Summary

Constructors
`CMDTDDocument​(String uri, org.apache.xerces.impl.XMLEntityManager entityManager, org.apache.xerces.impl.XMLErrorReporter errorReporter, org.apache.xerces.xni.parser.XMLEntityResolver entityResolver)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `attributeDecl​(String elementName, String attributeName, String type, String[] enumeration, String defaultType, org.apache.xerces.xni.XMLString defaultValue, org.apache.xerces.xni.XMLString nonNormalizedDefaultValue, org.apache.xerces.xni.Augmentations augs)`
`void` `comment​(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)`
`void` `element​(String elementName, org.apache.xerces.xni.Augmentations augs)`
`void` `endAttlist​(org.apache.xerces.xni.Augmentations augs)`
`void` `endContentModel​(org.apache.xerces.xni.Augmentations augs)`
`void` `externalEntityDecl​(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augs)`
`CMElementDeclaration` `findCMElement​(DOMElement element, String namespace)` Returns the declared element which matches the given XML element and null otherwise.
`org.eclipse.lsp4j.LocationLink` `findTypeLocation​(DOMNode node)` Returns the location of the type definition of the given node.
`Collection<CMElementDeclaration>` `getElements()` Returns the elements declaration of the model document root.
`List<Entity>` `getEntities()` Returns list of declared entities.
`Map<String,​org.eclipse.lemminx.extensions.dtd.contentmodel.CMDTDDocument.DTDElementInfo>` `getHierarchiesMap()`
`String` `getURI()` Returns the URI of this document, is none was provided this returns null.
`boolean` `hasNamespace​(String namespaceURI)` Returns true if the model document defines the given namespace and false otherwise.
`void` `internalEntityDecl​(String name, org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.XMLString nonNormalizedText, org.apache.xerces.xni.Augmentations augs)`
`boolean` `isDirty()` Returns true if the content model document is dirty and false otherwise.
`org.apache.xerces.xni.grammars.Grammar` `loadGrammar​(org.apache.xerces.xni.parser.XMLInputSource source)`
`void` `loadInternalDTD​(String internalSubset, String baseSystemId, String systemId)`
`void` `startAttlist​(String elementName, org.apache.xerces.xni.Augmentations augs)`
`void` `startContentModel​(String elementName, org.apache.xerces.xni.Augmentations augs)`

### Methods inherited from class org.apache.xerces.impl.dtd.XML11DTDProcessor

`createDTDScanner, getScannerVersion, isValidName, isValidNmtoken`

### Methods inherited from class org.apache.xerces.impl.dtd.XMLDTDLoader

`getEntityResolver, getErrorHandler, getFeature, getLocale, getProperty, getRecognizedFeatures, getRecognizedProperties, loadGrammarWithContext, reset, setEntityResolver, setErrorHandler, setFeature, setLocale, setProperty`

### Methods inherited from class org.apache.xerces.impl.dtd.XMLDTDProcessor

`any, checkStandaloneEntityRef, elementDecl, empty, endConditional, endDTD, endExternalSubset, endGroup, endParameterEntity, getDTDContentModelHandler, getDTDContentModelSource, getDTDHandler, getDTDSource, getFeatureDefault, getPropertyDefault, ignoredCharacters, notationDecl, occurrence, pcdata, processingInstruction, reset, separator, setDTDContentModelHandler, setDTDContentModelSource, setDTDHandler, setDTDSource, startConditional, startDTD, startExternalSubset, startGroup, startParameterEntity, textDecl, unparsedEntityDecl`

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

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

### Methods inherited from interface org.eclipse.lemminx.extensions.contentmodel.model.CMDocument

`findCMAttribute, findCMElement`

### Constructor Detail

#### CMDTDDocument

    public CMDTDDocument​(String uri,
                         org.apache.xerces.impl.XMLEntityManager entityManager,
                         org.apache.xerces.impl.XMLErrorReporter errorReporter,
                         org.apache.xerces.xni.parser.XMLEntityResolver entityResolver)

### Method Detail

#### hasNamespace

    public boolean hasNamespace​(String namespaceURI)

Description copied from interface: `CMDocument`
Returns true if the model document defines the given namespace and false otherwise.

Specified by:
  `hasNamespace` in interface `CMDocument`
Returns:
  true if the model document defines the given namespace and false otherwise.

#### getElements

    public Collection<CMElementDeclaration> getElements()

Description copied from interface: `CMDocument`
Returns the elements declaration of the model document root.

Specified by:
  `getElements` in interface `CMDocument`
Returns:
  the elements declaration of the model document root.

#### getURI

    public String getURI()

Returns the URI of this document, is none was provided this returns null.

#### findCMElement

    public CMElementDeclaration findCMElement​(DOMElement element,
                                              String namespace)

Description copied from interface: `CMDocument`
Returns the declared element which matches the given XML element and null otherwise.

Specified by:
  `findCMElement` in interface `CMDocument`
Parameters:
  `element` - the XML element
  `namespace` - the given namespace
Returns:
  the declared element which matches the given XML element and null otherwise.

#### internalEntityDecl

    public void internalEntityDecl​(String name,
                                   org.apache.xerces.xni.XMLString text,
                                   org.apache.xerces.xni.XMLString nonNormalizedText,
                                   org.apache.xerces.xni.Augmentations augs)
                            throws org.apache.xerces.xni.XNIException

Specified by:
  `internalEntityDecl` in interface `org.apache.xerces.xni.XMLDTDHandler`
Overrides:
  `internalEntityDecl` in class `org.apache.xerces.impl.dtd.XMLDTDProcessor`
Throws:
  `org.apache.xerces.xni.XNIException`

#### externalEntityDecl

    public void externalEntityDecl​(String name,
                                   org.apache.xerces.xni.XMLResourceIdentifier identifier,
                                   org.apache.xerces.xni.Augmentations augs)
                            throws org.apache.xerces.xni.XNIException

Specified by:
  `externalEntityDecl` in interface `org.apache.xerces.xni.XMLDTDHandler`
Overrides:
  `externalEntityDecl` in class `org.apache.xerces.impl.dtd.XMLDTDProcessor`
Throws:
  `org.apache.xerces.xni.XNIException`

#### startContentModel

    public void startContentModel​(String elementName,
                                  org.apache.xerces.xni.Augmentations augs)
                           throws org.apache.xerces.xni.XNIException

Specified by:
  `startContentModel` in interface `org.apache.xerces.xni.XMLDTDContentModelHandler`
Overrides:
  `startContentModel` in class `org.apache.xerces.impl.dtd.XMLDTDProcessor`
Throws:
  `org.apache.xerces.xni.XNIException`

#### element

    public void element​(String elementName,
                        org.apache.xerces.xni.Augmentations augs)
                 throws org.apache.xerces.xni.XNIException

Specified by:
  `element` in interface `org.apache.xerces.xni.XMLDTDContentModelHandler`
Overrides:
  `element` in class `org.apache.xerces.impl.dtd.XMLDTDProcessor`
Throws:
  `org.apache.xerces.xni.XNIException`

#### endContentModel

    public void endContentModel​(org.apache.xerces.xni.Augmentations augs)
                         throws org.apache.xerces.xni.XNIException

Specified by:
  `endContentModel` in interface `org.apache.xerces.xni.XMLDTDContentModelHandler`
Overrides:
  `endContentModel` in class `org.apache.xerces.impl.dtd.XMLDTDProcessor`
Throws:
  `org.apache.xerces.xni.XNIException`

#### startAttlist

    public void startAttlist​(String elementName,
                             org.apache.xerces.xni.Augmentations augs)
                      throws org.apache.xerces.xni.XNIException

Specified by:
  `startAttlist` in interface `org.apache.xerces.xni.XMLDTDHandler`
Overrides:
  `startAttlist` in class `org.apache.xerces.impl.dtd.XMLDTDProcessor`
Throws:
  `org.apache.xerces.xni.XNIException`

#### attributeDecl

    public void attributeDecl​(String elementName,
                              String attributeName,
                              String type,
                              String[] enumeration,
                              String defaultType,
                              org.apache.xerces.xni.XMLString defaultValue,
                              org.apache.xerces.xni.XMLString nonNormalizedDefaultValue,
                              org.apache.xerces.xni.Augmentations augs)
                       throws org.apache.xerces.xni.XNIException

Specified by:
  `attributeDecl` in interface `org.apache.xerces.xni.XMLDTDHandler`
Overrides:
  `attributeDecl` in class `org.apache.xerces.impl.dtd.XMLDTDProcessor`
Throws:
  `org.apache.xerces.xni.XNIException`

#### endAttlist

    public void endAttlist​(org.apache.xerces.xni.Augmentations augs)
                    throws org.apache.xerces.xni.XNIException

Specified by:
  `endAttlist` in interface `org.apache.xerces.xni.XMLDTDHandler`
Overrides:
  `endAttlist` in class `org.apache.xerces.impl.dtd.XMLDTDProcessor`
Throws:
  `org.apache.xerces.xni.XNIException`

#### loadGrammar

    public org.apache.xerces.xni.grammars.Grammar loadGrammar​(org.apache.xerces.xni.parser.XMLInputSource source)
                                                       throws IOException,
                                                              org.apache.xerces.xni.XNIException

Specified by:
  `loadGrammar` in interface `org.apache.xerces.xni.grammars.XMLGrammarLoader`
Overrides:
  `loadGrammar` in class `org.apache.xerces.impl.dtd.XMLDTDLoader`
Throws:
  `IOException`
  `org.apache.xerces.xni.XNIException`

#### loadInternalDTD

    public void loadInternalDTD​(String internalSubset,
                                String baseSystemId,
                                String systemId)
                         throws org.apache.xerces.xni.XNIException,
                                IOException

Throws:
  `org.apache.xerces.xni.XNIException`
  `IOException`

#### comment

    public void comment​(org.apache.xerces.xni.XMLString text,
                        org.apache.xerces.xni.Augmentations augs)
                 throws org.apache.xerces.xni.XNIException

Specified by:
  `comment` in interface `org.apache.xerces.xni.XMLDTDHandler`
Overrides:
  `comment` in class `org.apache.xerces.impl.dtd.XMLDTDProcessor`
Throws:
  `org.apache.xerces.xni.XNIException`

#### getHierarchiesMap

    public Map<String,​org.eclipse.lemminx.extensions.dtd.contentmodel.CMDTDDocument.DTDElementInfo> getHierarchiesMap()

#### findTypeLocation

    public org.eclipse.lsp4j.LocationLink findTypeLocation​(DOMNode node)

Description copied from interface: `CMDocument`
Returns the location of the type definition of the given node.

Specified by:
  `findTypeLocation` in interface `CMDocument`
Parameters:
  `node` - the node
Returns:
  the location of the type definition of the given node.

#### isDirty

    public boolean isDirty()

Description copied from interface: `CMDocument`
Returns true if the content model document is dirty and false otherwise.

Specified by:
  `isDirty` in interface `CMDocument`
Returns:
  true if the content model document is dirty and false otherwise.

#### getEntities

    public List<Entity> getEntities()

Description copied from interface: `CMDocument`
Returns list of declared entities.

Specified by:
  `getEntities` in interface `CMDocument`
Returns:
  list of declared entities.