Enum Operator
- All Implemented Interfaces:
Serializable,Comparable<Operator>,java.lang.constant.Constable
Enumeration of the JCR 2.0 query operators.
- Since:
- Apache Jackrabbit 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptioncomparison(QueryObjectModelFactory factory, DynamicOperand left, StaticOperand right) Returns a comparison between the given operands using this operator.Formats an SQL constraint with this operator and the given operands.formatXpath(String a, String b) Formats an XPath constraint with this operator and the given operands.static String[]Returns an array of the names of all the JCR 2.0 query operators.static OperatorgetOperatorByName(String name) Returns the operator with the given JCR name.toString()Returns the JCR 2.0 name of this query operator.static OperatorReturns 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.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Enum Constant Details
-
EQ
-
NE
-
GT
-
GE
-
LT
-
LE
-
LIKE
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
comparison
public Comparison comparison(QueryObjectModelFactory factory, DynamicOperand left, StaticOperand right) throws RepositoryException Returns a comparison between the given operands using this operator.- Parameters:
factory- factory for creating the comparisonleft- operand on the left hand sideright- operand on the right hand side- Returns:
- comparison
- Throws:
RepositoryException- if the comparison can not be created
-
formatXpath
Formats an XPath constraint with this operator and the given operands. The operands are simply used as-is, without any quoting or escaping.- Parameters:
a- first operandb- second operand- Returns:
- XPath constraint,
a op borjcr:like(a, b)forLIKE
-
formatSql
Formats an SQL constraint with this operator and the given operands. The operands are simply used as-is, without any quoting or escaping.- Parameters:
a- first operandb- second operand- Returns:
- SQL constraint,
a op b
-
toString
Returns the JCR 2.0 name of this query operator. -
getAllQueryOperators
Returns an array of the names of all the JCR 2.0 query operators.- Returns:
- names of all query operators
-
getOperatorByName
Returns the operator with the given JCR name.- Parameters:
name- JCR name of an operator- Returns:
- operator with the given name
- Throws:
RepositoryException- if the given name is unknown
-