public abstract class NodeFormaterImpl<T extends Document<N>,N extends Node<N>> extends Object implements NodeFormater<N,T>
Constructor and Description |
---|
NodeFormaterImpl() |
Modifier and Type | Method and Description |
---|---|
String |
format(N node)
格式化结点
|
void |
format(N node,
OutputStream out)
格式化结点 并在指定的输出流中输出
|
String |
format(T doc)
格式化文档
|
void |
format(T doc,
OutputStream out)
格式化文档 并在指定的输出流中输出
|
protected abstract StringBuffer |
formatDocumentSelf(T doc) |
protected abstract void |
formatDocumentSelf(T doc,
OutputStream out) |
protected void |
formatNode(N node,
OutputStream out,
int tab) |
protected void |
formatNode(StringBuffer sb,
N node,
int tab) |
String |
getEncode() |
String |
getIndentString()
获取缩进字符
|
String |
getIndentString(int tab)
获取指定数量的缩进字符
|
void |
setEncode(String encode) |
void |
setIndentString(String indentString)
设置缩进字符
|
public String getEncode()
public void setEncode(String encode)
public String getIndentString()
public void setIndentString(String indentString)
indentString
- public String getIndentString(int tab)
tab
- protected abstract StringBuffer formatDocumentSelf(T doc)
protected abstract void formatDocumentSelf(T doc, OutputStream out) throws IOException
IOException
protected void formatNode(StringBuffer sb, N node, int tab)
protected void formatNode(N node, OutputStream out, int tab) throws IOException
IOException
public void format(N node, OutputStream out) throws IOException
format
in interface NodeFormater<N extends Node<N>,T extends Document<N>>
node
- out
- IOException
public void format(T doc, OutputStream out) throws IOException
format
in interface NodeFormater<N extends Node<N>,T extends Document<N>>
doc
- out
- IOException
Copyright © 2006–2018 TinyGroup. All rights reserved.