public class Nodes extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Nodes.Attribute
An attribute with a name and a value.
|
| Modifier and Type | Field and Description |
|---|---|
static Class<Leaf> |
L
Constant for the
Leaf node type. |
static Class<InnerNode> |
N
Constant for the
InnerNode type. |
| Constructor and Description |
|---|
Nodes() |
| Modifier and Type | Method and Description |
|---|---|
static Nodes.Attribute |
a(QName name,
Object v)
Returns an
Nodes.Attribute with a given name and a given value. |
static Nodes.Attribute |
a(String name,
Object v)
Returns an
Nodes.Attribute with a given name and a given value. |
static <N extends Node> |
attr(N n,
Nodes.Attribute attribute,
Nodes.Attribute... attributes)
Returns a
Node annotated with one or more attributes. |
static Edge |
e(Edge e)
Clones a given
Edge. |
static Edge |
e(QName name,
Node node)
|
static Edge |
e(QName name,
Object v)
|
static Edge |
e(String name,
Node node)
|
static Edge |
e(String name,
Object v)
|
static Leaf |
l(Leaf l)
Clones a
Leaf. |
static Leaf |
l(Object v)
Returns a
Leaf with a given value. |
static Leaf |
l(String id,
Object v)
Returns a
Leaf with a given identifier and a given value. |
static boolean |
matches(QName lbl,
QName regexp)
Indicates whether a label matches a regular expression.
|
static InnerNode |
n(Edge... es)
|
static InnerNode |
n(InnerNode n)
Clones an
InnerNode. |
static InnerNode |
n(String id,
Edge... es)
|
static QName |
q(String name)
Returns a
QName from a local name. |
static QName |
q(String ns,
String name)
Returns a
QName from a namespace and a local name. |
static QName |
q(String prefix,
String ns,
String name)
Returns a
QName from a prefix, a namespace and a local name. |
static Tree |
t(Edge... edges)
|
static Tree |
t(String id,
Edge... edges)
|
static Tree |
t(String collID,
String id,
Edge... edges)
|
static Tree |
t(Tree root)
Clones a
Tree. |
static Date |
toDate(String date)
|
static String |
toDateString(Date date)
|
public static QName q(String name)
QName from a local name.name - the nameQNamepublic static QName q(String ns, String name)
QName from a namespace and a local name.ns - the namespacename - the nameQNamepublic static QName q(String prefix, String ns, String name)
QName from a prefix, a namespace and a local name.prefix - the prefixns - the namespacename - the nameQNamepublic static Leaf l(String id, Object v)
Leaf with a given identifier and a given value.id - the identifierv - the valueLeafpublic static Leaf l(Object v)
Leaf with a given value.v - the valueLeafpublic static <N extends Node> N attr(N n, Nodes.Attribute attribute, Nodes.Attribute... attributes)
Node annotated with one or more attributes.public static Nodes.Attribute a(String name, Object v) throws IllegalArgumentException
Nodes.Attribute with a given name and a given value.name - the local name of the Nodes.Attribute.v - the value.Nodes.Attribute.IllegalArgumentException - if the local name is null.public static Nodes.Attribute a(QName name, Object v)
Nodes.Attribute with a given name and a given value.name - the Nodes.Attribute name.v - the value.Nodes.Attribute.IllegalArgumentException - if the local name is null.public static String toDateString(Date date)
date - the datepublic static Date toDate(String date) throws IllegalArgumentException
date - the stringIllegalArgumentException - if the string is not a valid representation of dateCopyright © 2018. All Rights Reserved.