Class BasicQueryWalker
java.lang.Object
org.alfresco.rest.framework.resource.parameters.where.QueryHelper.WalkerCallbackAdapter
org.alfresco.rest.framework.resource.parameters.where.BasicQueryWalker
- All Implemented Interfaces:
QueryHelper.WalkerCallback
Basic implementation of
QueryHelper.WalkerCallbackAdapter providing universal handling of Where query clauses. This implementation supports AND operator and all clause types. Be default, walker verifies strictly if expected or unexpected properties, and it's comparison types are present in query and throws InvalidQueryException if they are missing.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanFields inherited from interface org.alfresco.rest.framework.resource.parameters.where.QueryHelper.WalkerCallback
UNSUPPORTED -
Constructor Summary
ConstructorsConstructorDescriptionBasicQueryWalker(String... expectedPropertyNames) BasicQueryWalker(Collection<String> expectedPropertyNames) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddProperties(String propertyName, int clauseType, boolean negated, String... propertyValues) protected voidaddProperties(String propertyName, int clauseType, String... propertyValues) voidand()Called any time an AND is encountered.voidCalled any time a BETWEEN clause is encountered.voidcomparison(int type, String propertyName, String propertyValue, boolean negated) One of EQUALS LESSTHAN GREATERTHAN LESSTHANOREQUALS GREATERTHANOREQUALS;protected booleancontainsProperty(String propertyName) protected booleancontainsProperty(String propertyName, int clauseType, boolean negated) voidCalled any time an EXISTS clause is encountered.getProperties(String... propertyNames) getPropertiesAsMap(String... propertyNames) getProperty(String propertyName) getProperty(String propertyName, int type, boolean negated) voidCalled any time an IN clause is encountered.protected booleanvoidCalled any time a MATCHES clause is encountered.voidsetClausesNegatable(boolean clausesNegatable) voidsetValidateStrictly(boolean validateStrictly) protected voidverifyClausesNegatability(boolean negated, String propertyName) Verify if clause negations are allowed, if not throwsInvalidQueryException.protected voidverifyPropertyExpectedness(String propertyName) Verify if property is expected, if not throwsInvalidQueryException.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.alfresco.rest.framework.resource.parameters.where.QueryHelper.WalkerCallback
or
-
Field Details
-
clausesNegatable
protected boolean clausesNegatable -
validateStrictly
protected boolean validateStrictly
-
-
Constructor Details
-
BasicQueryWalker
public BasicQueryWalker() -
BasicQueryWalker
-
BasicQueryWalker
-
-
Method Details
-
setClausesNegatable
public void setClausesNegatable(boolean clausesNegatable) -
setValidateStrictly
public void setValidateStrictly(boolean validateStrictly) -
exists
Description copied from interface:QueryHelper.WalkerCallbackCalled any time an EXISTS clause is encountered.- Parameters:
propertyName- Name of the propertynegated- returns true if "NOT EXISTS" was used
-
between
Description copied from interface:QueryHelper.WalkerCallbackCalled any time a BETWEEN clause is encountered.- Parameters:
propertyName- Name of the propertyfirstValue- StringsecondValue- Stringnegated- returns true if "NOT BETWEEN" was used
-
comparison
Description copied from interface:QueryHelper.WalkerCallbackOne of EQUALS LESSTHAN GREATERTHAN LESSTHANOREQUALS GREATERTHANOREQUALS; -
in
Description copied from interface:QueryHelper.WalkerCallbackCalled any time an IN clause is encountered.- Parameters:
propertyName- Name of the propertynegated- returns true if "NOT IN" was usedpropertyValues- the property values
-
matches
Description copied from interface:QueryHelper.WalkerCallbackCalled any time a MATCHES clause is encountered.- Parameters:
propertyName- Name of the propertypropertyValue- Stringnegated- returns true if "NOT MATCHES" was used
-
and
public void and()Description copied from interface:QueryHelper.WalkerCallbackCalled any time an AND is encountered. -
verifyPropertyExpectedness
Verify if property is expected, if not throwsInvalidQueryException. -
verifyClausesNegatability
Verify if clause negations are allowed, if not throwsInvalidQueryException. -
isAndSupported
protected boolean isAndSupported() -
addProperties
-
addProperties
-
containsProperty
-
containsProperty
-
getProperty
-
getProperty
-
getProperties
-
getPropertiesAsMap
-