|
|||||||||
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.HtmlEmitter
public class HtmlEmitter
This class implements an emitter for html code.
Field Summary | |
---|---|
private boolean |
disabledOutputEscaping
|
private static HashSet |
emptyHTMLElements
Empty HTML 4.01 elements according to http://www.w3.org/TR/1999/REC-html401-19991224/index/elements.html |
private boolean |
insideCDATA
|
private boolean |
propOmitXmlDeclaration
output property: omit-xml-declaration |
private boolean |
supportDisableOutputEscaping
|
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 | |
---|---|
HtmlEmitter(Writer writer,
String encoding)
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()
Does nothing |
void |
endDocument()
SAX2-Callback - Closing OutputStream. |
void |
endElement(String uri,
String lName,
String qName)
SAX2-Callback - Outputs the element-tag. |
void |
processingInstruction(String target,
String data)
SAX2-Callback - Handles a PI (cares about disable-output-escaping) |
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()
CDATA sections will be handled like "disable-output-escaping" in HTML (which is of course a kind of a "hack" ...) |
void |
startDocument()
SAX2-Callback - Outputs XML-Deklaration with encoding. |
void |
startElement(String uri,
String lName,
String qName,
Attributes attrs)
SAX2-Callback |
Methods inherited from class net.sf.joost.emitter.StreamEmitter |
---|
encodeCharacters, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, newEmitter, newEmitter, newEmitter, newXMLEmitter, setDocumentLocator, skippedEntity, startDTD, startEntity, startPrefixMapping |
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 boolean propOmitXmlDeclaration
private boolean insideCDATA
private boolean supportDisableOutputEscaping
private boolean disabledOutputEscaping
private static final HashSet emptyHTMLElements
Constructor Detail |
---|
public HtmlEmitter(Writer writer, String encoding)
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)
StreamEmitter
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 literallypublic 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 comment(char[] ch, int start, int length) throws SAXException
comment
in interface LexicalHandler
comment
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
StreamEmitter
endCDATA
in interface LexicalHandler
endCDATA
in class StreamEmitter
SAXException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |