Class MapBasedQueryWalker
java.lang.Object
org.alfresco.rest.framework.resource.parameters.where.QueryHelper.WalkerCallbackAdapter
org.alfresco.rest.workflow.api.impl.MapBasedQueryWalker
- All Implemented Interfaces:
QueryHelper.WalkerCallback
- Direct Known Subclasses:
AbstractClassImpl.ClassQueryWalker,MapBasedQueryWalkerOrSupported
Query walker that adds all properties for "equals" comparison to a map. If an unsupported property or comparison operation is encountered, an
InvalidArgumentException is thrown unless the method handleUnmatchedComparison(int, String, String) returns true (default implementation returns false).- Author:
- Frederik Heremans, Tijs Rademakers
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.alfresco.rest.framework.resource.parameters.where.QueryHelper.WalkerCallback
UNSUPPORTED -
Constructor Summary
ConstructorsConstructorDescriptionMapBasedQueryWalker(Set<String> supportedEqualsParameters, Set<String> supportedMatchesParameters) -
Method Summary
Modifier and TypeMethodDescriptionvoidand()Called any time an AND is encountered.voidcomparison(int type, String propertyName, String propertyValue, boolean negated) One of EQUALS LESSTHAN GREATERTHAN LESSTHANOREQUALS GREATERTHANOREQUALS;voidenableVariablesSupport(org.alfresco.service.namespace.NamespaceService namespaceService, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) getProperty(String propertyName, int type) getProperty(String propertyName, int type, boolean negated) Get expected value for property and comparison type.<T> TgetProperty(String propertyName, int type, Class<T> returnType) Get the property value, converted to the requested type.protected booleanhandleUnmatchedComparison(int type, String propertyName, String propertyValue) Called when unsupported property is encountered or comparison operator other than equals.voidCalled any time a MATCHES clause is encountered.protected voidprocessVariable(String propertyName, String propertyValue, int type) voidsetSupportedGreaterThanOrEqualParameters(Set<String> supportedGreaterThanOrEqualParameters) voidsetSupportedGreaterThanParameters(Set<String> supportedGreaterThanParameters) voidsetSupportedLessThanOrEqualParameters(Set<String> supportedLessThanOrEqualParameters) voidsetSupportedLessThanParameters(Set<String> supportedLessThanParameters) 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
between, exists, in, or
-
Constructor Details
-
MapBasedQueryWalker
-
-
Method Details
-
setSupportedGreaterThanParameters
-
setSupportedGreaterThanOrEqualParameters
-
setSupportedLessThanParameters
-
setSupportedLessThanOrEqualParameters
-
enableVariablesSupport
public void enableVariablesSupport(org.alfresco.service.namespace.NamespaceService namespaceService, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) -
getVariableProperties
-
matches
Description copied from interface:QueryHelper.WalkerCallbackCalled any time a MATCHES clause is encountered.- Parameters:
property- Name of the propertyvalue- Stringnegated- returns true if "NOT MATCHES" was used
-
comparison
Description copied from interface:QueryHelper.WalkerCallbackOne of EQUALS LESSTHAN GREATERTHAN LESSTHANOREQUALS GREATERTHANOREQUALS; -
getProperty
Get expected value for property and comparison type. This class supports only non-negated comparisons, thus parameter negated is ignored in bellow method. -
getProperty
-
getProperty
Get the property value, converted to the requested type.- Parameters:
propertyName- name of the parametertype- intreturnType- type of object to return- Returns:
- the converted parameter value. Null, if the property has no value.
- Throws:
IllegalArgumentException- when no conversion for the given returnType is available or if returnType is null.InvalidArgumentException- when conversion to the given type was not possible due to an error while converting
-
and
public void and()Description copied from interface:QueryHelper.WalkerCallbackCalled any time an AND is encountered. -
processVariable
-
handleUnmatchedComparison
Called when unsupported property is encountered or comparison operator other than equals.- Returns:
- true, if the comparison is handles successfully. False, if an exception should be thrown because the comparison can't be handled.
-