org.kuali.rice.core.api.search
Class SearchExpressionUtils

java.lang.Object
  extended by org.kuali.rice.core.api.search.SearchExpressionUtils

public class SearchExpressionUtils
extends Object

Canonical utilities for parsing incoming string search expressions


Field Summary
static Collection<SearchOperator> CLAUSE_OPERATORS
          Clause operators just join multiple expressions
 
Method Summary
static String[] parseBinaryOperatorValues(SearchOperator operator, String expression)
           
static String parsePostfixUnaryOperatorValue(SearchOperator operator, String expression)
           
static Predicate parsePredicates(String expression, String property)
           
static String parsePrefixUnaryOperatorValue(SearchOperator operator, String expression)
           
static Range parseRange(String rangeString)
           
static Predicate parseSimplePredicate(String property, String value)
           
static String[] splitOnClauses(String expression)
          Splits the expression by AND and OR operators.
static String[] splitOnOperators(String expression, Collection<SearchOperator> operators)
          Splits the expression by the given operators.
static String[] splitOnOperators(String expression, SearchOperator... operators)
          Splits the expression by the given operators.
static String stripClauseOperators(String expression)
          Strips AND and OR operators from the expression string
static String stripOperators(String expression, Collection<SearchOperator> operators)
          Strips AND and OR operators from the expression string
static String stripOperators(String expression, SearchOperator... operators)
          Strips AND and OR operators from the expression string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLAUSE_OPERATORS

public static final Collection<SearchOperator> CLAUSE_OPERATORS
Clause operators just join multiple expressions

Method Detail

parsePrefixUnaryOperatorValue

public static String parsePrefixUnaryOperatorValue(SearchOperator operator,
                                                   String expression)

parsePostfixUnaryOperatorValue

public static String parsePostfixUnaryOperatorValue(SearchOperator operator,
                                                    String expression)

parseBinaryOperatorValues

public static String[] parseBinaryOperatorValues(SearchOperator operator,
                                                 String expression)

splitOnClauses

public static String[] splitOnClauses(String expression)
Splits the expression by AND and OR operators. Does not trim empty clauses (these are probably syntax errors)

Parameters:
expression - the expression to parse
Returns:
string array of clauses, not including AND or OR operators

stripClauseOperators

public static String stripClauseOperators(String expression)
Strips AND and OR operators from the expression string

Parameters:
expression - the expression to parse
Returns:
string not including AND or OR operators

splitOnOperators

public static String[] splitOnOperators(String expression,
                                        Collection<SearchOperator> operators)
Splits the expression by the given operators. Does not trim empty parts.

Parameters:
expression - the expression to parse
Returns:
string array of clauses, not including specified operators

splitOnOperators

public static String[] splitOnOperators(String expression,
                                        SearchOperator... operators)
Splits the expression by the given operators. Does not trim empty parts.

Parameters:
expression - the expression to parse
Returns:
string array of clauses, not including specified operators

stripOperators

public static String stripOperators(String expression,
                                    Collection<SearchOperator> operators)
Strips AND and OR operators from the expression string

Parameters:
expression - the expression to parse
Returns:
string not including AND or OR operators

stripOperators

public static String stripOperators(String expression,
                                    SearchOperator... operators)
Strips AND and OR operators from the expression string

Parameters:
expression - the expression to parse
Returns:
string not including AND or OR operators

parseRange

public static Range parseRange(String rangeString)

parsePredicates

public static Predicate parsePredicates(String expression,
                                        String property)

parseSimplePredicate

public static Predicate parseSimplePredicate(String property,
                                             String value)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.