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
  • Field Details

    • val

      public String val
    • pos

      public int pos
    • end

      public int end
  • Constructor Details

    • StrParser

      public StrParser(String val)
    • StrParser

      public StrParser(String val, int start, int end)
  • Method Details

    • 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()
    • toString

      public String toString()
      Overrides:
      toString in class Object