Package org.fife.ui.autocomplete
Class CompletionXMLParser
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.fife.ui.autocomplete.CompletionXMLParser
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
Parser for an XML file describing a procedural language such as C. XML
files will be validated against the
CompletionXml.dtd DTD
found in this package.-
Constructor Summary
ConstructorsConstructorDescriptionCompletionXMLParser(CompletionProvider provider) Constructor.CompletionXMLParser(CompletionProvider provider, ClassLoader cl) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Called when character data inside an element is found.voidendElement(String uri, String localName, String qName) Called when an element is closed.voidReturns the completions found after parsing the XML.charReturns the parameter end character specified.Returns the parameter end string specified.charReturns the parameter start character specified.voidreset(CompletionProvider provider) Resets this parser to grab more completions.resolveEntity(String publicID, String systemID) static voidSets the class loader to use when loading custom classes to use for variousCompletiontypes, such asFunctionCompletions, from XML.voidstartElement(String uri, String localName, String qName, Attributes attrs) Called when an element starts.voidMethods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDeclMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
CompletionXMLParser
Constructor.- Parameters:
provider- The provider to get completions for.- See Also:
-
CompletionXMLParser
Constructor.- Parameters:
provider- The provider to get completions for.cl- The class loader to use, if necessary, when loading classes from the XML (customFunctionCompletions, for example). This may benullif the default is to be used, or if the XML does not define specific classes for completion types.- See Also:
-
-
Method Details
-
characters
public void characters(char[] ch, int start, int length) Called when character data inside an element is found.- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler
-
endElement
Called when an element is closed.- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler
-
error
- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Throws:
SAXException
-
getCompletions
Returns the completions found after parsing the XML.- Returns:
- The completions.
-
getParamEndChar
public char getParamEndChar()Returns the parameter end character specified.- Returns:
- The character, or 0 if none was specified.
-
getParamSeparator
Returns the parameter end string specified.- Returns:
- The string, or
nullif none was specified.
-
getParamStartChar
public char getParamStartChar()Returns the parameter start character specified.- Returns:
- The character, or 0 if none was specified.
-
reset
Resets this parser to grab more completions.- Parameters:
provider- The new provider to get completions for.
-
resolveEntity
- Specified by:
resolveEntityin interfaceEntityResolver- Overrides:
resolveEntityin classDefaultHandler
-
setDefaultCompletionClassLoader
Sets the class loader to use when loading custom classes to use for variousCompletiontypes, such asFunctionCompletions, from XML.Users should very rarely have a need to use this method.
- Parameters:
cl- The class loader to use. If this isnull, then a default is used.
-
startElement
Called when an element starts.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler
-
warning
- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classDefaultHandler- Throws:
SAXException
-