Package com.saperion.ngc.resultset
Class SearchStringParser
- java.lang.Object
-
- com.saperion.ngc.resultset.SearchStringParser
-
public class SearchStringParser extends java.lang.ObjectParses search strings entered by the user.
-
-
Constructor Summary
Constructors Constructor Description SearchStringParser(java.lang.String searchString, java.util.Map<java.lang.String,ResultSetColumn> availableColumns)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetSimpleString()booleanisSimpleString()Checks if the search string is just a simple string and does not define one or more column/value pairs.java.util.Map<java.lang.String,java.lang.String>parse()Parses the string.
-
-
-
Constructor Detail
-
SearchStringParser
public SearchStringParser(java.lang.String searchString, java.util.Map<java.lang.String,ResultSetColumn> availableColumns)Constructor.- Parameters:
searchString- string to parseavailableColumns- map with all available columns and their labels
-
-
Method Detail
-
isSimpleString
public boolean isSimpleString()
Checks if the search string is just a simple string and does not define one or more column/value pairs.- Returns:
- true if no column/value pairs exist
-
getSimpleString
public java.lang.String getSimpleString() throws SearchSyntaxException- Returns:
- the search string without escape characters.
- Throws:
SearchSyntaxException- when the string is too short
-
parse
public java.util.Map<java.lang.String,java.lang.String> parse() throws SearchSyntaxExceptionParses the string.- Returns:
- Map containing column, filter pairs.
- Throws:
SearchSyntaxException- on syntax error
-
-