public final class SavingHandler extends Object implements ContentHandler, ParseExceptionHandler
getEvents().ParseExceptionHandler.Impl| Modifier and Type | Field and Description |
|---|---|
static String |
END_OF_DOCUMENT |
private List<String> |
events
The sequence of events taken place so far.
|
static String |
START_OF_DOCUMENT |
private boolean |
strict
Whether to save things like processing instructions as well.
|
| Constructor and Description |
|---|
SavingHandler()
Creates a new
SavingHandler. |
SavingHandler(boolean strict)
Creates a new
SavingHandler instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] chr,
int start,
int length) |
void |
endDocument() |
void |
endElement(String namespaceURI,
String localName,
String qName) |
void |
endPrefixMapping(String prefix) |
void |
foundCharAfterEndOfEndTag(char chr)
Notifies that a character was found after the "/" of an end tag.
|
void |
foundIllegalCharInTag(char chr)
Notifies that an illegal character was found in a tag *****.
|
void |
foundMultipleAttribute(String attrName,
Object oldAttrValue)
Notifies the occurence of a duplicate attribute declaration
within a start tag.
|
void |
foundUnexpectedEndOfDocument() |
List<String> |
getEvents()
Returns the sequence of events taken place so far.
|
void |
ignorableWhitespace(char[] chr,
int start,
int length) |
void |
processingInstruction(String target,
String data) |
void |
setDocumentLocator(Locator locator) |
void |
skippedEntity(String name) |
void |
startDocument() |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts) |
void |
startPrefixMapping(String prefix,
String uri) |
public static final String START_OF_DOCUMENT
public static final String END_OF_DOCUMENT
private boolean strict
public SavingHandler(boolean strict)
SavingHandler instance.strict - a boolean value signifying
whether to save things like processing instructions as well.public SavingHandler()
SavingHandler.public List<String> getEvents()
events.public void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerpublic void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXExceptionpublic void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping in interface ContentHandlerSAXExceptionpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerSAXExceptionpublic void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandlerSAXExceptionpublic void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement in interface ContentHandlerSAXExceptionpublic void characters(char[] chr,
int start,
int length)
throws SAXException
characters in interface ContentHandlerSAXExceptionpublic void ignorableWhitespace(char[] chr,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerSAXExceptionpublic void processingInstruction(String target, String data) throws SAXException
processingInstruction in interface ContentHandlerSAXExceptionpublic void skippedEntity(String name) throws SAXException
skippedEntity in interface ContentHandlerSAXExceptionpublic void foundMultipleAttribute(String attrName, Object oldAttrValue)
ParseExceptionHandlerfoundMultipleAttribute in interface ParseExceptionHandlerattrName - a non-empty String
representing the name of the attribute.oldAttrValue - an Object which is either a String
representing the value of the attribute
or the object AttributesImpl.NO_VALUE
which signifies the absence of a value.
Here the old value (which is overwritten in the attribute list)
should be passed to the application.
****** it is not clear to me
whether the ordering of the attribute list is significant.
The former occurence of the attribute is lost. **** is this true?public void foundIllegalCharInTag(char chr)
ParseExceptionHandlerfoundIllegalCharInTag in interface ParseExceptionHandlerchr - the illegal char value.public void foundCharAfterEndOfEndTag(char chr)
ParseExceptionHandlerfoundCharAfterEndOfEndTag in interface ParseExceptionHandlerchr - the illegal char value.public void foundUnexpectedEndOfDocument()
foundUnexpectedEndOfDocument in interface ParseExceptionHandlerCopyright © 2012–2018 Simuline Organization (l2r). All rights reserved.