|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.joost.emitter.StxEmitterBase
net.sf.joost.emitter.StreamEmitter
net.sf.joost.emitter.XmlEmitter
public class XmlEmitter
This class implements an emitter that uses the xml
output
method for byte or character streams.
Field Summary | |
---|---|
private boolean |
disabledOutputEscaping
flag indicating if disabled output escaping is active |
private boolean |
insideCDATA
flag indicating if we're within a CDATA section |
private Attributes |
lastAttrs
attributes of the previous element |
private String |
lastQName
qName of the previous element |
private static org.apache.commons.logging.Log |
log
|
private StringBuffer |
nsDeclarations
string buffer for namespace declarations |
private boolean |
propOmitXmlDeclaration
output property: omit-xml-declaration |
private boolean |
propStandalone
output property: standalone |
private String |
propVersion
output property: version |
private boolean |
supportDisableOutputEscaping
flag indicating if disable output escaping will be supported |
Fields inherited from class net.sf.joost.emitter.StreamEmitter |
---|
charsetEncoder, encoding, writer |
Fields inherited from interface net.sf.joost.Constants |
---|
DEBUG, DEFAULT_ENCODING, FEAT_NS, FEAT_NSPREFIX, FEATURE_URI_PREFIX, FUNC_NS, JOOST_EXT_NS, PR_ATTRIBUTES, PR_BUFFER, PR_CHILDREN, PR_CONTINUE, PR_ERROR, PR_SELF, PR_SIBLINGS, STX_NS |
Constructor Summary | |
---|---|
XmlEmitter(Writer writer,
String encoding,
Properties outputProperties)
Constructor |
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
SAX2-Callback - Constructs characters. |
void |
comment(char[] ch,
int start,
int length)
SAX2-Callback - Outputs a comment |
void |
endCDATA()
SAX2-Callback - Notify the end of a CDATA section |
void |
endDocument()
SAX2-Callback - Flushes the output writer |
void |
endElement(String uri,
String lName,
String qName)
SAX2-Callback - Outputs the element-tag. |
void |
processingInstruction(String target,
String data)
SAX2-Callback - Outputs a PI |
private boolean |
processLastElement(boolean end)
Outputs a start or empty element tag if there is one stored. |
void |
setOmitXmlDeclaration(boolean flag)
Defines whether the XML declaration should be omitted, default is false . |
void |
setSupportDisableOutputEscaping(boolean flag)
Defines whether disable-output-escaping will be supported (means whether the corresponding processing instructions Result.PI_DISABLE_OUTPUT_ESCAPING and
Result.PI_ENABLE_OUTPUT_ESCAPING will be interpreted). |
void |
startCDATA()
SAX2-Callback - Notify the start of a CDATA section |
void |
startDocument()
SAX2-Callback - Outputs XML-Deklaration with encoding. |
void |
startDTD(String name,
String publicId,
String systemId)
SAX2-Callback - Outputs a document type declaration |
void |
startElement(String uri,
String lName,
String qName,
Attributes attrs)
SAX2-Callback |
void |
startPrefixMapping(String prefix,
String uri)
SAX2-Callback |
Methods inherited from class net.sf.joost.emitter.StreamEmitter |
---|
encodeCharacters, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, newEmitter, newEmitter, newEmitter, newXMLEmitter, setDocumentLocator, skippedEntity, startEntity |
Methods inherited from class net.sf.joost.emitter.StxEmitterBase |
---|
getSystemId, setSystemId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static org.apache.commons.logging.Log log
private boolean propOmitXmlDeclaration
private boolean propStandalone
private String propVersion
private StringBuffer nsDeclarations
private String lastQName
private Attributes lastAttrs
private boolean insideCDATA
private boolean supportDisableOutputEscaping
private boolean disabledOutputEscaping
Constructor Detail |
---|
public XmlEmitter(Writer writer, String encoding, Properties outputProperties)
Method Detail |
---|
public void setOmitXmlDeclaration(boolean flag)
false
.
setOmitXmlDeclaration
in class StreamEmitter
flag
- true
: the XML declaration will be omitted;
false
: the XML declaration will be outputpublic void setSupportDisableOutputEscaping(boolean flag)
Result.PI_DISABLE_OUTPUT_ESCAPING
and
Result.PI_ENABLE_OUTPUT_ESCAPING
will be interpreted).
The default is false
setSupportDisableOutputEscaping
in class StreamEmitter
flag
- true
the PIs will be interpreted;
false
the PIs will be written literallyprivate boolean processLastElement(boolean end) throws SAXException
end
- true if this method was called due to an endElement event,
i.e. an empty element tag has to be output.
SAXException
public void startDocument() throws SAXException
SAXException
public void endDocument() throws SAXException
SAXException
public void startElement(String uri, String lName, String qName, Attributes attrs) throws SAXException
SAXException
public void endElement(String uri, String lName, String qName) throws SAXException
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class StreamEmitter
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
processingInstruction
in class StreamEmitter
SAXException
public void startCDATA() throws SAXException
startCDATA
in interface LexicalHandler
startCDATA
in class StreamEmitter
SAXException
public void endCDATA() throws SAXException
endCDATA
in interface LexicalHandler
endCDATA
in class StreamEmitter
SAXException
public void comment(char[] ch, int start, int length) throws SAXException
comment
in interface LexicalHandler
comment
in class StreamEmitter
SAXException
public void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD
in interface LexicalHandler
startDTD
in class StreamEmitter
SAXException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |