public class ContentModelManager extends Object
Constructor and Description |
---|
ContentModelManager(URIResolverExtensionManager resolverManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
dependsOnGrammar(DOMDocument document,
String grammarURI)
Returns true if the given document is linked to the given grammar URI (XML
Schema, DTD) and false otherwise.
|
void |
evictCache()
Remove the cache directory (.lemminx/cache) if it exists and clear the Xerces
grammar cache which stores the XSD, DTD grammars.
|
void |
evictCacheFor(DOMDocument document)
Remove the referenced grammar from the given document and clear the Xerces
grammar cache which stores the XSD, DTD grammar.
|
Collection<CMDocument> |
findCMDocument(DOMDocument xmlDocument,
String namespaceURI) |
Collection<CMDocument> |
findCMDocument(DOMDocument xmlDocument,
String namespaceURI,
boolean withInternal)
Returns the declared documents which match the given DOM document.
|
Collection<CMDocument> |
findCMDocument(DOMElement element)
Returns the owner document of the declared element which matches the given
XML element and null otherwise.
|
Collection<CMDocument> |
findCMDocument(DOMElement element,
String namespaceURI)
Returns the owner document of the declared element which matches the given
XML element and null otherwise.
|
org.apache.xerces.xni.grammars.XMLGrammarPool |
getGrammarPool() |
ContentModelProvider |
getModelProviderByURI(String uri)
Returns the model provider by the given uri and null otherwise.
|
Set<ReferencedGrammarInfo> |
getReferencedGrammarInfos(DOMDocument document)
Returns informations about all referenced grammar (XSD, DTD) from the given
DOM document.
|
void |
refreshCatalogs()
Refresh the XML catalogs.
|
void |
registerModelProvider(ContentModelProvider modelProvider) |
boolean |
setCatalogs(String[] catalogs)
Set up XML catalogs.
|
boolean |
setFileAssociations(XMLFileAssociation[] fileAssociations)
Set file associations.
|
void |
setRootURI(String rootUri) |
void |
setUseCache(boolean useCache) |
void |
unregisterModelProvider(ContentModelProvider modelProvider) |
public ContentModelManager(URIResolverExtensionManager resolverManager)
public Collection<CMDocument> findCMDocument(DOMElement element)
element
- the XML elementpublic Collection<CMDocument> findCMDocument(DOMElement element, String namespaceURI)
element
- the XML elementpublic Collection<CMDocument> findCMDocument(DOMDocument xmlDocument, String namespaceURI)
public Collection<CMDocument> findCMDocument(DOMDocument xmlDocument, String namespaceURI, boolean withInternal)
xmlDocument
- the DOM document.namespaceURI
- the namespace URIpublic boolean dependsOnGrammar(DOMDocument document, String grammarURI)
document
- the DOM documentgrammarURI
- the grammar URIpublic Set<ReferencedGrammarInfo> getReferencedGrammarInfos(DOMDocument document)
In other words, it gives information about
document
- the DOM document.public ContentModelProvider getModelProviderByURI(String uri)
uri
- the grammar URIpublic boolean setCatalogs(String[] catalogs)
catalogs
- list of XML catalog files.public void refreshCatalogs()
public boolean setFileAssociations(XMLFileAssociation[] fileAssociations)
fileAssociations
- public void setRootURI(String rootUri)
public void setUseCache(boolean useCache)
public void evictCacheFor(DOMDocument document) throws IOException
document
- the DOM documentIOException
- if the delete of grammar file cannot be done.public void evictCache() throws IOException
IOException
- if the delete of directory (.lemminx/cache) cannot be
done.public void registerModelProvider(ContentModelProvider modelProvider)
public void unregisterModelProvider(ContentModelProvider modelProvider)
public org.apache.xerces.xni.grammars.XMLGrammarPool getGrammarPool()
Copyright © 2021. All rights reserved.