org.tinygroup.xmlparser.document
Class XmlDocumentImpl

java.lang.Object
  extended by org.tinygroup.xmlparser.document.XmlDocumentImpl
All Implemented Interfaces:
Document<XmlNode>, XmlDocument

public class XmlDocumentImpl
extends Object
implements XmlDocument


Constructor Summary
XmlDocumentImpl()
           
 
Method Summary
 void addComment(XmlNode node)
          添加注释
 void addDoctype(XmlNode node)
          添加CDATA文本
 void addProcessingInstruction(XmlNode node)
          添加XML处理指令
 List<XmlNode> getCommentList()
          获取Xml注释
 List<XmlNode> getDoctypeList()
          获取CDATA部分
 List<XmlNode> getProcessingInstructionList()
          获取XML处理指令
 XmlNode getRoot()
          获取根结点 s
 XmlNode getXmlDeclaration()
          获取XML声明
 void setRoot(XmlNode root)
          设置根结点
 void setXmlDeclaration(XmlNode xmlDeclaration)
          设置XML声明
 String toString()
          获取完整XML文档
 void write(OutputStream out)
          将XML文档写入指定的输出流中
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XmlDocumentImpl

public XmlDocumentImpl()
Method Detail

getRoot

public XmlNode getRoot()
获取根结点 s

Specified by:
getRoot in interface Document<XmlNode>
Returns:
XmlNode

setRoot

public void setRoot(XmlNode root)
设置根结点

Specified by:
setRoot in interface Document<XmlNode>
Parameters:
root -

getXmlDeclaration

public XmlNode getXmlDeclaration()
获取XML声明

Specified by:
getXmlDeclaration in interface XmlDocument
Returns:
XmlNode

setXmlDeclaration

public void setXmlDeclaration(XmlNode xmlDeclaration)
设置XML声明

Specified by:
setXmlDeclaration in interface XmlDocument
Parameters:
xmlDeclaration -

getCommentList

public List<XmlNode> getCommentList()
获取Xml注释

Specified by:
getCommentList in interface XmlDocument
Returns:
List

getDoctypeList

public List<XmlNode> getDoctypeList()
获取CDATA部分

Specified by:
getDoctypeList in interface XmlDocument
Returns:
List

getProcessingInstructionList

public List<XmlNode> getProcessingInstructionList()
获取XML处理指令

Specified by:
getProcessingInstructionList in interface XmlDocument
Returns:
List

addDoctype

public void addDoctype(XmlNode node)
添加CDATA文本

Specified by:
addDoctype in interface XmlDocument
Parameters:
CDATA文本 -

addProcessingInstruction

public void addProcessingInstruction(XmlNode node)
添加XML处理指令

Specified by:
addProcessingInstruction in interface XmlDocument
Parameters:
processingInstruction -

addComment

public void addComment(XmlNode node)
添加注释

Specified by:
addComment in interface XmlDocument
Parameters:
comment -

toString

public String toString()
获取完整XML文档

Overrides:
toString in class Object
Returns:
String

write

public void write(OutputStream out)
           throws IOException
将XML文档写入指定的输出流中

Specified by:
write in interface Document<XmlNode>
Parameters:
out -
Throws:
IOException


Copyright © 2006–2015 TinyGroup. All rights reserved.