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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `end`
    `int` | `pos`
    `String` | `val`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StrParser(String val)`
    `StrParser(String val, int start, int end)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### val

          public String val

    - #### pos

          public int pos

    - #### end

          public int end

  - ### Constructor Detail

    - #### StrParser

          public StrParser(String val)

    - #### StrParser

          public StrParser(String val,
                           int start,
                           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()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.