Class MapBasedQueryWalker

    • Constructor Summary

      Constructors 
      Constructor Description
      MapBasedQueryWalker​(java.util.Set<java.lang.String> supportedEqualsParameters, java.util.Set<java.lang.String> supportedMatchesParameters)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void and()
      Called any time an AND is encountered.
      void comparison​(int type, java.lang.String propertyName, java.lang.String propertyValue, boolean negated)
      One of EQUALS LESSTHAN GREATERTHAN LESSTHANOREQUALS GREATERTHANOREQUALS;
      void enableVariablesSupport​(org.alfresco.service.namespace.NamespaceService namespaceService, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)  
      java.lang.String getProperty​(java.lang.String propertyName, int type)  
      <T> T getProperty​(java.lang.String propertyName, int type, java.lang.Class<T> returnType)
      Get the property value, converted to the requested type.
      java.util.List<MapBasedQueryWalker.QueryVariableHolder> getVariableProperties()  
      protected boolean handleUnmatchedComparison​(int type, java.lang.String propertyName, java.lang.String propertyValue)
      Called when unsupported property is encountered or comparison operator other than equals.
      void matches​(java.lang.String property, java.lang.String value, boolean negated)
      Called any time a MATCHES clause is encountered.
      protected void processVariable​(java.lang.String propertyName, java.lang.String propertyValue, int type)  
      void setSupportedGreaterThanOrEqualParameters​(java.util.Set<java.lang.String> supportedGreaterThanOrEqualParameters)  
      void setSupportedGreaterThanParameters​(java.util.Set<java.lang.String> supportedGreaterThanParameters)  
      void setSupportedLessThanOrEqualParameters​(java.util.Set<java.lang.String> supportedLessThanOrEqualParameters)  
      void setSupportedLessThanParameters​(java.util.Set<java.lang.String> supportedLessThanParameters)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MapBasedQueryWalker

        public MapBasedQueryWalker​(java.util.Set<java.lang.String> supportedEqualsParameters,
                                   java.util.Set<java.lang.String> supportedMatchesParameters)
    • Method Detail

      • setSupportedGreaterThanParameters

        public void setSupportedGreaterThanParameters​(java.util.Set<java.lang.String> supportedGreaterThanParameters)
      • setSupportedGreaterThanOrEqualParameters

        public void setSupportedGreaterThanOrEqualParameters​(java.util.Set<java.lang.String> supportedGreaterThanOrEqualParameters)
      • setSupportedLessThanParameters

        public void setSupportedLessThanParameters​(java.util.Set<java.lang.String> supportedLessThanParameters)
      • setSupportedLessThanOrEqualParameters

        public void setSupportedLessThanOrEqualParameters​(java.util.Set<java.lang.String> supportedLessThanOrEqualParameters)
      • enableVariablesSupport

        public void enableVariablesSupport​(org.alfresco.service.namespace.NamespaceService namespaceService,
                                           org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
      • getProperty

        public java.lang.String getProperty​(java.lang.String propertyName,
                                            int type)
      • getProperty

        public <T> T getProperty​(java.lang.String propertyName,
                                 int type,
                                 java.lang.Class<T> returnType)
        Get the property value, converted to the requested type.
        Parameters:
        propertyName - name of the parameter
        type - int
        returnType - type of object to return
        Returns:
        the converted parameter value. Null, if the property has no value.
        Throws:
        java.lang.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
      • processVariable

        protected void processVariable​(java.lang.String propertyName,
                                       java.lang.String propertyValue,
                                       int type)
      • handleUnmatchedComparison

        protected boolean handleUnmatchedComparison​(int type,
                                                    java.lang.String propertyName,
                                                    java.lang.String propertyValue)
        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.