|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.contentmanagement.contentmanager.stubs.model.trees.Nodes
public class Nodes
A collection of static methods that compose into a pseudo-literal syntax for creating gDoc
trees.
Field Summary | |
---|---|
static java.lang.Class<Leaf> |
L
Constant for the leaf node type. |
static java.lang.Class<InnerNode> |
N
Constant for the inner node type. |
Constructor Summary | |
---|---|
Nodes()
|
Method Summary | ||
---|---|---|
static org.gcube.contentmanagement.contentmanager.stubs.model.trees.Nodes.Attribute |
a(javax.xml.namespace.QName n,
java.lang.Object v)
Builds an attribute with a given name and a given value. |
|
static org.gcube.contentmanagement.contentmanager.stubs.model.trees.Nodes.Attribute |
a(java.lang.String name,
java.lang.Object v)
Builds an attribute with a given name and a given value. |
|
static org.gcube.contentmanagement.contentmanager.stubs.model.trees.Nodes.Attribute |
a(java.lang.String ns,
java.lang.String local,
java.lang.Object v)
Builds an attribute with a given name and a given value. |
|
static void |
addURIs(GDoc doc)
Marks a document and all its descendants with their content URIs. |
|
static void |
addURIs(Node n)
Marks a node and all its descendants with their content URIs. |
|
static
|
attr(N n,
org.gcube.contentmanagement.contentmanager.stubs.model.trees.Nodes.Attribute attribute,
org.gcube.contentmanagement.contentmanager.stubs.model.trees.Nodes.Attribute... as)
Returns a given node annotated with one or more attributes |
|
static Edge |
e(Edge e)
Clones a given edge. |
|
static Edge |
e(java.lang.String name,
Node node)
Creates an edge to a node in a document tree. |
|
static Edge |
e(java.lang.String l,
java.lang.Object v)
Creates an edge to a leaf node in a document tree. |
|
static Edge |
e(java.lang.String ns,
java.lang.String name,
Node node)
Creates an edge to a node in a document tree. |
|
static Edge |
e(java.lang.String ns,
java.lang.String name,
java.lang.Object v)
Creates an edge to a leaf node in a document tree. |
|
static Edge |
e(java.lang.String prefix,
java.lang.String ns,
java.lang.String name,
Node node)
Creates an edge to a node in a document tree. |
|
static Edge |
e(java.lang.String prefix,
java.lang.String ns,
java.lang.String name,
java.lang.Object v)
Creates an edge to a leaf node in a document tree. |
|
static GDoc |
gdoc(Edge... edges)
Creates a document tree with given edges. |
|
static GDoc |
gdoc(GDoc doc)
Clones a given document. |
|
static InnerNode |
gdoc(InnerNode n)
Clones a given node. |
|
static GDoc |
gdoc(java.lang.String id,
Edge... edges)
Creates a document tree with a given identifier and given edges. |
|
static GDoc |
gdoc(java.lang.String collID,
java.lang.String id,
Edge... edges)
Creates a document tree in a given collection with a given identifier and given edges. |
|
static Leaf |
l(Leaf l)
Clones a given leaf. |
|
static Leaf |
l(java.lang.Object v)
Returns a leaf with a given value. |
|
static Leaf |
l(java.lang.String id,
java.lang.Object v)
Returns a leaf with a given identifier and a given value. |
|
static boolean |
matches(javax.xml.namespace.QName lbl,
javax.xml.namespace.QName regexp)
Indicates whether a label matches a regular expession. |
|
static InnerNode |
n(Edge... edges)
Creates a node in a document tree with given edges. |
|
static InnerNode |
n(java.lang.String id,
Edge... edges)
Creates a node in a document tree with a given identifier and given edges. |
|
static void |
removeURIs(InnerNode n)
Removes content URIs from a node and all its descendants. |
|
static java.util.Date |
toDate(java.lang.String date)
Transforms a string in the format of the dateTime type of XML Schema into a Date object. |
|
static java.lang.String |
toDateString(java.util.Date date)
Transforms a Date object into string representation compliant with the dateTime type of XML Schema |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Class<Leaf> L
public static final java.lang.Class<InnerNode> N
Constructor Detail |
---|
public Nodes()
Method Detail |
---|
public static GDoc gdoc(GDoc doc)
doc
- the document.
public static GDoc gdoc(java.lang.String collID, java.lang.String id, Edge... edges)
collID
- the collection identifier.id
- the identifier.edges
- the edges.
public static GDoc gdoc(java.lang.String id, Edge... edges)
id
- the identifier.edges
- the edges.
public static GDoc gdoc(Edge... edges)
edges
- the edges.
public static InnerNode gdoc(InnerNode n)
n
- the document.
public static InnerNode n(java.lang.String id, Edge... edges)
id
- the identifier.edges
- the edges.
public static InnerNode n(Edge... edges)
edges
- the edges.
public static Edge e(Edge e)
e
- the edge.
public static Edge e(java.lang.String prefix, java.lang.String ns, java.lang.String name, Node node) throws java.lang.IllegalArgumentException
prefix
- the prefix of the edge label.ns
- the namespace of the edge label.name
- the local name of the edge label.node
- the node.
java.lang.IllegalArgumentException
- if the prefix or local name are null
.public static Edge e(java.lang.String ns, java.lang.String name, Node node) throws java.lang.IllegalArgumentException
ns
- the namespace of the edge label.name
- the local name of the edge label.node
- the node.
java.lang.IllegalArgumentException
- if the local name is null
.public static Edge e(java.lang.String name, Node node) throws java.lang.IllegalArgumentException
name
- the local name of the edge label.node
- the node.
java.lang.IllegalArgumentException
- if the local name is null
.public static Edge e(java.lang.String ns, java.lang.String name, java.lang.Object v) throws java.lang.IllegalArgumentException
ns
- the namespace of the edge label.name
- the local name of the edge label.v
- the value of the leaf node.
java.lang.IllegalArgumentException
- if the local name is null
.public static Edge e(java.lang.String prefix, java.lang.String ns, java.lang.String name, java.lang.Object v)
prefix
- the prefix of the edge label.ns
- the namespace of the edge label.name
- the local name of the edge label.v
- the value of the leaf node.
java.lang.IllegalArgumentException
- if the prefix or local name are null
.public static Edge e(java.lang.String l, java.lang.Object v) throws java.lang.IllegalArgumentException
name
- the local name of the edge label.v
- the value of the leaf node.
java.lang.IllegalArgumentException
- if the local name is null
.public static Leaf l(Leaf l)
l
- the leaf.
public static Leaf l(java.lang.String id, java.lang.Object v)
id
- the identifier.v
- the value.
public static Leaf l(java.lang.Object v)
v
- the value.
public static <N extends Node> N attr(N n, org.gcube.contentmanagement.contentmanager.stubs.model.trees.Nodes.Attribute attribute, org.gcube.contentmanagement.contentmanager.stubs.model.trees.Nodes.Attribute... as)
NEW
- the type of the node.n
- the node.attribute
- the first attribute.attributes
- the remaining attributes.
public static org.gcube.contentmanagement.contentmanager.stubs.model.trees.Nodes.Attribute a(java.lang.String name, java.lang.Object v) throws java.lang.IllegalArgumentException
name
- the local name of the attribute.v
- the value.
java.lang.IllegalArgumentException
- if the local name is null
.public static org.gcube.contentmanagement.contentmanager.stubs.model.trees.Nodes.Attribute a(java.lang.String ns, java.lang.String local, java.lang.Object v) throws java.lang.IllegalArgumentException
ns
- the namespace of the attribute.name
- the local name of the attribute.v
- the value.
java.lang.IllegalArgumentException
- if the local name is null
.public static org.gcube.contentmanagement.contentmanager.stubs.model.trees.Nodes.Attribute a(javax.xml.namespace.QName n, java.lang.Object v)
n
- the name.v
- the value.
public static void addURIs(GDoc doc) throws java.lang.IllegalArgumentException
n
- the node.
java.lang.IllegalArgumentException
- if the document does not belong to a collection.public static void addURIs(Node n)
n
- the node.public static void removeURIs(InnerNode n)
n
- the node.public static java.lang.String toDateString(java.util.Date date)
Date
object into string representation compliant with the dateTime type of XML Schema
date
- the date.
public static java.util.Date toDate(java.lang.String date) throws java.lang.IllegalArgumentException
Date
object.
date
- the string.
java.lang.IllegalArgumentException
- if the string is not a valid representation of date.public static boolean matches(javax.xml.namespace.QName lbl, javax.xml.namespace.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 |