Package eu.bandm.tools.util.xml
Class SaxDumper
java.lang.Object
eu.bandm.tools.util.xml.SaxDumper
- All Implemented Interfaces:
ContentHandler
A
ContentHandler which dumps all sax events for debugging purpose.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor 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 TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) static StringdumpAttributes(Attributes atts) Delivers a string representation of a Sax attribute object.voidvoidendElement(String uri, String localName, String qName) voidendPrefixMapping(String prefix) voidignorableWhitespace(char[] ch, int start, int end) protected voidAux method which makes a line feed and flushes the output, for ease of debugging in multi-thread contexts.voidprocessingInstruction(String target, String data) voidsetDocumentLocator(Locator locator) voidskippedEntity(String name) voidvoidstartElement(String uri, String localName, String qName, Attributes attrs) voidstartPrefixMapping(String prefix, String uri) protected voidAux 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, waitMethods 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:valueor
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:
charactersin interfaceContentHandler
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int end) - Specified by:
ignorableWhitespacein interfaceContentHandler
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler
-
startDocument
public void startDocument()- Specified by:
startDocumentin interfaceContentHandler
-
startElement
- Specified by:
startElementin interfaceContentHandler
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler
-