Package eu.bandm.tools.util
Class SaxDumper
java.lang.Object
eu.bandm.tools.util.SaxDumper
- All Implemented Interfaces:
ContentHandler
A
ContentHandler
which dumps all sax events for debugging purpose.-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructor which sets the target of the print output to System.errx.SaxDumper
(@Opt PrintStream out) Constructor which sets the target of the print output or takes System.err in case of null. -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) static String
dumpAttributes
(Attributes atts) Delivers a string representation of a Sax attribute object.void
void
endElement
(String uri, String localName, String qName) void
endPrefixMapping
(String prefix) void
ignorableWhitespace
(char[] ch, int start, int end) protected void
Aux method which makes a line feed and flushes the output, for ease of debugging in multi-thread contexts.void
processingInstruction
(String target, String data) void
setDocumentLocator
(Locator locator) void
skippedEntity
(String name) void
void
startElement
(String uri, String localName, String qName, Attributes attrs) void
startPrefixMapping
(String prefix, String uri) protected void
Aux method which prints the given chars framed by>>..<<
and linefeeds and flushes the output.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
out
The target of the print output.
-
-
Constructor Details
-
SaxDumper
Constructor which sets the target of the print output or takes System.err in case of null. -
SaxDumper
public SaxDumper()Constructor which sets the target of the print output to System.errx.
-
-
Method Details
-
dumpAttributes
Delivers a string representation of a Sax attribute object. Each entry gets one text line (separated byPrintWriter_limited.LS
) with form
{uri!=null}name:type:value
or
name:type:value
where name=getQName(i) if not empty, otherwise getLocalName(),
type = getType(i) and value=getValue(i).A SAX "
Attributes
" is a mere technical device with no mathematical "set" semantics: The SAX specification does not forbid that these are de-normalized and do not represent a valid XML data model. -
PRL
Aux method which makes a line feed and flushes the output, for ease of debugging in multi-thread contexts. -
x_chars
Aux method which prints the given chars framed by>>..<<
and linefeeds and flushes the output. -
characters
public void characters(char[] ch, int start, int length) - Specified by:
characters
in interfaceContentHandler
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int end) - Specified by:
ignorableWhitespace
in interfaceContentHandler
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
-
skippedEntity
- Specified by:
skippedEntity
in interfaceContentHandler
-
startDocument
public void startDocument()- Specified by:
startDocument
in interfaceContentHandler
-
startElement
- Specified by:
startElement
in interfaceContentHandler
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
-