public class XNode extends java.lang.Object implements java.lang.Comparable<XNode>
Modifier and Type | Class and Description |
---|---|
static class |
XNode.ContentType |
Constructor and Description |
---|
XNode(java.lang.String name) |
XNode(java.lang.String name,
java.lang.String text) |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.String key,
boolean value) |
void |
addAttribute(java.lang.String key,
byte value) |
void |
addAttribute(java.lang.String key,
double value) |
void |
addAttribute(java.lang.String key,
float value) |
void |
addAttribute(java.lang.String key,
int value) |
void |
addAttribute(java.lang.String key,
long value) |
void |
addAttribute(java.lang.String key,
java.lang.Object o) |
void |
addAttribute(java.lang.String key,
short value) |
void |
addAttribute(java.lang.String key,
java.lang.String value) |
void |
addAttribute(java.lang.String key,
java.lang.String value,
boolean escape) |
void |
addAttributes(java.util.Map<java.lang.String,java.lang.String> map) |
XNode |
addCDATA(java.lang.String cdata) |
XNode |
addChild(java.lang.String name) |
XNode |
addChild(java.lang.String name,
boolean b) |
XNode |
addChild(java.lang.String name,
byte b) |
XNode |
addChild(java.lang.String name,
double d) |
XNode |
addChild(java.lang.String name,
float f) |
XNode |
addChild(java.lang.String name,
int i) |
XNode |
addChild(java.lang.String name,
long l) |
XNode |
addChild(java.lang.String name,
java.lang.Object o) |
XNode |
addChild(java.lang.String name,
short s) |
XNode |
addChild(java.lang.String name,
java.lang.String text) |
XNode |
addChild(java.lang.String name,
java.lang.String text,
boolean escape) |
XNode |
addChild(XNode child) |
void |
addChildren(java.util.Collection<XNode> children) |
void |
addChildren(java.util.Map<java.lang.String,java.lang.String> children) |
void |
addClosingComment(java.lang.String comment) |
<E extends XNodeIO> |
addCollection(java.util.Collection<E> list)
Adds a child node to this node for each object in a list
|
XNode |
addComment(java.lang.String comment) |
void |
addContent(java.lang.String content) |
void |
addContent(java.lang.String content,
java.lang.String nsPrefix,
java.lang.String nsURI) |
void |
addOpeningComment(java.lang.String comment) |
int |
compareTo(XNode other) |
int |
getAttributeCount() |
java.util.Map<java.lang.String,java.lang.String> |
getAttributes() |
java.lang.String |
getAttributeValue(java.lang.String key) |
XNode |
getChild() |
XNode |
getChild(int index) |
XNode |
getChild(java.lang.String name) |
int |
getChildCount() |
java.util.List<XNode> |
getChildren() |
java.util.List<XNode> |
getChildren(java.lang.String name) |
java.util.List<XNode> |
getChildren(XNode.ContentType cType) |
java.lang.String |
getChildText(java.lang.String name) |
java.lang.String |
getChildText(java.lang.String name,
boolean escape) |
int |
getDepth() |
java.lang.String |
getName() |
XNode |
getOrAddChild(java.lang.String name) |
XNode |
getParent() |
java.lang.String |
getText() |
java.lang.String |
getText(boolean escape) |
int |
getTextLength() |
boolean |
hasAttribute(java.lang.String key) |
boolean |
hasChild(java.lang.String name) |
boolean |
hasChildren() |
boolean |
hasChildren(java.lang.String name) |
XNode |
insertChild(int index,
XNode child) |
XNode |
insertComment(int index,
java.lang.String comment) |
boolean |
isCDATA() |
boolean |
isComment() |
int |
length() |
<E extends XNodeIO> |
populateCollection(java.util.Collection<E> list,
E instance)
Creates and adds an object of type E to a list for each child node.
|
int |
posChildWithAttribute(java.lang.String key,
java.lang.String value) |
int |
posChildWithName(java.lang.String name) |
boolean |
removeChild(XNode child) |
void |
removeChildren() |
void |
removeDuplicateChildren() |
void |
setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes) |
void |
setDepth(int depth) |
void |
setName(java.lang.String name) |
void |
setParent(XNode parent) |
void |
setText(boolean value) |
void |
setText(byte value) |
void |
setText(double value) |
void |
setText(float value) |
void |
setText(int value) |
void |
setText(long value) |
void |
setText(short value) |
void |
setText(java.lang.String text) |
void |
setText(java.lang.String text,
boolean escape) |
void |
sort() |
void |
sort(java.util.Comparator<XNode> comparator) |
Document |
toDocument() |
Element |
toElement() |
java.lang.String |
toPrettyString() |
java.lang.String |
toPrettyString(boolean header) |
java.lang.String |
toPrettyString(boolean header,
int tabSize) |
java.lang.String |
toPrettyString(int tabSize) |
java.lang.String |
toPrettyString(int offset,
int tabSize) |
java.lang.String |
toString() |
java.lang.String |
toString(boolean header) |
public XNode(java.lang.String name)
public XNode(java.lang.String name, java.lang.String text)
public int compareTo(XNode other)
compareTo
in interface java.lang.Comparable<XNode>
public void addAttribute(java.lang.String key, java.lang.String value)
public void addAttribute(java.lang.String key, java.lang.String value, boolean escape)
public void addAttribute(java.lang.String key, boolean value)
public void addAttribute(java.lang.String key, byte value)
public void addAttribute(java.lang.String key, short value)
public void addAttribute(java.lang.String key, int value)
public void addAttribute(java.lang.String key, long value)
public void addAttribute(java.lang.String key, double value)
public void addAttribute(java.lang.String key, float value)
public void addAttribute(java.lang.String key, java.lang.Object o)
public void addAttributes(java.util.Map<java.lang.String,java.lang.String> map)
public XNode addChild(java.lang.String name)
public XNode addChild(java.lang.String name, java.lang.String text)
public XNode addChild(java.lang.String name, boolean b)
public XNode addChild(java.lang.String name, long l)
public XNode addChild(java.lang.String name, int i)
public XNode addChild(java.lang.String name, byte b)
public XNode addChild(java.lang.String name, short s)
public XNode addChild(java.lang.String name, double d)
public XNode addChild(java.lang.String name, float f)
public XNode addChild(java.lang.String name, java.lang.Object o)
public XNode addChild(java.lang.String name, java.lang.String text, boolean escape)
public void addChildren(java.util.Collection<XNode> children)
public void addChildren(java.util.Map<java.lang.String,java.lang.String> children)
public boolean removeChild(XNode child)
public void removeChildren()
public void addContent(java.lang.String content)
public void addContent(java.lang.String content, java.lang.String nsPrefix, java.lang.String nsURI)
public <E extends XNodeIO> void addCollection(java.util.Collection<E> list)
E
- a type extending the XNodeIO interfacelist
- the list of objects to create child nodes frompublic <E extends XNodeIO> void populateCollection(java.util.Collection<E> list, E instance)
E
- a type extending the XNodeIO interfacelist
- the list of objects to populateinstance
- an instance of an E type objectpublic void removeDuplicateChildren()
public XNode addComment(java.lang.String comment)
public XNode insertComment(int index, java.lang.String comment)
public boolean isComment()
public void addOpeningComment(java.lang.String comment)
public void addClosingComment(java.lang.String comment)
public XNode addCDATA(java.lang.String cdata)
public boolean isCDATA()
public void setText(java.lang.String text)
public void setText(java.lang.String text, boolean escape)
public void setText(boolean value)
public void setText(byte value)
public void setText(short value)
public void setText(int value)
public void setText(long value)
public void setText(double value)
public void setText(float value)
public XNode getChild(java.lang.String name)
public XNode getOrAddChild(java.lang.String name)
public XNode getChild()
public XNode getChild(int index)
public java.util.List<XNode> getChildren()
public java.util.List<XNode> getChildren(XNode.ContentType cType)
public java.util.List<XNode> getChildren(java.lang.String name)
public java.lang.String getChildText(java.lang.String name)
public java.lang.String getChildText(java.lang.String name, boolean escape)
public int posChildWithName(java.lang.String name)
public int posChildWithAttribute(java.lang.String key, java.lang.String value)
public java.lang.String getText()
public java.lang.String getText(boolean escape)
public java.lang.String getAttributeValue(java.lang.String key)
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
public boolean hasAttribute(java.lang.String key)
public void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
public java.lang.String getName()
public void setName(java.lang.String name)
public void setParent(XNode parent)
public XNode getParent()
public int getDepth()
public void setDepth(int depth)
public boolean hasChildren()
public boolean hasChildren(java.lang.String name)
public boolean hasChild(java.lang.String name)
public int getAttributeCount()
public int getChildCount()
public int getTextLength()
public int length()
public void sort()
public void sort(java.util.Comparator<XNode> comparator)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(boolean header)
public java.lang.String toPrettyString()
public java.lang.String toPrettyString(boolean header)
public java.lang.String toPrettyString(int tabSize)
public java.lang.String toPrettyString(int offset, int tabSize)
public java.lang.String toPrettyString(boolean header, int tabSize)
public Element toElement()
public Document toDocument()
Copyright © 2004-2014 The YAWL Foundation.