Class CMXMLModelContentModelProvider
- java.lang.Object
-
- org.eclipse.lemminx.extensions.xmlmodel.contentmodel.CMXMLModelContentModelProvider
-
- All Implemented Interfaces:
ContentModelProvider
public class CMXMLModelContentModelProvider extends Object implements ContentModelProvider
Content model provider to manage href of xml-model processing instruction.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.lemminx.extensions.contentmodel.model.ContentModelProvider
ContentModelProvider.Identifier
-
-
Constructor Summary
Constructors Constructor Description CMXMLModelContentModelProvider(ContentModelManager modelManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadaptFor(String uri)Returns true if the given resource uri can be adapted for this content model and false otherwise.booleanadaptFor(DOMDocument document, boolean internal)Returns the content model provider by using standard association (xsi:schemaLocation, xsi:noNamespaceSchemaLocation, doctype) and null otherwise.CMDocumentcreateCMDocument(String uri, boolean resolveExternalEntities)Create content model document (XSD, DTD, etc) from the given resource key and null otherwise.CMDocumentcreateInternalCMDocument(DOMDocument xmlDocument, boolean resolveExternalEntities)Create the internal content model (for DOCTYPE subset) from the given DOM document.Collection<ContentModelProvider.Identifier>getIdentifiers(DOMDocument xmlDocument, String namespaceURI)Returns the identifiers list from the given document and namespace.
-
-
-
Constructor Detail
-
CMXMLModelContentModelProvider
public CMXMLModelContentModelProvider(ContentModelManager modelManager)
-
-
Method Detail
-
adaptFor
public boolean adaptFor(DOMDocument document, boolean internal)
Description copied from interface:ContentModelProviderReturns the content model provider by using standard association (xsi:schemaLocation, xsi:noNamespaceSchemaLocation, doctype) and null otherwise.- Specified by:
adaptForin interfaceContentModelProvider- Parameters:
document- the DOM document.internal- true if it is an internal content model (ex : DOCCTYPE subset) and false otherwise.- Returns:
- the content model provider by using standard association (xsi:schemaLocation, xsi:noNamespaceSchemaLocation, doctype) and null otherwise.
-
adaptFor
public boolean adaptFor(String uri)
Description copied from interface:ContentModelProviderReturns true if the given resource uri can be adapted for this content model and false otherwise. o@param uri the resource Uri.- Specified by:
adaptForin interfaceContentModelProvider- Returns:
- true if the given resource uri can be adapted for this content model and false otherwise.
-
getIdentifiers
public Collection<ContentModelProvider.Identifier> getIdentifiers(DOMDocument xmlDocument, String namespaceURI)
Description copied from interface:ContentModelProviderReturns the identifiers list from the given document and namespace.- Specified by:
getIdentifiersin interfaceContentModelProvider- Parameters:
xmlDocument- the DOM document.namespaceURI- the namespace.- Returns:
- the identifiers list from the given document and namespace.
-
createCMDocument
public CMDocument createCMDocument(String uri, boolean resolveExternalEntities)
Description copied from interface:ContentModelProviderCreate content model document (XSD, DTD, etc) from the given resource key and null otherwise.- Specified by:
createCMDocumentin interfaceContentModelProvider- Parameters:
uri- the resource key.resolveExternalEntities- true if external entities can be resolved and false otherwise.- Returns:
- the content model document (XSD, DTD, etc) from the given resource key and null otherwise.
-
createInternalCMDocument
public CMDocument createInternalCMDocument(DOMDocument xmlDocument, boolean resolveExternalEntities)
Description copied from interface:ContentModelProviderCreate the internal content model (for DOCTYPE subset) from the given DOM document.- Specified by:
createInternalCMDocumentin interfaceContentModelProvider- Parameters:
xmlDocument- the DOM document.resolveExternalEntities- true if external entities can be resolved and false otherwise.- Returns:
- the internal content model (for DOCTYPE subset) from the given DOM document.
-
-