|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.htmlcleaner.Serializer
public abstract class Serializer
Basic abstract serializer - contains common logic for descendants (methods writeXXX()
.
Field Summary | |
---|---|
protected CleanerProperties |
props
|
Constructor Summary | |
---|---|
protected |
Serializer(CleanerProperties props)
|
Method Summary | |
---|---|
String |
getAsString(String htmlContent)
|
String |
getAsString(TagNode tagNode)
|
String |
getAsString(TagNode tagNode,
boolean omitEnvelope)
|
String |
getAsString(TagNode tagNode,
String charset)
|
String |
getAsString(TagNode tagNode,
String charset,
boolean omitEnvelope)
|
protected boolean |
isScriptOrStyle(TagNode tagNode)
|
protected abstract void |
serialize(TagNode tagNode,
Writer writer)
|
void |
write(TagNode tagNode,
Writer writer,
String charset)
Writes specified node using specified writer. |
void |
write(TagNode tagNode,
Writer writer,
String charset,
boolean omitEnvelope)
Writes specified node using specified writer. |
void |
writeToFile(TagNode tagNode,
String fileName)
Writes specified TagNode to the file, using system default charset. |
void |
writeToFile(TagNode tagNode,
String fileName,
boolean omitEnvelope)
Writes specified TagNode to the file, using specified charset and optionally omits node envelope (skips open and close tags of the node). |
void |
writeToFile(TagNode tagNode,
String fileName,
String charset)
Writes specified TagNode to the file, using specified charset. |
void |
writeToFile(TagNode tagNode,
String fileName,
String charset,
boolean omitEnvelope)
Writes specified TagNode to the file, using specified charset and optionally omits node envelope (skips open and close tags of the node). |
void |
writeToStream(TagNode tagNode,
OutputStream out)
Writes specified TagNode to the output stream, using system default charset. |
void |
writeToStream(TagNode tagNode,
OutputStream out,
boolean omitEnvelope)
Writes specified TagNode to the output stream, using system default charset and optionally omits node envelope (skips open and close tags of the node). |
void |
writeToStream(TagNode tagNode,
OutputStream out,
String charset)
Writes specified TagNode to the output stream, using specified charset. |
void |
writeToStream(TagNode tagNode,
OutputStream out,
String charset,
boolean omitEnvelope)
Writes specified TagNode to the output stream, using specified charset and optionally omits node envelope (skips open and close tags of the node). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected CleanerProperties props
Constructor Detail |
---|
protected Serializer(CleanerProperties props)
Method Detail |
---|
public void writeToStream(TagNode tagNode, OutputStream out, String charset, boolean omitEnvelope) throws IOException
tagNode
- Node to be writtenout
- Output streamcharset
- Charset of the outputomitEnvelope
- Tells whether to skip open and close tag of the node.
IOException
public void writeToStream(TagNode tagNode, OutputStream out, String charset) throws IOException
tagNode
- Node to be writtenout
- Output streamcharset
- Charset of the output
IOException
public void writeToStream(TagNode tagNode, OutputStream out, boolean omitEnvelope) throws IOException
tagNode
- Node to be writtenout
- Output streamomitEnvelope
- Tells whether to skip open and close tag of the node.
IOException
public void writeToStream(TagNode tagNode, OutputStream out) throws IOException
tagNode
- Node to be writtenout
- Output stream
IOException
public void writeToFile(TagNode tagNode, String fileName, String charset, boolean omitEnvelope) throws IOException
tagNode
- Node to be writtenfileName
- Output file namecharset
- Charset of the outputomitEnvelope
- Tells whether to skip open and close tag of the node.
IOException
public void writeToFile(TagNode tagNode, String fileName, String charset) throws IOException
tagNode
- Node to be writtenfileName
- Output file namecharset
- Charset of the output
IOException
public void writeToFile(TagNode tagNode, String fileName, boolean omitEnvelope) throws IOException
tagNode
- Node to be writtenfileName
- Output file nameomitEnvelope
- Tells whether to skip open and close tag of the node.
IOException
public void writeToFile(TagNode tagNode, String fileName) throws IOException
tagNode
- Node to be writtenfileName
- Output file name
IOException
public String getAsString(TagNode tagNode, String charset, boolean omitEnvelope)
tagNode
- Node to serialize to stringcharset
- Charset of the output - stands in xml declaration partomitEnvelope
- Tells whether to skip open and close tag of the node.
public String getAsString(TagNode tagNode, String charset)
tagNode
- Node to serialize to stringcharset
- Charset of the output - stands in xml declaration part
public String getAsString(TagNode tagNode, boolean omitEnvelope)
tagNode
- Node to serialize to stringomitEnvelope
- Tells whether to skip open and close tag of the node.
IOException
public String getAsString(TagNode tagNode)
tagNode
- Node to serialize to string
IOException
public String getAsString(String htmlContent)
public void write(TagNode tagNode, Writer writer, String charset) throws IOException
tagNode
- Node to serialize.writer
- Writer instancecharset
- Charset of the output
IOException
public void write(TagNode tagNode, Writer writer, String charset, boolean omitEnvelope) throws IOException
tagNode
- Node to serialize.writer
- Writer instancecharset
- Charset of the outputomitEnvelope
- Tells whether to skip open and close tag of the node.
IOException
protected boolean isScriptOrStyle(TagNode tagNode)
protected abstract void serialize(TagNode tagNode, Writer writer) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |