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 char
ch()
void
eatws()
void
expect(String s)
double
getDouble()
float
getFloat()
String
getGlobbedId(String errMessage)
String
getId()
String
getId(String errMessage)
int
getInt()
Number
getNumber()
String
getQuotedString()
String
getSimpleString()
Skips leading whitespace and returns whatever sequence of non whitespace it can find (or hte empty string)Boolean
getSortDirection()
Sort direction or null if current position does not indicate a sort direction.boolean
opt(char ch)
boolean
opt(String s)
char
peek()
char
peekChar()
void
skip(int nChars)
String
toString()
-
-
-
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()
-
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()
-
-