Modifier | Constructor and Description |
---|---|
protected |
NodeImpl(NT nodeType)
构造函数
|
protected |
NodeImpl(NT nodeType,
String nodeName)
构造函数
|
protected |
NodeImpl(String nodeName)
构造函数
|
protected |
NodeImpl(String nodeName,
NT nodeType)
构造函数
|
Modifier and Type | Method and Description |
---|---|
List<T> |
addAll(List<T> nodes)
添加所有节点
|
T |
addNode(T node)
添加子结点
|
protected abstract String |
decode(String str) |
protected abstract String |
encode(String str) |
void |
foreach(Processor<T> processor) |
String |
getAttribute(String attributeName)
根据属性名获取属性值
|
String |
getAttribute(String attributeName,
String defaultValue)
获取属性值,如果值不存在,则返回默认值
|
List<Attribute> |
getAttributeList() |
Map<String,String> |
getAttributes()
获取结点属性
|
StringBuffer |
getBody()
获取结点内容 若为文本内容,返回文本 若为子结点,返回子结点
|
String |
getCaseSensitiveName(String name)
返回名字,如果大小写敏感,则没有变化,如果大小写不敏感,则统一变成小写
|
String |
getContent()
获取结点文本内容
|
void |
getFooter(StringBuffer sb)
获取完整的结尾标签 若为非对称标签则返回空
|
void |
getHeader(StringBuffer sb)
获取完整的头标签,包括标签标识符、名字、属性
|
String |
getNodeName()
获取结点名称
|
NT |
getNodeType()
获取结点类型
|
T |
getParent()
获取父结点
|
T |
getRoot()
获取根结点
|
String |
getSingleAttribute()
获取非对称标签属性
|
T |
getSubNode(String nodeName)
查找子节点中,指定节点名称的第一个节点
|
T |
getSubNodeRecursively(String nodeName)
查找子孙节点中,指定节点名称的第一个节点
|
List<T> |
getSubNodes()
获取子结点
|
List<T> |
getSubNodes(String nodeName)
获取子结点
|
List<T> |
getSubNodesByPath(String nodePath)
返回子孙节点列表
|
List<T> |
getSubNodesRecursively(String nodeName)
获取子孙结点列表
|
boolean |
isSingleNode()
检测是否为非对称结点 若为对称结点返回false 若为非对称结点返回true
|
T |
removeAttribute(String attributeName)
根据属性名删除指定的属性
|
List<T> |
removeNode(String nodeName)
删除指定节点
|
T |
removeNode(T node)
删除指定的子结点
|
List<T> |
removeSubNotes()
删除所有子节点
|
T |
setAttribute(Map<String,String> attributeMap)
匹量设置属性
|
T |
setAttribute(String attributeName,
String value)
设置属性 若输入参数中的属性名不为空,属性值为空,则删除指定的属性 若输入参数中的属性名不为空,属性值不为空,则添加相应的属性
|
T |
setContent(String content)
设置结点文本内容
|
T |
setNodeName(String nodeName)
设置结点名称
|
T |
setParent(T parent)
设置父结点
|
void |
setSingleAttribute(String singleAttribute)
设置非对称标签属性
|
String |
toString() |
StringBuffer |
toStringBuffer()
返回当前结点完整的信息
|
void |
write(OutputStream stream)
写出数据
|
void |
write(OutputStream stream,
String encode)
将结点数据写入指定的输出流中
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addContent, getPureText, isCaseSensitive
protected NodeImpl(NT nodeType)
nodeType
- protected NodeImpl(String nodeName)
nodeName
- public String getAttribute(String attributeName, String defaultValue)
Node
getAttribute
in interface Node<T extends Node<T>>
public void write(OutputStream stream) throws IOException
Node
public String getSingleAttribute()
public void setSingleAttribute(String singleAttribute)
singleAttribute
- public T setNodeName(String nodeName)
setNodeName
in interface Node<T extends Node<T>>
nodeName
- public NT getNodeType()
getNodeType
in interface Node<T extends Node<T>>
public String getContent()
getContent
in interface Node<T extends Node<T>>
public T setContent(String content)
setContent
in interface Node<T extends Node<T>>
content
- public Map<String,String> getAttributes()
getAttributes
in interface Node<T extends Node<T>>
public List<Attribute> getAttributeList()
getAttributeList
in interface Node<T extends Node<T>>
public T setAttribute(Map<String,String> attributeMap)
Node
setAttribute
in interface Node<T extends Node<T>>
public List<T> getSubNodes()
getSubNodes
in interface Node<T extends Node<T>>
public List<T> getSubNodes(String nodeName)
getSubNodes
in interface Node<T extends Node<T>>
public List<T> getSubNodesRecursively(String nodeName)
getSubNodesRecursively
in interface Node<T extends Node<T>>
public List<T> getSubNodesByPath(String nodePath)
getSubNodesByPath
in interface Node<T extends Node<T>>
nodePath
- public T getSubNodeRecursively(String nodeName)
getSubNodeRecursively
in interface Node<T extends Node<T>>
nodeName
- public String getCaseSensitiveName(String name)
getCaseSensitiveName
in interface Node<T extends Node<T>>
name
- public void getHeader(StringBuffer sb)
public void getFooter(StringBuffer sb)
public T getRoot()
public T getParent()
public StringBuffer getBody()
public StringBuffer toStringBuffer()
toStringBuffer
in interface Node<T extends Node<T>>
public void write(OutputStream stream, String encode) throws IOException
IOException
public String getAttribute(String attributeName)
getAttribute
in interface Node<T extends Node<T>>
public T removeAttribute(String attributeName)
removeAttribute
in interface Node<T extends Node<T>>
public T setAttribute(String attributeName, String value)
setAttribute
in interface Node<T extends Node<T>>
public T removeNode(T node)
removeNode
in interface Node<T extends Node<T>>
public void foreach(Processor<T> processor)
foreach
in interface ForEachProcessor<T extends Node<T>>
public String getNodeName()
getNodeName
in interface Node<T extends Node<T>>
public boolean isSingleNode()
isSingleNode
in interface Node<T extends Node<T>>
Copyright © 2006–2018 TinyGroup. All rights reserved.