Class LSPXMLGrammarPoolWrapper
java.lang.Object
org.eclipse.lemminx.extensions.contentmodel.participants.diagnostics.LSPXMLGrammarPool
org.eclipse.lemminx.extensions.contentmodel.participants.diagnostics.LSPXMLGrammarPoolWrapper
- All Implemented Interfaces:
org.apache.xerces.xni.grammars.XMLGrammarPool
Xerces grammar pool which tracks all DTD grammars which are cached for an XML
validation.
- Author:
- Angelo ZERR
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.lemminx.extensions.contentmodel.participants.diagnostics.LSPXMLGrammarPool
LSPXMLGrammarPool.Entry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcacheGrammars(String grammarType, org.apache.xerces.xni.grammars.Grammar[] grammars) voidclear()Clear the cached grammar.booleanbooleanequals(org.apache.xerces.xni.grammars.XMLGrammarDescription desc1, org.apache.xerces.xni.grammars.XMLGrammarDescription desc2) This method checks whether two grammars are the same.inthashCode()inthashCode(org.apache.xerces.xni.grammars.XMLGrammarDescription desc) Returns the hash code value for the given grammar description.voidlockPool()voidremoveGrammar(String grammarURI) org.apache.xerces.xni.grammars.GrammarremoveGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription desc) Removes the grammar associated to the specified grammar description from the grammar pool and returns the removed grammar.org.apache.xerces.xni.grammars.GrammarretrieveGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription desc) org.apache.xerces.xni.grammars.Grammar[]retrieveInitialGrammarSet(String grammarType) booleansetInternalSubset(org.apache.xerces.impl.dtd.XMLDTDDescription grammarDesc, String internalSubset) Update the DTD internal subset entry for the given XML DTD description and return true if the cached DTD grammar internal subset is equal to the given internal subset and false otherwise.toString()void
-
Constructor Details
-
LSPXMLGrammarPoolWrapper
-
-
Method Details
-
retrieveInitialGrammarSet
- Specified by:
retrieveInitialGrammarSetin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Overrides:
retrieveInitialGrammarSetin classLSPXMLGrammarPool
-
cacheGrammars
- Specified by:
cacheGrammarsin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Overrides:
cacheGrammarsin classLSPXMLGrammarPool
-
hashCode
public int hashCode() -
retrieveGrammar
public org.apache.xerces.xni.grammars.Grammar retrieveGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription desc) - Specified by:
retrieveGrammarin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Overrides:
retrieveGrammarin classLSPXMLGrammarPool
-
removeGrammar
public org.apache.xerces.xni.grammars.Grammar removeGrammar(org.apache.xerces.xni.grammars.XMLGrammarDescription desc) Description copied from class:LSPXMLGrammarPoolRemoves the grammar associated to the specified grammar description from the grammar pool and returns the removed grammar. Currently, the root element name is used as the key for DTD grammars and the target namespace is used as the key for Schema grammars.- Overrides:
removeGrammarin classLSPXMLGrammarPool- Parameters:
desc- The Grammar Description.- Returns:
- The removed grammar.
-
equals
-
removeGrammar
- Overrides:
removeGrammarin classLSPXMLGrammarPool
-
lockPool
public void lockPool()- Specified by:
lockPoolin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Overrides:
lockPoolin classLSPXMLGrammarPool
-
unlockPool
public void unlockPool()- Specified by:
unlockPoolin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Overrides:
unlockPoolin classLSPXMLGrammarPool
-
clear
public void clear()Clear the cached grammar.- Specified by:
clearin interfaceorg.apache.xerces.xni.grammars.XMLGrammarPool- Overrides:
clearin classLSPXMLGrammarPool
-
equals
public boolean equals(org.apache.xerces.xni.grammars.XMLGrammarDescription desc1, org.apache.xerces.xni.grammars.XMLGrammarDescription desc2) Description copied from class:LSPXMLGrammarPoolThis method checks whether two grammars are the same. Currently, we compare the root element names for DTD grammars and the target namespaces for Schema grammars. The application can override this behaviour and add its own logic.- Overrides:
equalsin classLSPXMLGrammarPool- Parameters:
desc1- The grammar descriptiondesc2- The grammar description of the grammar to be compared to- Returns:
- True if the grammars are equal, otherwise false
-
hashCode
public int hashCode(org.apache.xerces.xni.grammars.XMLGrammarDescription desc) Description copied from class:LSPXMLGrammarPoolReturns the hash code value for the given grammar description.- Overrides:
hashCodein classLSPXMLGrammarPool- Parameters:
desc- The grammar description- Returns:
- The hash code value
-
toString
-
setInternalSubset
public boolean setInternalSubset(org.apache.xerces.impl.dtd.XMLDTDDescription grammarDesc, String internalSubset) Description copied from class:LSPXMLGrammarPoolUpdate the DTD internal subset entry for the given XML DTD description and return true if the cached DTD grammar internal subset is equal to the given internal subset and false otherwise.- Overrides:
setInternalSubsetin classLSPXMLGrammarPool- Parameters:
grammarDesc- the XML DTD description.internalSubset- the internal subset.- Returns:
- true if the cached DTD grammar internal subset is equal to the given internal subset and false otherwise.
-