|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.slide.util.XMLValue
This class is a container for a list of JDOM Elements.
The toString()
method provides a XML document fragment
describing the Elements of this XMLValue.
Nested Class Summary | |
protected static class |
XMLValue.DefaultNamespaceXMLFilter
This XMLFilter uses the given namespace as the default, means if no namespace is provided. |
Field Summary | |
protected static java.lang.String |
E_HREF
|
static java.lang.String |
ELEMENT_MUST_NOT_BE_NULL
Constant for the message of the IllegalArgumentException that may be thrown in method add() . |
protected java.util.ArrayList |
elementList
The list of JDOM Elements. |
protected static java.lang.String |
END_TAG
The end tag used to create a valid document out of the XML Element list string in constructor XMLValue(String) . |
protected static java.lang.String |
START_TAG
The start tag used to create a valid document out of the XML Element list string in constructor XMLValue(String) . |
static java.lang.String |
TYPE_MISMATCH
Constant for the message of the IllegalArgumentException that may be thrown in constructor XMLValue(List) . |
Constructor Summary | |
XMLValue()
Creates a XMLValue. |
|
XMLValue(org.jdom.Element element)
Creates a XMLValue from the given element . |
|
XMLValue(java.util.List elementList)
Creates a XMLValue from the given list of JDOM Elements. |
|
XMLValue(java.lang.String xmlString)
Creates a XMLValue from the given String representation of a list of XML Elements. |
|
XMLValue(java.lang.String xmlString,
org.jdom.Namespace defaultNamespace)
Creates a XMLValue from the given String representation of a list of XML Elements. |
Method Summary | |
void |
add(org.jdom.CDATA cdata)
Adds a JDOM CDATA. |
void |
add(org.jdom.Comment comment)
Adds a JDOM Comment. |
void |
add(org.jdom.Element element)
Adds a JDOM Element. |
void |
add(org.jdom.EntityRef eref)
Adds a JDOM EntityRef. |
void |
add(java.util.List content)
Adds a List of JDOM items. |
void |
add(org.jdom.ProcessingInstruction pi)
Adds a JDOM ProcessingInstruction. |
void |
add(java.lang.String xmlString)
Adds the Elements given by an XML string representation. |
void |
add(java.lang.String xmlString,
org.jdom.Namespace defaultNamespace)
Adds the Elements given by an XML string representation. |
void |
add(org.jdom.Text text)
Adds a JDOM Text. |
void |
addHref(java.lang.String path)
|
java.lang.Object |
clone()
Returns a clone of this instance. |
int |
compareTo(java.lang.Object o)
compares the concatenated Text values of all Elements in elementList |
boolean |
equals(java.lang.Object other)
Returns true if the other object is an XMLValue and
both their String representations are equal. |
java.util.List |
getHrefNodes()
Method getHrefs |
java.util.List |
getHrefStrings()
Method getHrefs |
java.util.List |
getList()
Returns a clone of the List of JDOM Elements. |
java.lang.String |
getTextValue()
concatenates the text() values of all Elements in elementList |
int |
hashCode()
Returns the hash code of this instance. |
java.util.Iterator |
iterator()
Returns an iterator of JDOM Elements. |
int |
size()
Returns the amount of JDOM elements. |
void |
stripServletContext(java.lang.String servletContext)
|
java.lang.String |
toString()
Returns a String representation of the Elements as a XML document fragment. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String ELEMENT_MUST_NOT_BE_NULL
add()
.
public static final java.lang.String TYPE_MISMATCH
XMLValue(List)
.
protected static final java.lang.String START_TAG
XMLValue(String)
.
protected static final java.lang.String END_TAG
XMLValue(String)
.
protected static final java.lang.String E_HREF
protected java.util.ArrayList elementList
Constructor Detail |
public XMLValue()
public XMLValue(org.jdom.Element element) throws java.lang.IllegalArgumentException
element
.
element
- the JDOM Element to add to the list.
java.lang.IllegalArgumentException
- if the given element
is null
.public XMLValue(java.util.List elementList) throws java.lang.IllegalArgumentException
list
of JDOM Elements.
the given List may be null
.
elementList
- the list of JDOM Elements to add.
java.lang.IllegalArgumentException
- if one of the list items
is null
or not a
Element
.public XMLValue(java.lang.String xmlString) throws org.jdom.JDOMException
xmlString
- a String representation of a list of XML Elements.
org.jdom.JDOMException
- if parsing the xmlString
fails.public XMLValue(java.lang.String xmlString, org.jdom.Namespace defaultNamespace) throws org.jdom.JDOMException
defaultNamespace
is not
null
, all nodes that does not have any namespace will be
created with that Namespace.
xmlString
- a String representation of a list of XML Elements.defaultNamespace
- the Namespace to use to create nodes that
does not have any namespace.
May be null
.
org.jdom.JDOMException
- if parsing the xmlString
fails.Method Detail |
public void add(org.jdom.Element element) throws java.lang.IllegalArgumentException
element
- the JDOM Element to add.
java.lang.IllegalArgumentException
- if the given element
is null
.public void add(org.jdom.Text text) throws java.lang.IllegalArgumentException
text
- the JDOM Text to add.
java.lang.IllegalArgumentException
- if the given text
is null
.public void add(org.jdom.Comment comment) throws java.lang.IllegalArgumentException
comment
- the JDOM Comment to add.
java.lang.IllegalArgumentException
- if the given comment
is null
.public void add(org.jdom.ProcessingInstruction pi) throws java.lang.IllegalArgumentException
pi
- the JDOM ProcessingInstruction to add.
java.lang.IllegalArgumentException
- if the given pi
is null
.public void add(org.jdom.CDATA cdata) throws java.lang.IllegalArgumentException
cdata
- the JDOM CDATA to add.
java.lang.IllegalArgumentException
- if the given CDATA
is null
.public void add(org.jdom.EntityRef eref) throws java.lang.IllegalArgumentException
eref
- the JDOM EntityRef to add.
java.lang.IllegalArgumentException
- if the given entity ref
is null
.public void add(java.util.List content) throws java.lang.IllegalArgumentException
content
- the list of JDOM items to add.
java.lang.IllegalArgumentException
- if one of the list items
is null
or not a
Element
.public void add(java.lang.String xmlString) throws org.jdom.JDOMException
xmlString
- a String representation of a list of XML Elements.
org.jdom.JDOMException
- if parsing the xmlString
fails.public void add(java.lang.String xmlString, org.jdom.Namespace defaultNamespace) throws org.jdom.JDOMException
namespace
is not null
, all nodes that does not
have any namespace will be created with that Namespace.
xmlString
- a String representation of a list of XML Elements.defaultNamespace
- the Namespace to use to create nodes that
does not have any namespace.
May be null
.
org.jdom.JDOMException
- if parsing the xmlString
fails.public void addHref(java.lang.String path)
public java.util.List getHrefStrings()
public java.util.List getHrefNodes()
public void stripServletContext(java.lang.String servletContext)
public java.util.Iterator iterator()
public int size()
public java.util.List getList()
public boolean equals(java.lang.Object other)
true
if the other object is an XMLValue and
both their String representations are equal.
other
- the Object to test for equality.
true
if the other object is an XMLValue and
both their String representations are equal.public int hashCode()
public java.lang.Object clone()
public java.lang.String toString()
public java.lang.String getTextValue()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- an Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |