public enum Operator extends Enum<Operator>
Modifier and Type | Method and Description |
---|---|
Comparison |
comparison(QueryObjectModelFactory factory,
DynamicOperand left,
StaticOperand right)
Returns a comparison between the given operands using this operator.
|
String |
formatSql(String a,
String b)
Formats an SQL constraint with this operator and the given operands.
|
String |
formatXpath(String a,
String b)
Formats an XPath constraint with this operator and the given operands.
|
static String[] |
getAllQueryOperators()
Returns an array of the names of all the JCR 2.0 query operators.
|
static Operator |
getOperatorByName(String name)
Returns the operator with the given JCR name.
|
String |
toString()
Returns the JCR 2.0 name of this query operator.
|
static Operator |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Operator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Operator EQ
public static final Operator NE
public static final Operator GT
public static final Operator GE
public static final Operator LT
public static final Operator LE
public static final Operator LIKE
public static Operator[] values()
for (Operator c : Operator.values()) System.out.println(c);
public static Operator valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic Comparison comparison(QueryObjectModelFactory factory, DynamicOperand left, StaticOperand right) throws RepositoryException
factory
- factory for creating the comparisonleft
- operand on the left hand sideright
- operand on the right hand sideRepositoryException
- if the comparison can not be createdpublic String formatXpath(String a, String b)
a
- first operandb
- second operanda op b
or
jcr:like(a, b)
for LIKE
public String formatSql(String a, String b)
a
- first operandb
- second operanda op b
public String toString()
toString
in class Enum<Operator>
QueryObjectModelConstants
public static String[] getAllQueryOperators()
public static Operator getOperatorByName(String name) throws RepositoryException
name
- JCR name of an operatorRepositoryException
- if the given name is unknownCopyright © 2004–2022 The Apache Software Foundation. All rights reserved.