aicas logoJamaica 6.4 release 1

javax.management
Class Query

java.lang.Object
  extended by javax.management.Query

public class Query
extends Object

Constructs query object constraints.

The MBean Server can be queried for MBeans that meet a particular condition, using its queryNames or queryMBeans method. The QueryExp parameter to the method can be any implementation of the interface QueryExp, but it is usually best to obtain the QueryExp value by calling the static methods in this class. This is particularly true when querying a remote MBean Server: a custom implementation of the QueryExp interface might not be present in the remote MBean Server, but the methods in this class return only standard classes that are part of the JMX implementation.

There are two ways to create QueryExp objects using the methods in this class. The first is to build them by chaining together calls to the various methods. The second is to use the Query Language described below and produce the QueryExp by calling Query.fromString. The two ways are equivalent: every QueryExp returned by fromString can also be constructed by chaining method calls.

As an example, suppose you wanted to find all MBeans where the Enabled attribute is true and the Owner attribute is "Duke". Here is how you could construct the appropriate QueryExp by chaining together method calls:

 QueryExp query =
     Query.and(Query.eq(Query.attr("Enabled"), Query.value(true)),
               Query.eq(Query.attr("Owner"), Query.value("Duke")));
 

Here is how you could construct the same QueryExp using the Query Language:

 QueryExp query = Query.fromString("Enabled = true and Owner = 'Duke'");
 

The principal advantage of the method-chaining approach is that the compiler will check that the query makes sense. The principal advantage of the Query Language approach is that it is easier to write and especially read.

Query Language

The query language is closely modeled on the WHERE clause of SQL SELECT statements. The formal specification of the language appears below, but it is probably easier to understand it with examples such as the following.

Message = 'OK'
Selects MBeans that have a Message attribute whose value is the string OK.
FreeSpacePercent < 10
Selects MBeans that have a FreeSpacePercent attribute whose value is a number less than 10.
FreeSpacePercent < 10 and WarningSent = false
Selects the same MBeans as the previous example, but they must also have a boolean attribute WarningSent whose value is false.
SpaceUsed > TotalSpace * (2.0 / 3.0)
Selects MBeans that have SpaceUsed and TotalSpace attributes where the first is more than two-thirds the second.
not (FreeSpacePercent between 10 and 90)
Selects MBeans that have a FreeSpacePercent attribute whose value is not between 10 and 90, inclusive.
FreeSpacePercent not between 10 and 90
Another way of writing the previous query.
Status in ('STOPPED', 'STARTING', 'STARTED')
Selects MBeans that have a Status attribute whose value is one of those three strings.
Message like 'OK: %'
Selects MBeans that have a Message attribute whose value is a string beginning with "OK: ". Notice that the wildcard characters are SQL's ones. In the query language, % means "any sequence of characters" and _ means "any single character". In the rest of the JMX API, these correspond to * and % respectively.
instanceof 'javax.management.NotificationBroadcaster'
Selects MBeans that are instances of NotificationBroadcaster, as reported by MBeanServer.isInstanceOf.
like 'mydomain:*'
Selects MBeans whose ObjectNames have the domain mydomain.

The last two examples do not correspond to valid SQL syntax, but all the others do.

The remainder of this description is a formal specification of the query language.

Lexical elements

Keywords such as and, like, and between are not case sensitive. You can write between, BETWEEN, or BeTwEeN with the same effect.

On the other hand, attribute names are case sensitive. The attribute Name is not the same as the attribute name.

To access an attribute whose name, ignoring case, is the same as one of the keywords not, instanceof, like, true, or false, you can use double quotes, for example "not". Double quotes can also be used to include non-identifier characters in the name of an attribute, for example "attribute-name-with-hyphens". To include the double quote character in the attribute name, write it twice. "foo""bar""baz" represents the attribute called foo"bar"baz.

String constants are written with single quotes like 'this'. A single quote within a string constant must be doubled, for example 'can''t'.

Integer constants are written as a sequence of decimal digits, optionally preceded by a plus or minus sign. An integer constant must be a valid input to Long.valueOf(String).

Floating-point constants are written using the Java syntax. A floating-point constant must be a valid input to Double.valueOf(String).

A boolean constant is either true or false, ignoring case.

Spaces cannot appear inside identifiers (unless written with double quotes) or keywords or multi-character tokens such as <=. Spaces can appear anywhere else, but are not required except to separate tokens. For example, the query a < b and 5 = c could also be written a<b and 5=c, but no further spaces can be removed.

Grammar

query:
andquery [OR query]
andquery:
predicate [AND andquery]
predicate:
( query ) |
NOT predicate |
INSTANCEOF stringvalue |
LIKE objectnamepattern |
value predrhs
predrhs:
compare value |
[NOT] BETWEEN value AND value |
[NOT] IN ( value commavalues ) |
[NOT] LIKE stringvalue
commavalues:
[ , value commavalues ]
compare:
= | < | > | <= | >= | <> | !=
value:
factor [plusorminus value]
plusorminus:
+ | -
factor:
term [timesordivide factor]
timesordivide:
* | /
term:
attr | literal | ( value )
attr:
name [# name]
name:
identifier [.name]
identifier:
Java-identifier | double-quoted-identifier
literal:
booleanlit | longlit | doublelit | stringlit
booleanlit:
FALSE | TRUE
stringvalue:
stringlit
objectnamepattern:
stringlit

Semantics

The meaning of the grammar is described in the table below. This defines a function q that maps a string to a Java object such as a QueryExp or a ValueExp.

String sq(s)
query1 OR query2 Query.or(q(query1), q(query2))
query1 AND query2 Query.and(q(query1), q(query2))
( queryOrValue ) q(queryOrValue)
NOT query Query.not(q(query))
INSTANCEOF stringLiteral Query.isInstanceOf(Query.value(q(stringLiteral)))
LIKE stringLiteral new ObjectName(q(stringLiteral))
value1 = value2 Query.eq(q(value1), q(value2))
value1 < value2 Query.lt(q(value1), q(value2))
value1 > value2 Query.gt(q(value1), q(value2))
value1 <= value2 Query.leq(q(value1), q(value2))
value1 >= value2 Query.geq(q(value1), q(value2))
value1 <> value2 Query.not(Query.eq(q(value1), q(value2)))
value1 != value2 Query.not(Query.eq(q(value1), q(value2)))
value1 BETWEEN value2 AND value3 Query.between(q(value1), q(value2), q(value3))
value1 NOT BETWEEN value2 AND value3 Query.not(Query.between(q(value1), q(value2), q(value3)))
value1 IN ( value2, value3 ) Query.in(q(value1), new ValueExp[] { q(value2), q(value3)})
value1 NOT IN ( value2, value3 ) Query.not(Query.in(q(value1), new ValueExp[] { q(value2), q(value3)}))
value LIKE stringLiteral Query.match(q(value), translateWildcards(q(stringLiteral)))
value NOT LIKE stringLiteral Query.not(Query.match(q(value), translateWildcards(q(stringLiteral))))
value1 + value2 Query.plus(q(value1), q(value2))
value1 - value2 Query.minus(q(value1), q(value2))
value1 * value2 Query.times(q(value1), q(value2))
value1 / value2 Query.div(q(value1), q(value2))
name Query.attr(q(name))
name1#name2 Query.attr(q(name1), q(name2))
FALSE Query.value(false)
TRUE Query.value(true)
decimalLiteral Query.value(Long.valueOf(decimalLiteral))
floatingPointLiteral Query.value(Double.valueOf(floatingPointLiteral))

Here, translateWildcards is a function that translates from the SQL notation for wildcards, using % and _, to the JMX API notation, using * and ?. If the LIKE string already contains * or ?, these characters have their literal meanings, and will be quoted in the call to Query.match.

Since:
1.5

Field Summary
static int DIV
          A code representing the div(javax.management.ValueExp, javax.management.ValueExp) expression.
static int EQ
          A code representing the eq(javax.management.ValueExp, javax.management.ValueExp) query.
static int GE
          A code representing the geq(javax.management.ValueExp, javax.management.ValueExp) query.
static int GT
          A code representing the gt(javax.management.ValueExp, javax.management.ValueExp) query.
static int LE
          A code representing the leq(javax.management.ValueExp, javax.management.ValueExp) query.
static int LT
          A code representing the lt(javax.management.ValueExp, javax.management.ValueExp) query.
static int MINUS
          A code representing the minus(javax.management.ValueExp, javax.management.ValueExp) expression.
static int PLUS
          A code representing the plus(javax.management.ValueExp, javax.management.ValueExp) expression.
static int TIMES
          A code representing the times(javax.management.ValueExp, javax.management.ValueExp) expression.
 
Constructor Summary
Query()
          Basic constructor.
 
Method Summary
static QueryExp and(QueryExp q1, QueryExp q2)
          Returns a query expression that is the conjunction of two other query expressions.
static QueryExp anySubString(AttributeValueExp a, StringValueExp s)
          Returns a query expression that represents a matching constraint on a string argument.
static AttributeValueExp attr(String name)
          Returns a new attribute expression.
static AttributeValueExp attr(String className, String name)
          Returns a new qualified attribute expression.
static QueryExp between(ValueExp v1, ValueExp v2, ValueExp v3)
          Returns a query expression that represents the constraint that one value is between two other values.
static AttributeValueExp classattr()
          Returns a new class attribute expression which can be used in any Query call that expects a ValueExp.
static ValueExp div(ValueExp value1, ValueExp value2)
          Returns a binary expression representing the quotient of two numeric values.
static QueryExp eq(ValueExp v1, ValueExp v2)
          Returns a query expression that represents an equality constraint on two values.
static QueryExp finalSubString(AttributeValueExp a, StringValueExp s)
          Returns a query expression that represents a matching constraint on a string argument.
static QueryExp fromString(String s)
          Produce a query from the given string.
static QueryExp geq(ValueExp v1, ValueExp v2)
          Returns a query expression that represents a "greater than or equal to" constraint on two values.
static QueryExp gt(ValueExp v1, ValueExp v2)
          Returns a query expression that represents a "greater than" constraint on two values.
static QueryExp in(ValueExp val, ValueExp[] valueList)
          Returns an expression constraining a value to be one of an explicit list.
static QueryExp initialSubString(AttributeValueExp a, StringValueExp s)
          Returns a query expression that represents a matching constraint on a string argument.
static QueryExp isInstanceOf(StringValueExp classNameValue)
          Returns a query expression that represents an inheritance constraint on an MBean class.
static QueryExp leq(ValueExp v1, ValueExp v2)
          Returns a query expression that represents a "less than or equal to" constraint on two values.
static QueryExp lt(ValueExp v1, ValueExp v2)
          Returns a query expression that represents a "less than" constraint on two values.
static QueryExp match(AttributeValueExp a, StringValueExp s)
          Returns a query expression that represents a matching constraint on a string argument.
static ValueExp minus(ValueExp value1, ValueExp value2)
          Returns a binary expression representing the difference between two numeric values.
static QueryExp not(QueryExp queryExp)
          Returns a constraint that is the negation of its argument.
static QueryExp or(QueryExp q1, QueryExp q2)
          Returns a query expression that is the disjunction of two other query expressions.
static ValueExp plus(ValueExp value1, ValueExp value2)
          Returns a binary expression representing the sum of two numeric values, or the concatenation of two string values.
static ValueExp times(ValueExp value1, ValueExp value2)
          Returns a binary expression representing the product of two numeric values.
static String toString(QueryExp query)
          Return a string representation of the given query.
static ValueExp value(boolean val)
          Returns a boolean value expression that can be used in any Query call that expects a ValueExp.
static ValueExp value(double val)
          Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
static ValueExp value(float val)
          Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
static ValueExp value(int val)
          Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
static ValueExp value(long val)
          Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
static ValueExp value(Number val)
          Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
static StringValueExp value(String val)
          Returns a new string expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GT

public static final int GT
A code representing the gt(javax.management.ValueExp, javax.management.ValueExp) query. This is chiefly of interest for the serialized form of queries.

See Also:
Constant Field Values

LT

public static final int LT
A code representing the lt(javax.management.ValueExp, javax.management.ValueExp) query. This is chiefly of interest for the serialized form of queries.

See Also:
Constant Field Values

GE

public static final int GE
A code representing the geq(javax.management.ValueExp, javax.management.ValueExp) query. This is chiefly of interest for the serialized form of queries.

See Also:
Constant Field Values

LE

public static final int LE
A code representing the leq(javax.management.ValueExp, javax.management.ValueExp) query. This is chiefly of interest for the serialized form of queries.

See Also:
Constant Field Values

EQ

public static final int EQ
A code representing the eq(javax.management.ValueExp, javax.management.ValueExp) query. This is chiefly of interest for the serialized form of queries.

See Also:
Constant Field Values

PLUS

public static final int PLUS
A code representing the plus(javax.management.ValueExp, javax.management.ValueExp) expression. This is chiefly of interest for the serialized form of queries.

See Also:
Constant Field Values

MINUS

public static final int MINUS
A code representing the minus(javax.management.ValueExp, javax.management.ValueExp) expression. This is chiefly of interest for the serialized form of queries.

See Also:
Constant Field Values

TIMES

public static final int TIMES
A code representing the times(javax.management.ValueExp, javax.management.ValueExp) expression. This is chiefly of interest for the serialized form of queries.

See Also:
Constant Field Values

DIV

public static final int DIV
A code representing the div(javax.management.ValueExp, javax.management.ValueExp) expression. This is chiefly of interest for the serialized form of queries.

See Also:
Constant Field Values
Constructor Detail

Query

public Query()
Basic constructor.

Method Detail

and

public static QueryExp and(QueryExp q1,
                           QueryExp q2)
Returns a query expression that is the conjunction of two other query expressions.

Parameters:
q1 - A query expression.
q2 - Another query expression.
Returns:
The conjunction of the two arguments. The returned object will be serialized as an instance of the non-public class javax.management.AndQueryExp.

or

public static QueryExp or(QueryExp q1,
                          QueryExp q2)
Returns a query expression that is the disjunction of two other query expressions.

Parameters:
q1 - A query expression.
q2 - Another query expression.
Returns:
The disjunction of the two arguments. The returned object will be serialized as an instance of the non-public class javax.management.OrQueryExp.

gt

public static QueryExp gt(ValueExp v1,
                          ValueExp v2)
Returns a query expression that represents a "greater than" constraint on two values.

Parameters:
v1 - A value expression.
v2 - Another value expression.
Returns:
A "greater than" constraint on the arguments. The returned object will be serialized as an instance of the non-public class javax.management.BinaryRelQueryExp with a relOp equal to GT.

geq

public static QueryExp geq(ValueExp v1,
                           ValueExp v2)
Returns a query expression that represents a "greater than or equal to" constraint on two values.

Parameters:
v1 - A value expression.
v2 - Another value expression.
Returns:
A "greater than or equal to" constraint on the arguments. The returned object will be serialized as an instance of the non-public class javax.management.BinaryRelQueryExp with a relOp equal to GE.

leq

public static QueryExp leq(ValueExp v1,
                           ValueExp v2)
Returns a query expression that represents a "less than or equal to" constraint on two values.

Parameters:
v1 - A value expression.
v2 - Another value expression.
Returns:
A "less than or equal to" constraint on the arguments. The returned object will be serialized as an instance of the non-public class javax.management.BinaryRelQueryExp with a relOp equal to LE.

lt

public static QueryExp lt(ValueExp v1,
                          ValueExp v2)
Returns a query expression that represents a "less than" constraint on two values.

Parameters:
v1 - A value expression.
v2 - Another value expression.
Returns:
A "less than" constraint on the arguments. The returned object will be serialized as an instance of the non-public class javax.management.BinaryRelQueryExp with a relOp equal to LT.

eq

public static QueryExp eq(ValueExp v1,
                          ValueExp v2)
Returns a query expression that represents an equality constraint on two values.

Parameters:
v1 - A value expression.
v2 - Another value expression.
Returns:
A "equal to" constraint on the arguments. The returned object will be serialized as an instance of the non-public class javax.management.BinaryRelQueryExp with a relOp equal to EQ.

between

public static QueryExp between(ValueExp v1,
                               ValueExp v2,
                               ValueExp v3)
Returns a query expression that represents the constraint that one value is between two other values.

Parameters:
v1 - A value expression that is "between" v2 and v3.
v2 - Value expression that represents a boundary of the constraint.
v3 - Value expression that represents a boundary of the constraint.
Returns:
The constraint that v1 lies between v2 and v3. The returned object will be serialized as an instance of the non-public class javax.management.BetweenQueryExp.

match

public static QueryExp match(AttributeValueExp a,
                             StringValueExp s)
Returns a query expression that represents a matching constraint on a string argument. The matching syntax is consistent with file globbing: supports "?", "*", "[", each of which may be escaped with "\"; character classes may use "!" for negation and "-" for range. (* for any character sequence, ? for a single arbitrary character, [...] for a character sequence). For example: a*b?c would match a string starting with the character a, followed by any number of characters, followed by a b, any single character, and a c.

Parameters:
a - An attribute expression
s - A string value expression representing a matching constraint
Returns:
A query expression that represents the matching constraint on the string argument. The returned object will be serialized as an instance of the non-public class javax.management.MatchQueryExp.

attr

public static AttributeValueExp attr(String name)

Returns a new attribute expression. See AttributeValueExp for a detailed description of the semantics of the expression.

Parameters:
name - The name of the attribute.
Returns:
An attribute expression for the attribute named name.

attr

public static AttributeValueExp attr(String className,
                                     String name)

Returns a new qualified attribute expression.

Evaluating this expression for a given objectName includes performing MBeanServer.getObjectInstance(objectName) and MBeanServer.getAttribute(objectName, name).

Parameters:
className - The name of the class possessing the attribute.
name - The name of the attribute.
Returns:
An attribute expression for the attribute named name. The returned object will be serialized as an instance of the non-public class javax.management.QualifiedAttributeValueExp.

classattr

public static AttributeValueExp classattr()

Returns a new class attribute expression which can be used in any Query call that expects a ValueExp.

Evaluating this expression for a given objectName includes performing MBeanServer.getObjectInstance(objectName).

Returns:
A class attribute expression. The returned object will be serialized as an instance of the non-public class javax.management.ClassAttributeValueExp.

not

public static QueryExp not(QueryExp queryExp)
Returns a constraint that is the negation of its argument.

Parameters:
queryExp - The constraint to negate.
Returns:
A negated constraint. The returned object will be serialized as an instance of the non-public class javax.management.NotQueryExp.

in

public static QueryExp in(ValueExp val,
                          ValueExp[] valueList)
Returns an expression constraining a value to be one of an explicit list.

Parameters:
val - A value to be constrained.
valueList - An array of ValueExps.
Returns:
A QueryExp that represents the constraint. The returned object will be serialized as an instance of the non-public class javax.management.InQueryExp.

value

public static StringValueExp value(String val)
Returns a new string expression.

Parameters:
val - The string value.
Returns:
A ValueExp object containing the string argument.

value

public static ValueExp value(Number val)
Returns a numeric value expression that can be used in any Query call that expects a ValueExp.

Parameters:
val - An instance of Number.
Returns:
A ValueExp object containing the argument. The returned object will be serialized as an instance of the non-public class javax.management.NumericValueExp.

value

public static ValueExp value(int val)
Returns a numeric value expression that can be used in any Query call that expects a ValueExp.

Parameters:
val - An int value.
Returns:
A ValueExp object containing the argument. The returned object will be serialized as an instance of the non-public class javax.management.NumericValueExp.

value

public static ValueExp value(long val)
Returns a numeric value expression that can be used in any Query call that expects a ValueExp.

Parameters:
val - A long value.
Returns:
A ValueExp object containing the argument. The returned object will be serialized as an instance of the non-public class javax.management.NumericValueExp.

value

public static ValueExp value(float val)
Returns a numeric value expression that can be used in any Query call that expects a ValueExp.

Parameters:
val - A float value.
Returns:
A ValueExp object containing the argument. The returned object will be serialized as an instance of the non-public class javax.management.NumericValueExp.

value

public static ValueExp value(double val)
Returns a numeric value expression that can be used in any Query call that expects a ValueExp.

Parameters:
val - A double value.
Returns:
A ValueExp object containing the argument. The returned object will be serialized as an instance of the non-public class javax.management.NumericValueExp.

value

public static ValueExp value(boolean val)
Returns a boolean value expression that can be used in any Query call that expects a ValueExp.

Parameters:
val - A boolean value.
Returns:
A ValueExp object containing the argument. The returned object will be serialized as an instance of the non-public class javax.management.BooleanValueExp.

plus

public static ValueExp plus(ValueExp value1,
                            ValueExp value2)
Returns a binary expression representing the sum of two numeric values, or the concatenation of two string values.

Parameters:
value1 - The first '+' operand.
value2 - The second '+' operand.
Returns:
A ValueExp representing the sum or concatenation of the two arguments. The returned object will be serialized as an instance of the non-public class javax.management.BinaryOpValueExp with an op equal to PLUS.

times

public static ValueExp times(ValueExp value1,
                             ValueExp value2)
Returns a binary expression representing the product of two numeric values.

Parameters:
value1 - The first '*' operand.
value2 - The second '*' operand.
Returns:
A ValueExp representing the product. The returned object will be serialized as an instance of the non-public class javax.management.BinaryOpValueExp with an op equal to TIMES.

minus

public static ValueExp minus(ValueExp value1,
                             ValueExp value2)
Returns a binary expression representing the difference between two numeric values.

Parameters:
value1 - The first '-' operand.
value2 - The second '-' operand.
Returns:
A ValueExp representing the difference between two arguments. The returned object will be serialized as an instance of the non-public class javax.management.BinaryOpValueExp with an op equal to MINUS.

div

public static ValueExp div(ValueExp value1,
                           ValueExp value2)
Returns a binary expression representing the quotient of two numeric values.

Parameters:
value1 - The first '/' operand.
value2 - The second '/' operand.
Returns:
A ValueExp representing the quotient of two arguments. The returned object will be serialized as an instance of the non-public class javax.management.BinaryOpValueExp with an op equal to DIV.

initialSubString

public static QueryExp initialSubString(AttributeValueExp a,
                                        StringValueExp s)
Returns a query expression that represents a matching constraint on a string argument. The value must start with the given literal string value.

Parameters:
a - An attribute expression.
s - A string value expression representing the beginning of the string value.
Returns:
The constraint that a matches s. The returned object will be serialized as an instance of the non-public class javax.management.MatchQueryExp.

anySubString

public static QueryExp anySubString(AttributeValueExp a,
                                    StringValueExp s)
Returns a query expression that represents a matching constraint on a string argument. The value must contain the given literal string value.

Parameters:
a - An attribute expression.
s - A string value expression representing the substring.
Returns:
The constraint that a matches s. The returned object will be serialized as an instance of the non-public class javax.management.MatchQueryExp.

finalSubString

public static QueryExp finalSubString(AttributeValueExp a,
                                      StringValueExp s)
Returns a query expression that represents a matching constraint on a string argument. The value must end with the given literal string value.

Parameters:
a - An attribute expression.
s - A string value expression representing the end of the string value.
Returns:
The constraint that a matches s. The returned object will be serialized as an instance of the non-public class javax.management.MatchQueryExp.

isInstanceOf

public static QueryExp isInstanceOf(StringValueExp classNameValue)
Returns a query expression that represents an inheritance constraint on an MBean class.

Example: to find MBeans that are instances of NotificationBroadcaster, use Query.isInstanceOf(Query.value(NotificationBroadcaster.class.getName())).

Evaluating this expression for a given objectName includes performing MBeanServer.isInstanceOf(objectName, ((StringValueExp)classNameValue.apply(objectName)).getValue().

Parameters:
classNameValue - The StringValueExp returning the name of the class of which selected MBeans should be instances.
Returns:
a query expression that represents an inheritance constraint on an MBean class. The returned object will be serialized as an instance of the non-public class javax.management.InstanceOfQueryExp.
Since:
1.6

toString

public static String toString(QueryExp query)

Return a string representation of the given query. The string returned by this method can be converted back into an equivalent query using fromString.

(Two queries are equivalent if they produce the same result in all cases. Equivalent queries are not necessarily identical: for example the queries Query.lt(Query.attr("A"), Query.attr("B")) and Query.not(Query.ge(Query.attr("A"), Query.attr("B"))) are equivalent but not identical.)

The string returned by this method is only guaranteed to be converted back into an equivalent query if query was constructed, or could have been constructed, using the methods of this class. If you make a custom query myQuery by implementing QueryExp yourself then the result of Query.toString(myQuery) is unspecified.

Parameters:
query - the query to convert. If it is null, the result will also be null.
Returns:
the string representation of the query, or null if the query is null.
Since:
1.7

fromString

public static QueryExp fromString(String s)

Produce a query from the given string. The query returned by this method can be converted back into a string using toString. The resultant string will not necessarily be equal to s.

Parameters:
s - the string to convert.
Returns:
a QueryExp derived by parsing the string, or null if the string is null.
Throws:
IllegalArgumentException - if the string is not a valid query string.
Since:
1.7

aicas logoJamaica 6.4 release 1

aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2015 aicas GmbH. All Rights Reserved.