Class CMRelaxNGDocument

  • All Implemented Interfaces:
    CMDocument

    public class CMRelaxNGDocument
    extends Object
    implements CMDocument
    RelaxNG content document implementation.

    NOTE : this class is hosted in 'com.thaiopensource.relaxng.pattern' because Pattern implementation like ElementPattern are not public. Once https://github.com/relaxng/jing-trang/issues/271 will be fixed we could move this class in 'org.eclipse.lemminx.extensions.relaxng.contentmodel' package.

    Author:
    Angelo ZERR
    • Constructor Detail

      • CMRelaxNGDocument

        public CMRelaxNGDocument​(String relaxNGURI,
                                 com.thaiopensource.relaxng.pattern.Pattern start,
                                 URIResolverExtensionManager resolverExtensionManager)
    • 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.
      • 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.
      • 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.
      • getDocumentation

        public String getDocumentation​(Locator locator)