public class CompletionXMLParser extends DefaultHandler
CompletionXml.dtd
DTD
found in this package.Constructor and Description |
---|
CompletionXMLParser(CompletionProvider provider)
Constructor.
|
CompletionXMLParser(CompletionProvider provider,
ClassLoader cl)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length)
Called when character data inside an element is found.
|
void |
endElement(String uri,
String localName,
String qName)
Called when an element is closed.
|
void |
error(SAXParseException e) |
List<Completion> |
getCompletions()
Returns the completions found after parsing the XML.
|
char |
getParamEndChar()
Returns the parameter end character specified.
|
String |
getParamSeparator()
Returns the parameter end string specified.
|
char |
getParamStartChar()
Returns the parameter start character specified.
|
void |
reset(CompletionProvider provider)
Resets this parser to grab more completions.
|
InputSource |
resolveEntity(String publicID,
String systemID) |
static void |
setDefaultCompletionClassLoader(ClassLoader cl)
Sets the class loader to use when loading custom classes to use for
various
Completion types, such as FunctionCompletion s,
from XML. |
void |
startElement(String uri,
String localName,
String qName,
Attributes attrs)
Called when an element starts.
|
void |
warning(SAXParseException e) |
endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl
public CompletionXMLParser(CompletionProvider provider)
provider
- The provider to get completions for.reset(CompletionProvider)
public CompletionXMLParser(CompletionProvider provider, ClassLoader cl)
provider
- The provider to get completions for.cl
- The class loader to use, if necessary, when loading classes
from the XML (custom FunctionCompletion
s, for example).
This may be null
if the default is to be used, or
if the XML does not define specific classes for completion types.reset(CompletionProvider)
public void characters(char[] ch, int start, int length)
characters
in interface ContentHandler
characters
in class DefaultHandler
public void endElement(String uri, String localName, String qName)
endElement
in interface ContentHandler
endElement
in class DefaultHandler
public void error(SAXParseException e) throws SAXException
error
in interface ErrorHandler
error
in class DefaultHandler
SAXException
public List<Completion> getCompletions()
public char getParamEndChar()
public String getParamSeparator()
null
if none was specified.public char getParamStartChar()
public void reset(CompletionProvider provider)
provider
- The new provider to get completions for.public InputSource resolveEntity(String publicID, String systemID) throws SAXException
resolveEntity
in interface EntityResolver
resolveEntity
in class DefaultHandler
SAXException
public static void setDefaultCompletionClassLoader(ClassLoader cl)
Completion
types, such as FunctionCompletion
s,
from XML.Users should very rarely have a need to use this method.
cl
- The class loader to use. If this is null
, then
a default is used.public void startElement(String uri, String localName, String qName, Attributes attrs)
startElement
in interface ContentHandler
startElement
in class DefaultHandler
public void warning(SAXParseException e) throws SAXException
warning
in interface ErrorHandler
warning
in class DefaultHandler
SAXException