final class ChannelParser[J] extends SyncParser[J] with ByteBasedParser[J]

Basic file parser.

Given a file name this parser opens it, chunks the data, and parses it.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ChannelParser
  2. ByteBasedParser
  3. SyncParser
  4. Parser
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ChannelParser(ch: ReadableByteChannel, bufferSize: Int)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final val ARRBEG: Int(6)

    Valid parser states.

    Valid parser states.

    Attributes
    protected[this]
    Definition Classes
    Parser
  5. final val ARREND: Int(4)
    Attributes
    protected[this]
    Definition Classes
    Parser
  6. var Allsize: Int
  7. var Bufsize: Int
  8. final val DATA: Int(1)
    Attributes
    protected[this]
    Definition Classes
    Parser
  9. final val HexChars: Array[Int]
    Attributes
    protected[this]
    Definition Classes
    Parser
  10. final val KEY: Int(2)
    Attributes
    protected[this]
    Definition Classes
    Parser
  11. final val KEYVALUE: Int(2)
    Attributes
    protected[this]
    Definition Classes
    Parser
  12. var Mask: Int
  13. final val OBJBEG: Int(7)
    Attributes
    protected[this]
    Definition Classes
    Parser
  14. final val OBJEND: Int(5)
    Attributes
    protected[this]
    Definition Classes
    Parser
  15. final val SEP: Int(3)
    Attributes
    protected[this]
    Definition Classes
    Parser
  16. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  17. final def at(i: Int, k: Int): CharSequence

    Access a byte range as a string.

    Access a byte range as a string.

    Since the underlying data are UTF-8 encoded, i and k must occur on unicode boundaries. Also, the resulting String is not guaranteed to have length (k - i).

    Attributes
    protected[this]
    Definition Classes
    ChannelParserParser
  18. final def at(i: Int): Char

    Reads a byte as a single Char.

    Reads a byte as a single Char. The byte must be valid ASCII (this method is used to parse JSON values like numbers, constants, or delimiters, which are known to be within ASCII).

    Attributes
    protected[this]
    Definition Classes
    ChannelParserParser
  19. final def atEof(i: Int): Boolean

    Return true iff 'i' is at or beyond the end of the input (EOF).

    Return true iff 'i' is at or beyond the end of the input (EOF).

    Attributes
    protected[this]
    Definition Classes
    ChannelParserParser
  20. final def byte(i: Int): Byte

    This is a specialized accessor for the case where our underlying data are bytes not chars.

    This is a specialized accessor for the case where our underlying data are bytes not chars.

    Attributes
    protected[this]
    Definition Classes
    ChannelParserByteBasedParser
  21. final def checkpoint(state: Int, i: Int, stack: List[ObjArrVisitor[_, J]], path: List[Any]): Unit

    The checkpoint() method is used to allow some parsers to store their progress.

    The checkpoint() method is used to allow some parsers to store their progress.

    Attributes
    protected[this]
    Definition Classes
    ChannelParserParser
  22. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate() @throws( ... )
  23. final def close(): Unit

    Should be called when parsing is finished.

    Should be called when parsing is finished.

    Attributes
    protected[this]
    Definition Classes
    ChannelParserParser
  24. final def column(i: Int): Int
    Attributes
    protected[this]
    Definition Classes
    ChannelParserParser
  25. final def descape(s: CharSequence): Char

    Generate a Char from the hex digits of "ሴ" (i.e.

    Generate a Char from the hex digits of "ሴ" (i.e. "1234").

    NOTE: This is only capable of generating characters from the basic plane. This is why it can only return Char instead of Int.

    Attributes
    protected[this]
    Definition Classes
    Parser
  26. def die(i: Int, msg: String): Nothing

    Used to generate error messages with character info and offsets.

    Used to generate error messages with character info and offsets.

    Attributes
    protected[this]
    Definition Classes
    Parser
  27. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  29. def error(msg: String): Nothing

    Used to generate messages for internal errors.

    Used to generate messages for internal errors.

    This should only be used in situations where a possible bug in the parser was detected. For errors in user-provided JSON, use die().

    Attributes
    protected[this]
    Definition Classes
    Parser
  30. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  31. final def grow(): Unit
    Attributes
    protected[this]
  32. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  33. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  34. var line: Int
  35. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. final def newline(i: Int): Unit
    Attributes
    protected[this]
    Definition Classes
    ChannelParserParser
  37. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  38. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  39. final def parse(facade: Visitor[_, J]): J

    Parse the JSON document into a single JSON value.

    Parse the JSON document into a single JSON value.

    The parser considers documents like '333', 'true', and '"foo"' to be valid, as well as more traditional documents like [1,2,3,4,5]. However, multiple top-level objects are not allowed.

    Definition Classes
    SyncParser
  40. final def parse(i: Int, facade: Visitor[_, J]): (J, Int)

    Parse and return the next JSON value and the position beyond it.

    Parse and return the next JSON value and the position beyond it.

    Attributes
    protected[this]
    Definition Classes
    Parser
  41. final def parseFalse(i: Int, facade: Visitor[_, J]): J

    Parse the JSON constant "false".

    Parse the JSON constant "false".

    Note that this method assumes that the first character has already been checked.

    Attributes
    protected[this]
    Definition Classes
    Parser
  42. final def parseNull(i: Int, facade: Visitor[_, J]): J

    Parse the JSON constant "null".

    Parse the JSON constant "null".

    Note that this method assumes that the first character has already been checked.

    Attributes
    protected[this]
    Definition Classes
    Parser
  43. final def parseNum(i: Int, ctxt: ObjArrVisitor[Any, J], facade: Visitor[_, J]): Int

    Parse the given number, and add it to the given context.

    Parse the given number, and add it to the given context.

    We don't actually instantiate a number here, but rather pass the string of for future use. Facades can choose to be lazy and just store the string. This ends up being way faster and has the nice side-effect that we know exactly how the user represented the number.

    Attributes
    protected[this]
    Definition Classes
    Parser
  44. final def parseNumSlow(i: Int, facade: Visitor[_, J]): (J, Int)

    Parse the given number, and add it to the given context.

    Parse the given number, and add it to the given context.

    This method is a bit slower than parseNum() because it has to be sure it doesn't run off the end of the input.

    Normally (when operating in rparse in the context of an outer array or object) we don't need to worry about this and can just grab characters, because if we run out of characters that would indicate bad input. This is for cases where the number could possibly be followed by a valid EOF.

    This method has all the same caveats as the previous method.

    Attributes
    protected[this]
    Definition Classes
    Parser
  45. final def parseString(i: Int, key: Boolean): (CharSequence, Int)

    Parse the string according to JSON rules, and add to the given context.

    Parse the string according to JSON rules, and add to the given context.

    This method expects the data to be in UTF-8 and accesses it as bytes.

    Attributes
    protected[this]
    Definition Classes
    ByteBasedParserParser
  46. final def parseStringComplex(i: Int): (String, Int)
    Attributes
    protected[this]
    Definition Classes
    ByteBasedParser
  47. final def parseStringSimple(i: Int): Int

    See if the string has any escape sequences.

    See if the string has any escape sequences. If not, return the end of the string. If so, bail out and return -1.

    This method expects the data to be in UTF-8 and accesses it as bytes. Thus we can just ignore any bytes with the highest bit set.

    Attributes
    protected[this]
    Definition Classes
    ByteBasedParser
  48. final def parseTrue(i: Int, facade: Visitor[_, J]): J

    Parse the JSON constant "true".

    Parse the JSON constant "true".

    Note that this method assumes that the first character has already been checked.

    Attributes
    protected[this]
    Definition Classes
    Parser
  49. def reject(j: Int, path: List[Any]): PartialFunction[Throwable, Nothing]
    Definition Classes
    Parser
  50. final def reset(i: Int): Int

    If the cursor 'i' is past the 'curr' buffer, we want to clear the current byte buffer, do a swap, load some more data, and continue.

    If the cursor 'i' is past the 'curr' buffer, we want to clear the current byte buffer, do a swap, load some more data, and continue.

    Attributes
    protected[this]
    Definition Classes
    ChannelParserParser
  51. final def rparse(state: Int, j: Int, stack: List[ObjArrVisitor[_, J]], path: List[Any]): (J, Int)

    Tail-recursive parsing method to do the bulk of JSON parsing.

    Tail-recursive parsing method to do the bulk of JSON parsing.

    This single method manages parser states, data, etc. Except for parsing non-recursive values (like strings, numbers, and constants) all important work happens in this loop (or in methods it calls, like reset()).

    Currently the code is optimized to make use of switch statements. Future work should consider whether this is better or worse than manually constructed if/else statements or something else. Also, it may be possible to reorder some cases for speed improvements.

    j

    index/position in the source json

    path

    the json path in the tree

    Attributes
    protected[this]
    Definition Classes
    Parser
    Annotations
    @tailrec()
  52. final def swap(): Unit

    Swap the curr and next arrays/buffers/counts.

    Swap the curr and next arrays/buffers/counts.

    We'll call this in response to certain reset() calls. Specifically, when the index provided to reset is no longer in the 'curr' buffer, we want to clear that data and swap the buffers.

    Attributes
    protected[this]
  53. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  54. def toString(): String
    Definition Classes
    AnyRef → Any
  55. final val utf8: Charset
    Attributes
    protected[this]
    Definition Classes
    Parser
  56. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  57. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  58. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from ByteBasedParser[J]

Inherited from SyncParser[J]

Inherited from Parser[J]

Inherited from AnyRef

Inherited from Any

Ungrouped