Package org.apache.solr.search
Class StrParser
- java.lang.Object
-
- org.apache.solr.search.StrParser
-
public class StrParser extends Object
Simple class to help with parsing a string. Note: This API is experimental and may change in non backward-compatible ways in the future
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description charch()voideatws()voidexpect(String s)bytegetByte()doublegetDouble()floatgetFloat()StringgetGlobbedId(String errMessage)StringgetId()StringgetId(String errMessage)intgetInt()NumbergetNumber()StringgetQuotedString()StringgetSimpleString()Skips leading whitespace and returns whatever sequence of non whitespace it can find (or hte empty string)BooleangetSortDirection()Sort direction or null if current position does not indicate a sort direction.booleanopt(char ch)booleanopt(String s)charpeek()charpeekChar()voidskip(int nChars)StringtoString()
-
-
-
Field Detail
-
val
public String val
-
pos
public int pos
-
end
public int end
-
-
Method Detail
-
eatws
public void eatws()
-
ch
public char ch()
-
skip
public void skip(int nChars)
-
opt
public boolean opt(String s)
-
opt
public boolean opt(char ch)
-
expect
public void expect(String s) throws SyntaxError
- Throws:
SyntaxError
-
getFloat
public float getFloat()
-
getNumber
public Number getNumber()
-
getDouble
public double getDouble()
-
getInt
public int getInt()
-
getByte
public byte getByte()
-
getId
public String getId() throws SyntaxError
- Throws:
SyntaxError
-
getId
public String getId(String errMessage) throws SyntaxError
- Throws:
SyntaxError
-
getGlobbedId
public String getGlobbedId(String errMessage) throws SyntaxError
- Throws:
SyntaxError
-
getSimpleString
public String getSimpleString()
Skips leading whitespace and returns whatever sequence of non whitespace it can find (or hte empty string)
-
getSortDirection
public Boolean getSortDirection() throws SyntaxError
Sort direction or null if current position does not indicate a sort direction. (True is desc, False is asc). Position is advanced to after the comma (or end) when result is non null- Throws:
SyntaxError
-
getQuotedString
public String getQuotedString() throws SyntaxError
- Throws:
SyntaxError
-
peek
public char peek()
-
peekChar
public char peekChar()
-
-