Node
Represent a simple single XML node.
<Bar>
<Foo a="1">
<Foo a="2">
<Foo a="3">
</Bar>
Attributes
- Graph
- Supertypes
Members list
Value members
Concrete methods
Get the node label value
Get the node label value
<Foo a="1" b="2" ></Foo> //a="1" b="2"
Attributes
- Returns:
list of node attributes
- Definition Classes
Return the node content which can be:
Return the node content which can be:
If you need a specific kind of content please use either XmlNode.text, XmlNode.isEmpty or XmlNode.children instead
Attributes
- Returns:
Node content instance
- Definition Classes
Create a new immutable instance with the same values of the current one
Create a new immutable instance with the same values of the current one
Attributes
- Returns:
A new instance with the same values of the current one
- Definition Classes
Get the node label value
Get the node label value
<Foo></Foo> //foo
Attributes
- Returns:
node label string
- Definition Classes
Decode and then update node text if content is text.
Decode and then update node text if content is text.
If you need raw data see updateTextRaw
Attributes
Decode and then update node text if content is text.
Decode and then update node text if content is text.
If you need raw data see updateTextRaw
Attributes
Update node text if content is text.
Update node text if content is text.
If you need decoded data see updateText
Attributes
Rename node label. This method isn't pure for usability purpose.
Rename node label. This method isn't pure for usability purpose.
Throws IllegalArgumentException
If the new label values is not valid. See
Xml.isValidXmlName
Attributes
- newLabel
new label value
- Returns:
Same node with updated label
Set node content to Text with the specified data. All children nodes will be removed.
Set node content to Text with the specified data. All children nodes will be removed.
Attributes
Inherited methods
Attributes
- Inherited from:
- Xml
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Any implementation of this method should be an equivalence relation:
- It is reflexive: for any instance
x
of typeAny
,x.equals(x)
should returntrue
. - It is symmetric: for any instances
x
andy
of typeAny
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any instances
x
,y
, andz
of typeAny
ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
.
If you override this method, you should verify that your implementation remains an equivalence relation.
Additionally, when overriding this method it is usually necessary to override hashCode
to ensure that
objects which are "equal" (o1.equals(o2)
returns true
) hash to the same scala.Int.
(o1.hashCode.equals(o2.hashCode)
).
Attributes
Attributes
- T
result type parameter
- ifGroup
Function invoked when the current node is of type Group
- ifNode
Function invoked when the current node is of type Node
- Returns:
T value
- Inherited from:
- XmlNode
Attributes
- Inherited from:
- XmlNode
Attributes
- Inherited from:
- XmlNode
Attributes
- Inherited from:
- XmlNode
Attributes
- Inherited from:
- XmlNode
Check if the node has a child with the specified label which satisfies the specified predicate.
Check if the node has a child with the specified label which satisfies the specified predicate.
Attributes
- Returns:
true
if the node has a child with specified label which satisfies the predicate,false
otherwise- Inherited from:
- XmlNode
Check if the node has children
Check if the node has children
Attributes
- Returns:
true
if the node has children,false
otherwise- Inherited from:
- XmlNode
Check is the node has text
Check is the node has text
Attributes
- Returns:
true
if the node has text content,false
otherwise. Alwaysfalse
if node is XmlNode.Group- Inherited from:
- XmlNode
Check if the node has empty content
Check if the node has empty content
Attributes
- Returns:
true
if node content is empty,false
otherwise- Inherited from:
- XmlNode
Get node text data
Get node text data
Attributes
- Returns:
Node text if the content contains text. Always
None
if node is XmlNode.Group- Inherited from:
- XmlNode
Get node text as string
Get node text as string
Attributes
- Returns:
Node text if the content contains text. Always
None
if node is XmlNode.Group- Inherited from:
- XmlNode
Convert the node to a group. If this instance already is a group it will be returned the same instance.
Convert the node to a group. If this instance already is a group it will be returned the same instance.
Attributes
- Inherited from:
- XmlNode
Attributes
- Inherited from:
- XmlNode
Attributes
- Inherited from:
- XmlNode