Class ParserUtils
- java.lang.Object
-
- com.google.appengine.api.search.query.ParserUtils
-
public class ParserUtils extends Object
A helper class that holds various, state-less utility functions used by the query parser.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisDate(CharSequence text)Returns if the given string looks like a date to us.static booleanisNumber(CharSequence text)Returns whether or not the given text looks like a number.static StringtrimLast(String text)Removes the last character from the given textstatic StringunescapePhraseText(CharSequence phrase)Extracts phrase text by removing quotes from either end, and interpreting escape sequences.
-
-
-
Method Detail
-
unescapePhraseText
public static String unescapePhraseText(CharSequence phrase)
Extracts phrase text by removing quotes from either end, and interpreting escape sequences.
-
isNumber
public static boolean isNumber(CharSequence text)
Returns whether or not the given text looks like a number. The number is defined as '-'? digit* ('.' digit* ('E' ('+' | '-')? digit+)?)?- Parameters:
text- the text tested if it looks like a number- Returns:
- whether or not the text represents a floating point number
-
isDate
public static boolean isDate(CharSequence text)
Returns if the given string looks like a date to us. We only accept ISO 8601 dates, which have the dddd-dd-dd format.- Parameters:
text- text checked if it looks like a date- Returns:
- whether this could be an ISO 8601 date
-
-