|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.knime.core.node.config.XMLContentHandler
class XMLContentHandler
Utility class to handle SAX events while parsing the xml file.
Constructor Summary | |
---|---|
XMLContentHandler(Config config,
String fileName)
Creates new instance. |
Method Summary | |
---|---|
(package private) static void |
asXML(Config c,
ContentHandler handler)
Utility method that writes the given config object to a content handler. |
void |
characters(char[] ch,
int start,
int length)
|
void |
endElement(String uri,
String localName,
String qName)
|
void |
error(SAXParseException e)
|
(package private) static String |
escape(String s)
Escapes all forbidden XML characters so that we can save them nevertheless. |
void |
fatalError(SAXParseException e)
|
InputSource |
resolveEntity(String publicId,
String systemId)
|
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
|
(package private) static String |
unescape(String s)
Unescapes all forbidden XML characters that were previous escaped by escape(String) . |
void |
warning(SAXParseException e)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
XMLContentHandler(Config config, String fileName)
config
- The config object as root of the xml tree, this class adds
sub-entrys to this root node.fileName
- The file name for eventual error messages.Method Detail |
---|
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
public void error(SAXParseException e) throws SAXException
error
in interface ErrorHandler
error
in class DefaultHandler
SAXException
public void warning(SAXParseException e) throws SAXException
warning
in interface ErrorHandler
warning
in class DefaultHandler
SAXException
public void fatalError(SAXParseException e) throws SAXException
fatalError
in interface ErrorHandler
fatalError
in class DefaultHandler
SAXException
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException
resolveEntity
in interface EntityResolver
resolveEntity
in class DefaultHandler
IOException
SAXException
static void asXML(Config c, ContentHandler handler) throws SAXException
c
- The config to write, must not be null
.handler
- To write to.
SAXException
- If that fails.static final String escape(String s)
s
- the string to escape
static final String unescape(String s)
escape(String)
. Must pay attention to handle not escaped
strings for backward compatibility (it will not correctly handle them,
they still are unescaped, but it must not fail on those strings).
s
- the escaped string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |