Class TypedValueQueryValidator

java.lang.Object
com.appiancorp.common.query.TypedValueQueryValidator
All Implemented Interfaces:
com.appiancorp.common.query.ValidatesFilterProperties, com.appiancorp.common.query.ValidatesSortInfo

@NotThreadSafe public class TypedValueQueryValidator extends Object implements com.appiancorp.common.query.ValidatesFilterProperties, com.appiancorp.common.query.ValidatesSortInfo
  • Field Details

    • FEATURE_CONTEXT_CLASS

      protected static final Class FEATURE_CONTEXT_CLASS
    • properties

      protected final com.google.common.collect.ImmutableList<com.appiancorp.core.expr.portable.ReadOnlyPropertyDescriptor> properties
    • aggregationCastMap

      protected final Map<String,com.appiancorp.core.expr.portable.ReadOnlyType> aggregationCastMap
    • aliases

      protected final Map<String,Integer> aliases
    • columnsIdChains

      protected com.appiancorp.core.expr.IdChain[] columnsIdChains
    • aliasDotNotation

      protected String[][] aliasDotNotation
    • aliasCounter

      protected int aliasCounter
  • Constructor Details

    • TypedValueQueryValidator

      public TypedValueQueryValidator(ServiceContext serviceContext, com.google.common.collect.ImmutableList<com.appiancorp.core.expr.portable.ReadOnlyPropertyDescriptor> properties)
    • TypedValueQueryValidator

      public TypedValueQueryValidator(ServiceContext serviceContext, com.google.common.collect.ImmutableList<com.appiancorp.core.expr.portable.ReadOnlyPropertyDescriptor> properties, TypedValueCriteriaValidatorProvider criteriaValidatorProvider)
    • TypedValueQueryValidator

      public TypedValueQueryValidator(ServiceContext serviceContext, com.google.common.collect.ImmutableList<com.appiancorp.core.expr.portable.ReadOnlyPropertyDescriptor> properties, boolean isMultiColumnSortSupported)
  • Method Details

    • validate

      public Query<TypedValue> validate(Query<TypedValue> query)
    • validate

      public Query<TypedValue> validate(Query<TypedValue> query, boolean skipDefaultSort)
    • skipCriteriaValidation

      protected boolean skipCriteriaValidation()
    • skipSelectionValidation

      protected boolean skipSelectionValidation()
    • getAliasesPosition

      public Map<String,Integer> getAliasesPosition()
    • getAliasDotNotation

      public String[][] getAliasDotNotation()
    • getAggregationCastMap

      public Map<String,com.appiancorp.core.expr.portable.ReadOnlyType> getAggregationCastMap()
    • initializeArrays

      protected void initializeArrays(int size)
    • validateGrouping

      protected void validateGrouping(Query.Builder builder, Aggregation aggregation, PagingInfo pagingInfo, boolean isValidMeasuresWithoutGrouping)
    • getAllVisibleProperties

      protected com.google.common.collect.ImmutableList<com.appiancorp.core.expr.portable.ReadOnlyPropertyDescriptor> getAllVisibleProperties()
    • validateColumns

      protected List<Column> validateColumns(List<Column> columns)
    • validateSortInfo

      public void validateSortInfo(List<SortInfo> sorts)
      Specified by:
      validateSortInfo in interface com.appiancorp.common.query.ValidatesSortInfo
    • validateSortInfoForGrouping

      protected void validateSortInfoForGrouping(List<SortInfo> sortInfos)
    • isStringNil

      protected boolean isStringNil(String str)
    • validateAliasInner

      protected void validateAliasInner(String alias)
    • validateAlias

      protected String validateAlias(String alias, String field)
    • validateFieldDefinitionWithIdChainForSorting

      protected void validateFieldDefinitionWithIdChainForSorting(com.appiancorp.core.expr.IdChain idChain)
    • getValidatedFieldTypeForFilter

      public com.appiancorp.core.expr.portable.ReadOnlyType getValidatedFieldTypeForFilter(String field)
      Specified by:
      getValidatedFieldTypeForFilter in interface com.appiancorp.common.query.ValidatesFilterProperties
    • validateFieldDefinitionInner

      protected com.appiancorp.core.expr.portable.ReadOnlyType validateFieldDefinitionInner(String alias, boolean disallowComplexFieldType, String expr, ErrorCode nullFieldErrorCode, ErrorCode complexTypeErrorCode, ErrorCode indexOnMultipleErrorCode, AggregationFunction aggregationFunction, com.appiancorp.common.query.GroupingFunction groupingFunction)
    • validateFieldDefinitionWithIdChain

      protected com.appiancorp.core.expr.portable.ReadOnlyType validateFieldDefinitionWithIdChain(String alias, boolean disallowComplexFieldType, com.appiancorp.core.expr.IdChain idChain, ErrorCode complexTypeErrorCode, ErrorCode indexOnMultipleErrorCode, AggregationFunction aggregationFunction, com.appiancorp.common.query.GroupingFunction groupingFunction) throws InvalidTypeException
      Throws:
      InvalidTypeException
    • validateCriteria

      public Criteria validateCriteria(Criteria criteria)
    • getValue

      public TypedValue getValue(Filter filterToValidate)
      Specified by:
      getValue in interface com.appiancorp.common.query.ValidatesFilterProperties
    • getFieldDisplayName

      public String getFieldDisplayName(String fieldNameOrUuid)
      Specified by:
      getFieldDisplayName in interface com.appiancorp.common.query.ValidatesFilterProperties
    • validateFieldName

      public String validateFieldName(String field)
      Specified by:
      validateFieldName in interface com.appiancorp.common.query.ValidatesFilterProperties