|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.data.trees.data.Nodes
public class Nodes
A set of static methods that implement a simple EDSL of tree expressions.
| Nested Class Summary | |
|---|---|
static class |
Nodes.Attribute
An attribute with a name and a value. |
| Field Summary | |
|---|---|
static Class<Leaf> |
L
Constant for the Leaf node type. |
static Class<InnerNode> |
N
Constant for the InnerNode type. |
| Constructor Summary | |
|---|---|
Nodes()
|
|
| Method Summary | ||
|---|---|---|
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
|
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)
Creates an Edge to a Node. |
|
static Edge |
e(QName name,
Object v)
Creates an Edge to a Leaf. |
|
static Edge |
e(String name,
Node node)
Creates an Edge to a Node. |
|
static Edge |
e(String name,
Object v)
Creates an Edge to a Leaf. |
|
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)
Creates an InnerNode with given Edges. |
|
static InnerNode |
n(InnerNode n)
Clones an InnerNode. |
|
static InnerNode |
n(String id,
Edge... es)
Creates an InnerNode with a given identifier and given Edgee. |
|
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)
Creates a Tree with given Edges. |
|
static Tree |
t(String id,
Edge... edges)
Creates a Tree with a given identifier and given Edges. |
|
static Tree |
t(String collID,
String id,
Edge... edges)
Creates a Tree in a given collection with a given identifier and given Edges. |
|
static Tree |
t(Tree root)
Clones a Tree. |
|
static Date |
toDate(String date)
Transforms a String in the format of the dateTime type of XML Schema into a Date object. |
|
static String |
toDateString(Date date)
Transforms a Date object into String representation compliant with the dateTime type of XML Schema |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Class<Leaf> L
Leaf node type.
public static final Class<InnerNode> N
InnerNode type.
| Constructor Detail |
|---|
public Nodes()
| Method Detail |
|---|
public static QName q(String name)
QName from a local name.
name - the name
QName
public static QName q(String ns,
String name)
QName from a namespace and a local name.
ns - the namespacename - the name
QName
public 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 name
QNamepublic static Tree t(Tree root)
Tree.
root - the Tree
public static Tree t(String collID,
String id,
Edge... edges)
Tree in a given collection with a given identifier and given Edges.
collID - the collection identifierid - the identifieredges - the Edges
Tree
public static Tree t(String id,
Edge... edges)
Tree with a given identifier and given Edges.
id - the identifieredges - the Edges
Treepublic static Tree t(Edge... edges)
Tree with given Edges.
edges - the Edges
Treepublic static InnerNode n(InnerNode n)
InnerNode.
n - the InnerNode
InnerNode's clone
public static InnerNode n(String id,
Edge... es)
InnerNode with a given identifier and given Edgee.
id - the identifieres - the Edges
InnerNodepublic static InnerNode n(Edge... es)
InnerNode with given Edges.
es - Edges
InnerNodepublic static Edge e(Edge e)
Edge.
e - the Edge
public static Edge e(QName name,
Node node)
Edge to a Node.
name - the Edge labelnode - the Node
Edge
public static Edge e(String name,
Node node)
Edge to a Node.
name - the local name of the Edge labelnode - the Node
Edge
public static Edge e(QName name,
Object v)
Edge to a Leaf.
name - the Edge labelv - the value of the Leaf
Edge
public static Edge e(String name,
Object v)
Edge to a Leaf.
name - the local name of the Edge labelv - the value of the Leaf
Edgepublic static Leaf l(Leaf l)
Leaf.
l - the Leaf
public static Leaf l(String id,
Object v)
Leaf with a given identifier and a given value.
id - the identifierv - the value
Leafpublic static Leaf l(Object v)
Leaf with a given value.
v - the value
Leaf
public static <N extends Node> N attr(N n,
Nodes.Attribute attribute,
Nodes.Attribute... attributes)
Node annotated with one or more attributes.
N - the type of the Noden - the Nodeattribute - the first attributeattributes - the remaining attributes
Node, annotated
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 object into String representation compliant with the dateTime type of XML Schema
date - the date
public static Date toDate(String date)
throws IllegalArgumentException
String in the format of the dateTime type of XML Schema into a Date object.
date - the string
IllegalArgumentException - if the string is not a valid representation of date
public static boolean matches(QName lbl,
QName regexp)
lbl - the label.regexp - the expression
true if it does, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||