Group
Class that represent a group of nodes without a container node.
You can convert a Group into Node using XmlNodeGroup.toNode
method.
<Foo a="1">
<Foo a="2">
<Foo a="3">
Attributes
- Graph
- Supertypes
Members list
Value members
Concrete methods
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
Convert current instance to a XmlNode.Node.
Convert current instance to a XmlNode.Node.
Wrap the group with a new XmlNode
// before
<Foo a="1">
<Foo a="2">
<Foo a="3">
// after
<Bar>
<Foo a="1">
<Foo a="2">
<Foo a="3">
</Bar>
Attributes
- attributes
attributes of the wrapper node, could be empty
- label
name of the wrapper node
- Returns:
An XmlNode with contains the current group nodes as children.
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
Concrete fields
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
Get the node label value
Get the node label value
<Foo></Foo> //foo
Attributes
- Returns:
node label string