org.gcube.contentmanagement.contentmanager.stubs.model.predicates
Class Predicates

java.lang.Object
  extended by org.gcube.contentmanagement.contentmanager.stubs.model.predicates.Predicates

public class Predicates
extends java.lang.Object

Author:
Fabio Simeoni (University of Strathclyde)

Field Summary
static java.lang.String any
          A wildcard for labels.
static boolean C
          A marker for condition edges.
 
Constructor Summary
Predicates()
           
 
Method Summary
static AnyPredicate any()
          The AnyPredicate predicate.
static EdgePredicate atleast(javax.xml.namespace.QName l, Predicate np)
          Returns an AtLeast predicate for a given label and a given Predicate.
static EdgePredicate atleast(java.lang.String l, Predicate np)
          Returns an AtLeast predicate for a given label and a given Predicate.
static EdgePredicate atleast(java.lang.String ns, java.lang.String l, Predicate np)
          Returns an AtLeast predicate for a given label and a given Predicate.
static Bool bool()
          Returns an unconstrained Bool predicate.
static Bool bool(Constraint<? super java.lang.Boolean> c)
          Returns a Bool predicate with a given constraint.
static Calendar calendar()
          Returns an unconstrained Calendar predicate.
static Calendar calendar(Constraint<? super java.util.Calendar> c)
          Returns a Calendar predicate with a given constraint.
static EdgePredicate clone(EdgePredicate predicate)
          Clone an edge predicate.
static Predicate clone(Predicate predicate)
          Clone a predicate.
static EdgePredicate cond(EdgePredicate ep)
          Marks an EdgePredicate as a condition.
static TreePredicate cut(TreePredicate tp)
          Returns a TreePredicate that has the same EdgePredicates as another TreePredicate but removes all the edges of matching node under pruning.
static Date date()
          Returns an unconstrained Date predicate.
static Date date(Constraint<? super java.util.Date> c)
          Returns a Date predicate with a given constraint.
static javax.xml.bind.Marshaller getMarshaller()
           
static javax.xml.bind.Unmarshaller getUnMarshaller()
           
static TreePredicate hasLabelPath(javax.xml.namespace.QName... labels)
          Returns a tree predicate for the existence of a given path of one or more edge labels.
static TreePredicate hasLabelPath(java.lang.String... labels)
          Returns a tree predicate for the existence of a given path of one or more edge labels.
static TreePredicate hasPath(java.lang.String... ids)
          Returns a tree predicate for the existence of a given path of one or more node identifiers.
static TreePredicate id(LeafPredicate<?,?> idp, TreePredicate p)
          Adds a LeafPredicate on the identifier of nodes described by a TreePredicate.
static TreePredicate id(java.lang.String identifier, TreePredicate p)
          Adds a string equality predicate on the identifier of nodes described by a TreePredicate.
static EdgePredicate many(javax.xml.namespace.QName l, Predicate np)
          Returns an Many predicate for a given label and a given Predicate.
static EdgePredicate many(java.lang.String l, Predicate np)
          Returns an Many predicate for a given label and a given Predicate.
static EdgePredicate many(java.lang.String ns, java.lang.String l, Predicate np)
          Returns an Many predicate for a given label and a given Predicate.
static Num num()
          Returns an unconstrained Num predicate.
static Num num(Constraint<? super java.lang.Double> c)
          Returns a Num predicate with a given constraint.
static EdgePredicate one(javax.xml.namespace.QName l, Predicate predicate)
          Returns an One predicate for a given label and a given Predicate.
static EdgePredicate one(java.lang.String l, Predicate predicate)
          Returns an One predicate for a given label and a given Predicate.
static EdgePredicate one(java.lang.String ns, java.lang.String l, Predicate predicate)
          Returns an One predicate for a given label and a given Predicate.
static EdgePredicate only(javax.xml.namespace.QName l, Predicate np)
          Returns an Only predicate for a given label and a given Predicate.
static EdgePredicate only(java.lang.String l, Predicate np)
          Returns an Only predicate for a given label and a given Predicate.
static EdgePredicate only(java.lang.String ns, java.lang.String l, Predicate np)
          Returns an Only predicate for a given label and a given Predicate.
static EdgePredicate opt(javax.xml.namespace.QName l, Predicate np)
          Returns an Opt predicate for a given label and a given Predicate.
static EdgePredicate opt(java.lang.String l, Predicate np)
          Returns an Opt predicate for a given label and a given Predicate.
static EdgePredicate opt(java.lang.String ns, java.lang.String l, Predicate np)
          Returns an Opt predicate for a given label and a given Predicate.
static EdgePredicate tail()
          Returns a predicate that matches all the children of a node not previously matched.
static Text text()
          Returns an unconstrained Text predicate.
static Text text(Constraint<? super java.lang.String> c)
          Returns a Text predicate with a given constraint.
static TreePredicate tree(EdgePredicate... eps)
          Returns a tree predicate for one or more EdgePredicates
static RID uri()
          Returns an unconstrained RID predicate.
static RID uri(Constraint<? super java.net.URI> c)
          Returns a RID predicate with a given constraint.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

any

public static final java.lang.String any
A wildcard for labels.

See Also:
Constant Field Values

C

public static final boolean C
A marker for condition edges.

See Also:
Constant Field Values
Constructor Detail

Predicates

public Predicates()
Method Detail

getMarshaller

public static javax.xml.bind.Marshaller getMarshaller()
                                               throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

getUnMarshaller

public static javax.xml.bind.Unmarshaller getUnMarshaller()
                                                   throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

any

public static final AnyPredicate any()
The AnyPredicate predicate.


clone

public static final Predicate clone(Predicate predicate)
                             throws java.lang.Exception
Clone a predicate.

Parameters:
predicate - the predicate to clone.
Returns:
the predicate clone.
Throws:
java.lang.Exception - if the predicate could not be cloned.

clone

public static final EdgePredicate clone(EdgePredicate predicate)
                                 throws java.lang.Exception
Clone an edge predicate.

Parameters:
predicate - the edge predicate to clone.
Returns:
the edge predicate clone.
Throws:
java.lang.Exception - if the edge predicate could not be cloned.

tree

public static final TreePredicate tree(EdgePredicate... eps)
Returns a tree predicate for one or more EdgePredicates

Parameters:
the - edge predicates.
Returns:
the predicate.

hasPath

public static final TreePredicate hasPath(java.lang.String... ids)
                                   throws java.lang.IllegalArgumentException
Returns a tree predicate for the existence of a given path of one or more node identifiers.

Parameters:
ids - the identifiers.
Returns:
the predicate.
Throws:
java.lang.IllegalArgumentException - if invoked with null or no input.

hasLabelPath

public static final TreePredicate hasLabelPath(java.lang.String... labels)
                                        throws java.lang.IllegalArgumentException
Returns a tree predicate for the existence of a given path of one or more edge labels.

Parameters:
labels - the local names of the labels.
Returns:
the predicate.
Throws:
java.lang.IllegalArgumentException - if invoked with null or no input.

hasLabelPath

public static final TreePredicate hasLabelPath(javax.xml.namespace.QName... labels)
                                        throws java.lang.IllegalArgumentException
Returns a tree predicate for the existence of a given path of one or more edge labels.

Parameters:
labels - the labels.
Returns:
the predicate.
Throws:
java.lang.IllegalArgumentException - if invoked with null or no input.

cond

public static EdgePredicate cond(EdgePredicate ep)
Marks an EdgePredicate as a condition.

Parameters:
ep - the predicate.
Returns:
the predicate

one

public static final EdgePredicate one(javax.xml.namespace.QName l,
                                      Predicate predicate)
Returns an One predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
(optional) - if true marks the predicate a condition predicate.
Returns:
the One predicate.

one

public static final EdgePredicate one(java.lang.String l,
                                      Predicate predicate)
Returns an One predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
(optional) - if true marks the predicate a condition predicate.
Returns:
the One predicate.

id

public static final TreePredicate id(LeafPredicate<?,?> idp,
                                     TreePredicate p)
Adds a LeafPredicate on the identifier of nodes described by a TreePredicate.

Parameters:
idp - the leaf predicate.
p - the tree predicate.
Returns:
the tree predicate.

id

public static final TreePredicate id(java.lang.String identifier,
                                     TreePredicate p)
Adds a string equality predicate on the identifier of nodes described by a TreePredicate.

Parameters:
idp - the string to compare with node identifiers.
p - the tree predicate.
Returns:
the tree predicate.

one

public static final EdgePredicate one(java.lang.String ns,
                                      java.lang.String l,
                                      Predicate predicate)
Returns an One predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
Returns:
the One predicate.

opt

public static final EdgePredicate opt(javax.xml.namespace.QName l,
                                      Predicate np)
Returns an Opt predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
Returns:
the Opt predicate.

opt

public static final EdgePredicate opt(java.lang.String l,
                                      Predicate np)
Returns an Opt predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
Returns:
the Opt predicate.

opt

public static final EdgePredicate opt(java.lang.String ns,
                                      java.lang.String l,
                                      Predicate np)
Returns an Opt predicate for a given label and a given Predicate.

Parameters:
ns - the label's namespace.
l - the label.
predicate - the predicate.
Returns:
the Opt predicate.

atleast

public static final EdgePredicate atleast(javax.xml.namespace.QName l,
                                          Predicate np)
Returns an AtLeast predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
Returns:
the AtLeast predicate.

atleast

public static final EdgePredicate atleast(java.lang.String l,
                                          Predicate np)
Returns an AtLeast predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
Returns:
the AtLeast predicate.

atleast

public static final EdgePredicate atleast(java.lang.String ns,
                                          java.lang.String l,
                                          Predicate np)
Returns an AtLeast predicate for a given label and a given Predicate.

Parameters:
the - label's namespace.
l - the label.
predicate - the predicate.
Returns:
the AtLeast predicate.

many

public static final EdgePredicate many(javax.xml.namespace.QName l,
                                       Predicate np)
Returns an Many predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
Returns:
the Many predicate.

many

public static final EdgePredicate many(java.lang.String l,
                                       Predicate np)
Returns an Many predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
Returns:
the Many predicate.

many

public static final EdgePredicate many(java.lang.String ns,
                                       java.lang.String l,
                                       Predicate np)
Returns an Many predicate for a given label and a given Predicate.

Parameters:
the - label's namespace.
l - the label.
predicate - the predicate.
Returns:
the Many predicate.

only

public static final EdgePredicate only(javax.xml.namespace.QName l,
                                       Predicate np)
Returns an Only predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
Returns:
the Only predicate.

only

public static final EdgePredicate only(java.lang.String l,
                                       Predicate np)
Returns an Only predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
Returns:
the Only predicate.

only

public static final EdgePredicate only(java.lang.String ns,
                                       java.lang.String l,
                                       Predicate np)
Returns an Only predicate for a given label and a given Predicate.

Parameters:
l - the label.
predicate - the predicate.
Returns:
the Only predicate.

tail

public static EdgePredicate tail()
Returns a predicate that matches all the children of a node not previously matched.

Returns:
the predicate.

cut

public static TreePredicate cut(TreePredicate tp)
Returns a TreePredicate that has the same EdgePredicates as another TreePredicate but removes all the edges of matching node under pruning.

Parameters:
tp - the input predicate.
Returns:
the cutting predicate.

text

public static Text text(Constraint<? super java.lang.String> c)
Returns a Text predicate with a given constraint.

Parameters:
c - the constraint.

text

public static Text text()
Returns an unconstrained Text predicate.


num

public static Num num(Constraint<? super java.lang.Double> c)
Returns a Num predicate with a given constraint.

Parameters:
c - the constraint.

num

public static Num num()
Returns an unconstrained Num predicate.


bool

public static Bool bool(Constraint<? super java.lang.Boolean> c)
Returns a Bool predicate with a given constraint.

Parameters:
c - the constraint.

bool

public static Bool bool()
Returns an unconstrained Bool predicate.


date

public static Date date(Constraint<? super java.util.Date> c)
Returns a Date predicate with a given constraint.

Parameters:
c - the constraint.

date

public static Date date()
Returns an unconstrained Date predicate.


uri

public static RID uri(Constraint<? super java.net.URI> c)
Returns a RID predicate with a given constraint.

Parameters:
c - the constraint.

uri

public static RID uri()
Returns an unconstrained RID predicate.


calendar

public static Calendar calendar(Constraint<? super java.util.Calendar> c)
Returns a Calendar predicate with a given constraint.

Parameters:
c - the constraint.

calendar

public static Calendar calendar()
Returns an unconstrained Calendar predicate.