java.lang.Object
org.eclipse.lemminx.extensions.xsd.contentmodel.CMXSDDocument
All Implemented Interfaces:
org.apache.xerces.impl.xs.XSElementDeclHelper, CMDocument

public class CMXSDDocument extends Object implements CMDocument, org.apache.xerces.impl.xs.XSElementDeclHelper
XSD document implementation.
  • Constructor Details

    • CMXSDDocument

      public CMXSDDocument(org.apache.xerces.xs.XSModel model, org.apache.xerces.impl.xs.XSLoaderImpl xsLoaderImpl)
  • Method Details

    • getNamespace

      public String getNamespace()
      Description copied from interface: CMDocument
      Returns the target namespace of this grammar document, or null if the grammar has no target namespace (e.g., a no-namespace XSD or a DTD).
      Specified by:
      getNamespace in interface CMDocument
      Returns:
      the target namespace URI, or null.
    • 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
      Parameters:
      namespaceURI -
      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.
    • 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.
    • findXsiTypeDerivedElements

      public Collection<CMElementDeclaration> findXsiTypeDerivedElements(DOMElement element)
      Returns all child element declarations from the xsi:type-derived complex type. Used by completion to propose child elements when the parent element uses an xsi:type from a different namespace.
      Specified by:
      findXsiTypeDerivedElements in interface CMDocument
      Parameters:
      element - the DOM element with xsi:type attribute.
      Returns:
      the child element declarations, or empty if not applicable.
    • findDerivedTypeNames

      public Collection<String> findDerivedTypeNames(DOMElement element)
      Description copied from interface: CMDocument
      Returns the names of types that can be used as xsi:type values for the given element (i.e. derived types of the element's declared type).
      Specified by:
      findDerivedTypeNames in interface CMDocument
      Parameters:
      element - the DOM element
      Returns:
      the collection of qualified type names.
    • getGlobalElementDecl

      public org.apache.xerces.impl.xs.XSElementDecl getGlobalElementDecl(org.apache.xerces.xni.QName element)
      Specified by:
      getGlobalElementDecl in interface org.apache.xerces.impl.xs.XSElementDeclHelper
    • findTypeLocation

      public org.eclipse.lsp4j.LocationLink findTypeLocation(DOMNode originNode)
      Description copied from interface: CMDocument
      Returns the location of the type definition of the given node.
      Specified by:
      findTypeLocation in interface CMDocument
      Parameters:
      originNode - 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.