|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hippoecm.hst.util.SearchInputParsingUtils
public final class SearchInputParsingUtils
Input utilities for user searches.
Method Summary | |
---|---|
static String |
compressWhitespace(String text)
Compress whitespace (tab, newline, multiple spaces) by removing leading and trailing whitespace, and reducing inbetween whitespace to one space. |
static String |
parse(String input,
boolean allowSingleNonLeadingWildCardPerTerm)
Returns a parsed version of the input |
static String |
parse(String input,
boolean allowSingleNonLeadingWildCardPerTerm,
int maxLength)
Returns a parsed version of the input |
static String |
removeInvalidAndEscapeChars(String input,
boolean allowSingleNonLeadingWildCardPerTerm)
Removes invalid chars, escapes some chars. |
static String |
removeLeadingOrTrailingOrOperator(String input)
Removes the logical operator "OR" at the end of the query. |
static String |
removeLeadingWildCardsFromWords(String input)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String parse(String input, boolean allowSingleNonLeadingWildCardPerTerm)
input
- the user inputallowSingleNonLeadingWildCardPerTerm
- if there is allowed one wildcard (* or ?) per term (however, still not allowed as leading for a term)
input
. When input
is null
, null
is returnedpublic static String parse(String input, boolean allowSingleNonLeadingWildCardPerTerm, int maxLength)
input
- the user inputallowSingleNonLeadingWildCardPerTerm
- if there is allowed one wildcard (* or ?) per term (however, still not allowed as leading for a term)maxLength
- the maxLength of the returned parsed input
input
. When input
is null
, null
is returnedpublic static String removeLeadingWildCardsFromWords(String input)
public static String removeInvalidAndEscapeChars(String input, boolean allowSingleNonLeadingWildCardPerTerm)
Removes invalid chars, escapes some chars. If allowSingleNonLeadingWildCard
is true
, there
is one single non leading *
or ?
allowed. Note, that this wildcard is not allowed to be
leading of a new word.
Recommended is to remove all wildcards
input
- allowSingleNonLeadingWildCardPerTerm
-
input
public static String removeLeadingOrTrailingOrOperator(String input)
input
- the original (possibly invalid) query string
public static String compressWhitespace(String text)
text
- the text to compress (may be null)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |