Class CMXSDDocument
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 Summary
ConstructorsConstructorDescriptionCMXSDDocument(org.apache.xerces.xs.XSModel model, org.apache.xerces.impl.xs.XSLoaderImpl xsLoaderImpl) -
Method Summary
Modifier and TypeMethodDescriptionfindCMElement(DOMElement element, String namespace) Returns the declared element which matches the given XML element and null otherwise.findDerivedTypeNames(DOMElement element) 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).org.eclipse.lsp4j.LocationLinkfindTypeLocation(DOMNode originNode) Returns the location of the type definition of the given node.findXsiTypeDerivedElements(DOMElement element) Returns all child element declarations from the xsi:type-derived complex type.Returns the elements declaration of the model document root.org.apache.xerces.impl.xs.XSElementDeclgetGlobalElementDecl(org.apache.xerces.xni.QName element) Returns the target namespace of this grammar document, ornullif the grammar has no target namespace (e.g., a no-namespace XSD or a DTD).booleanhasNamespace(String namespaceURI) Returns true if the model document defines the given namespace and false otherwise.booleanisDirty()Returns true if the content model document is dirty and false otherwise.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.lemminx.extensions.contentmodel.model.CMDocument
findCMAttribute, findCMElement, getEntities
-
Constructor Details
-
CMXSDDocument
public CMXSDDocument(org.apache.xerces.xs.XSModel model, org.apache.xerces.impl.xs.XSLoaderImpl xsLoaderImpl)
-
-
Method Details
-
getNamespace
Description copied from interface:CMDocumentReturns the target namespace of this grammar document, ornullif the grammar has no target namespace (e.g., a no-namespace XSD or a DTD).- Specified by:
getNamespacein interfaceCMDocument- Returns:
- the target namespace URI, or
null.
-
hasNamespace
Description copied from interface:CMDocumentReturns true if the model document defines the given namespace and false otherwise.- Specified by:
hasNamespacein interfaceCMDocument- Parameters:
namespaceURI-- Returns:
- true if the model document defines the given namespace and false otherwise.
-
getElements
Description copied from interface:CMDocumentReturns the elements declaration of the model document root.- Specified by:
getElementsin interfaceCMDocument- Returns:
- the elements declaration of the model document root.
-
findCMElement
Description copied from interface:CMDocumentReturns the declared element which matches the given XML element and null otherwise.- Specified by:
findCMElementin interfaceCMDocument- Parameters:
element- the XML elementnamespace- the given namespace- Returns:
- the declared element which matches the given XML element and null otherwise.
-
findXsiTypeDerivedElements
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:
findXsiTypeDerivedElementsin interfaceCMDocument- Parameters:
element- the DOM element with xsi:type attribute.- Returns:
- the child element declarations, or empty if not applicable.
-
findDerivedTypeNames
Description copied from interface:CMDocumentReturns 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:
findDerivedTypeNamesin interfaceCMDocument- 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:
getGlobalElementDeclin interfaceorg.apache.xerces.impl.xs.XSElementDeclHelper
-
findTypeLocation
Description copied from interface:CMDocumentReturns the location of the type definition of the given node.- Specified by:
findTypeLocationin interfaceCMDocument- Parameters:
originNode- the node- Returns:
- the location of the type definition of the given node.
-
isDirty
public boolean isDirty()Description copied from interface:CMDocumentReturns true if the content model document is dirty and false otherwise.- Specified by:
isDirtyin interfaceCMDocument- Returns:
- true if the content model document is dirty and false otherwise.
-