|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.module.Query
public abstract class Query
This class represents a query that determines whether or not a particular
module definition matches some criteria. The static methods provided return
query that may be used in matching ModuleDefinition
.
Composition of calls can construct arbitrary nestings of constraints, as
the following example illustrates:
Query query = Query.and(Query.name("com.wombat.webservice"), Query.versionRange("2.0.0+"));
ModuleDefinition
,
VersionConstraint
,
Serialized FormField Summary | |
---|---|
static Query |
ANY
A Query object that matches everything. |
Constructor Summary | |
---|---|
protected |
Query()
Creates a new Query instance. |
Method Summary | |
---|---|
static Query |
and(Query query1,
Query query2)
Returns a Query that is the conjunction of two other queries. |
static Query |
attribute(String name)
Returns a Query that requires the specified name of a module attribute
exists. |
static Query |
attribute(String name,
String value)
Returns a Query that requires an attribute of a module definition
matches the specified name and value. |
abstract boolean |
match(ModuleDefinition target)
Determine if the specified module definition matches this query. |
static Query |
name(String name)
Returns a Query that requires the name of a module definition equals
to the specified name. |
static Query |
not(Query query)
Returns a Query that inverts the specified query. |
static Query |
or(Query query1,
Query query2)
Returns a Query that is the disjunction of two other queries. |
static Query |
version(String source)
Returns a Query that requires the version of a module definition
to be contained within any of the ranges known to the specified
version constraint. |
static Query |
version(VersionConstraint versionConstraint)
Returns a Query that requires the version of a module definition
to be contained within any of the ranges known to the specified
version constraint. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Query ANY
Query
object that matches everything.
Constructor Detail |
---|
protected Query()
Query
instance.
Method Detail |
---|
public static Query not(Query query)
Query
that inverts the specified query.
query
- the specified query.
Query
object.
NullPointerException
- if query is null.public static Query and(Query query1, Query query2)
Query
that is the conjunction of two other queries.
query1
- A query.query2
- Another query.
Query
object.
NullPointerException
- if query1 is null or query2 is null.public static Query or(Query query1, Query query2)
Query
that is the disjunction of two other queries.
query1
- A query.query2
- Another query.
Query
object.
NullPointerException
- if query1 is null or query2 is null.public static Query version(String source)
Query
that requires the version of a module definition
to be contained within any of the ranges known to the specified
version constraint. The string must not contain any leading or trailing
whitespace.
source
- the string to be parsed.
Query
object.
IllegalArgumentException
- if the string does not follow
the version constraint format.
NullPointerException
- if source is null.public static Query version(VersionConstraint versionConstraint)
Query
that requires the version of a module definition
to be contained within any of the ranges known to the specified
version constraint.
versionConstraint
- the VersionConstraint
object.
Query
object.
NullPointerException
- if versionConstraint is null.public static Query name(String name)
Query
that requires the name of a module definition equals
to the specified name.
name
- the name of the module definition.
Query
object.
NullPointerException
- if name is null.public static Query attribute(String name)
Query
that requires the specified name of a module attribute
exists.
name
- the name of the module attribute.
Query
object.
NullPointerException
- if name is null.public static Query attribute(String name, String value)
Query
that requires an attribute of a module definition
matches the specified name and value.
name
- the name of the module attribute.value
- the value of the module attribute.
Query
object.
NullPointerException
- if name is null or value is null.public abstract boolean match(ModuleDefinition target)
target
- the ModuleDefinition
to be matched.
ModuleDefinition
matches this
query.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |