|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.actf.util.dom.DomPrintUtil
public class DomPrintUtil
Utility class to print out DOM
| Nested Class Summary | |
|---|---|
static interface |
DomPrintUtil.AttributeFilter
AttributeFilter defines the behavior of a filter that is used for converting attributes of each Element into String. |
| Field Summary | |
|---|---|
static String |
UTF8
Default encoding of this utility. |
| Constructor Summary | |
|---|---|
DomPrintUtil(Document document)
Constructor of DOM print utility. |
|
| Method Summary | |
|---|---|
void |
setAttrFilter(DomPrintUtil.AttributeFilter attrFilter)
Set AttributeFilter to define the behavior for printing attributes of each Element. |
void |
setEntityReferenceExpansion(boolean entityReferenceExpansion)
Set the entity reference expansion flag to TreeWalker used in the utility. |
void |
setEscapeTagBracket(boolean escapeTagBracket)
Determine to escape Tag bracket ('<','>') or not. |
void |
setIndent(boolean indent)
Set the number of space characters used for indent |
void |
setNodeFilter(org.w3c.dom.traversal.NodeFilter nodeFilter)
Set NodeFilter to TreeWalker used in the utility. |
void |
setWhatToShow(int whatToShow)
Set whatToShow attribute to TreeWalker used in the utility. |
String |
toString()
|
String |
toXMLString()
Returns XML text converted from the target DOM |
void |
writeToFile(File file)
Print out the target Document. |
void |
writeToFile(File file,
String encode)
Print out the target Document in specified encoding |
void |
writeToFile(String filePath)
Print out the target Document. |
void |
writeToFile(String filePath,
String encode)
Print out the target Document in specified encoding |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String UTF8
| Constructor Detail |
|---|
public DomPrintUtil(Document document)
document - the target document| Method Detail |
|---|
public String toXMLString()
public String toString()
toString in class Objectpublic void setWhatToShow(int whatToShow)
whatToShow - the attribute determines which types of node are presented via
the TreeWalker. The values are defined in the NodeFilter
interface.TreeWalkerImplpublic void setNodeFilter(org.w3c.dom.traversal.NodeFilter nodeFilter)
nodeFilter - the filter used to screen nodesTreeWalkerImplpublic void setEntityReferenceExpansion(boolean entityReferenceExpansion)
entityReferenceExpansion - the flag to determine whether the children of entity reference
nodes are visible to TreeWalker.TreeWalkerImplpublic void setIndent(boolean indent)
indent - the number of space characters used for indentpublic void setEscapeTagBracket(boolean escapeTagBracket)
escapeTagBracket - if true, print Tag bracket as escaped format ('<',
'>')public void setAttrFilter(DomPrintUtil.AttributeFilter attrFilter)
attrFilter - the AttributeFilter to set
public void writeToFile(String filePath)
throws IOException
filePath - the target file path
IOException
public void writeToFile(File file)
throws IOException
file - the target File
IOException
public void writeToFile(String filePath,
String encode)
throws IOException
filePath - the target file pathencode - the target encoding
IOException
public void writeToFile(File file,
String encode)
throws IOException
file - the target fileencode - the target encoding
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||