|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.xml.serializer.SerializerBase
org.apache.xml.serializer.ToSAXHandler
This class is used to provide a base behavior to be inherited by other To...SAXHandler serializers. This class is not a public API.
| Field Summary |
| Fields inherited from class org.apache.xml.serializer.SerializerBase |
CDATA_CONTINUE, CDATA_DELIMITER_CLOSE, CDATA_DELIMITER_OPEN, DEFAULT_SAX_SERIALIZER, EMPTYSTRING, ENTITY_AMP, ENTITY_CRLF, ENTITY_GT, ENTITY_LT, ENTITY_QUOT, XML_PREFIX, XMLNS_PREFIX, XMLNS_URI, XMLVERSION10, XMLVERSION11 |
| Fields inherited from interface org.apache.xml.serializer.SerializationHandler |
HTML_ATTREMPTY, HTML_ATTRURL, NO_BAD_CHARS |
| Constructor Summary | |
ToSAXHandler()
|
|
ToSAXHandler(ContentHandler hdlr,
LexicalHandler lex,
String encoding)
|
|
ToSAXHandler(ContentHandler handler,
String encoding)
|
|
| Method Summary | |
void |
addUniqueAttribute(String qName,
String value,
int flags)
Add a unique attribute |
void |
characters(Node node)
This method gets the node's value as a String and uses that String as if it were an input character notification. |
void |
characters(String characters)
Receive notification of character data. |
void |
comment(String comment)
Receive notification of a comment. |
void |
error(SAXParseException exc)
|
void |
fatalError(SAXParseException exc)
|
void |
flushPending()
This method flushes any pending events, which can be startDocument() closing the opening tag of an element, or closing an open CDATA section. |
void |
processingInstruction(String target,
String data)
Do nothing as this is an abstract class. |
boolean |
reset()
Try's to reset the super class and reset this class for re-use, so that you don't need to create a new serializer (mostly for performance reasons). |
void |
setCdataSectionElements(Vector URI_and_localNames)
Does nothing. |
void |
setContentHandler(ContentHandler _saxHandler)
Sets the SAX ContentHandler. |
void |
setLexHandler(LexicalHandler _lexHandler)
Sets the LexicalHandler. |
void |
setShouldOutputNSAttr(boolean doOutputNSAttr)
Set whether or not namespace declarations (e.g. |
void |
setTransformState(TransformStateSetter ts)
Pass in a reference to a TransformState object, which can be used during SAX ContentHandler events to obtain information about he state of the transformation. |
void |
startDTD(String arg0,
String arg1,
String arg2)
Do nothing. |
void |
startElement(String qName)
An element starts, but attributes are not fully known yet. |
void |
startElement(String uri,
String localName,
String qName)
Receives notification that an element starts, but attributes are not fully known yet. |
void |
startElement(String arg0,
String arg1,
String arg2,
Attributes arg3)
Receive notification of the beginning of an element, although this is a SAX method additional namespace or attribute information can occur before or after this call, that is associated with this element. |
void |
warning(SAXParseException exc)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.xml.serializer.SerializationHandler |
endElement, serialize, setEscaping, startPrefixMapping |
| Methods inherited from interface org.xml.sax.ContentHandler |
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, skippedEntity, startPrefixMapping |
| Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, startCDATA, startEntity |
| Methods inherited from interface org.xml.sax.ext.DeclHandler |
attributeDecl, elementDecl, externalEntityDecl, internalEntityDecl |
| Methods inherited from interface org.apache.xml.serializer.Serializer |
getOutputFormat, getOutputStream, getWriter, setOutputFormat, setOutputStream, setWriter |
| Constructor Detail |
public ToSAXHandler()
public ToSAXHandler(ContentHandler hdlr,
LexicalHandler lex,
String encoding)
public ToSAXHandler(ContentHandler handler,
String encoding)
| Method Detail |
public void startDTD(String arg0,
String arg1,
String arg2)
throws SAXException
SAXExceptionLexicalHandler.startDTD(String, String, String)
public void characters(String characters)
throws SAXException
characters - The string of characters to process.
SAXExceptionExtendedContentHandler#characters(String)
public void comment(String comment)
throws SAXException
comment in interface org.apache.xml.serializer.ExtendedLexicalHandlercomment in class SerializerBaseSAXExceptionExtendedLexicalHandler#comment(String)
public void processingInstruction(String target,
String data)
throws SAXException
SAXExceptionContentHandler.processingInstruction(String, String)
public void startElement(String arg0,
String arg1,
String arg2,
Attributes arg3)
throws SAXException
SAXException - Any SAX exception, possibly
wrapping another exception.
SAXExceptionContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes),
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String),
AttributeList,
ContentHandler.startElement(String,String,String,Attributes)public void setLexHandler(LexicalHandler _lexHandler)
_lexHandler - The LexicalHandler to setpublic void setContentHandler(ContentHandler _saxHandler)
_saxHandler - The ContentHandler to setSerializer.asContentHandler(),
ToSAXHandlerpublic void setCdataSectionElements(Vector URI_and_localNames)
URI_and_localNames - pairs of namespace URI and local names that
identify elements whose text elements are to be output as CDATA sections.
The namespace of the local element must be the given URI to match. The
qName is not given because the prefix does not matter, only the namespace
URI to which that prefix would map matters, so the prefix itself is not
relevant in specifying which elements have their text to be output as
CDATA sections.XSLOutputAttributes.setCdataSectionElements(java.util.Vector)public void setShouldOutputNSAttr(boolean doOutputNSAttr)
doOutputNSAttr - whether or not namespace declarations
should appear as attributes
public void flushPending()
throws SAXException
SAXExceptionpublic void setTransformState(TransformStateSetter ts)
ts - A reference to a TransformState object
public void startElement(String uri,
String localName,
String qName)
throws SAXException
uri - the URI of the namespace of the element (optional)localName - the element name, but without prefix (optional)qName - the element name, with prefix, if any (required)
SAXExceptionExtendedContentHandler#startElement(String, String, String)
public void startElement(String qName)
throws SAXException
qName - the element name, with prefix (if any).
SAXExceptionExtendedContentHandler#startElement(String)
public void characters(Node node)
throws SAXException
characters in interface org.apache.xml.serializer.ExtendedContentHandlercharacters in class SerializerBasenode - the Node to serialize
SAXException
public void fatalError(SAXParseException exc)
throws SAXException
fatalError in interface ErrorHandlerfatalError in class SerializerBaseSAXExceptionErrorHandler.fatalError(SAXParseException)
public void error(SAXParseException exc)
throws SAXException
error in interface ErrorHandlererror in class SerializerBaseSAXExceptionErrorHandler.error(SAXParseException)
public void warning(SAXParseException exc)
throws SAXException
warning in interface ErrorHandlerwarning in class SerializerBaseSAXExceptionErrorHandler.warning(SAXParseException)public boolean reset()
reset in interface Serializerreset in class SerializerBaseSerializer.reset()
public void addUniqueAttribute(String qName,
String value,
int flags)
throws SAXException
qName - the fully qualified attribute name.value - the attribute valueflags - a bitwise flag
SAXException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||