Class

ujson

CharParser

Related Doc: package ujson

Permalink

abstract class CharParser[J] extends BufferingCharParser

A specialized JSON parse that can parse Chars (Chars or Bytes), sending method calls to the given upickle.core.Visitor.

Generally has a lot of tricks for performance: e.g. having duplicate implementations for nested v.s. top-level parsing, using an CharBuilder to construct the CharSequences that visitString requires, etc.

Linear Supertypes
BufferingCharParser, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CharParser
  2. BufferingCharParser
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CharParser()

    Permalink

Abstract Value Members

  1. abstract def close(): Unit

    Permalink

    Should be called when parsing is finished.

    Should be called when parsing is finished.

    Attributes
    protected[this]
  2. abstract def readDataIntoBuffer(buffer: Array[Char], bufferOffset: Int): (Array[Char], Boolean, Int)

    Permalink
    Definition Classes
    BufferingCharParser

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def appendCharsToBuilder(elems: CharBuilder, elemsStart: Int, elemsLength: Int): Unit

    Permalink
    Definition Classes
    BufferingCharParser
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def atEof(i: Int): Boolean

    Permalink

    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]
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def collectionEndFor(stackHead: ObjArrVisitor[_, _]): Int

    Permalink
  9. final def descape(i: Int): Char

    Permalink

    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]
  10. def die(i: Int, msg: String): Nothing

    Permalink

    Used to generate error messages with character info and offsets.

    Used to generate error messages with character info and offsets.

    Attributes
    protected[this]
  11. def dieWithFailureMessage(i: Int, state: Int): Nothing

    Permalink
  12. def dropBufferUntil(i: Int): Unit

    Permalink
    Definition Classes
    BufferingCharParser
  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def failIfNotData(state: Int, i: Int): Unit

    Permalink
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def getBufferCopyCount(): Int

    Permalink
    Definition Classes
    BufferingCharParser
  18. def getBufferGrowCount(): Int

    Permalink
    Definition Classes
    BufferingCharParser
  19. def getBufferLength(): Int

    Permalink
    Definition Classes
    BufferingCharParser
  20. def getCharSafe(i: Int): Char

    Permalink
    Definition Classes
    CharParser → BufferingCharParser
  21. def getCharUnsafe(i: Int): Char

    Permalink
    Definition Classes
    BufferingCharParser
  22. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  23. def getLastIdx: Int

    Permalink
    Definition Classes
    BufferingCharParser
  24. def growBuffer(until: Int): Unit

    Permalink
    Definition Classes
    BufferingCharParser
  25. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  26. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def parse(facade: Visitor[_, J]): J

    Permalink

    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.

  31. final def parseFalse(i: Int, facade: Visitor[_, J]): J

    Permalink

    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]
  32. final def parseNested(state: Int, i: Int, stackHead: ObjArrVisitor[_, J], stackTail: List[ObjArrVisitor[_, J]]): (J, Int)

    Permalink

    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.

    Attributes
    protected[this]
    Annotations
    @tailrec()
  33. final def parseNull(i: Int, facade: Visitor[_, J]): J

    Permalink

    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]
  34. final def parseNum(i: Int, ctxt: ObjArrVisitor[Any, J], facade: Visitor[_, J]): Int

    Permalink

    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]
  35. final def parseNumTopLevel(i: Int, facade: Visitor[_, J]): (J, Int)

    Permalink

    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]
  36. final def parseStringComplex(i0: Int): Int

    Permalink

    Parse a string that is known to have escape sequences.

    Parse a string that is known to have escape sequences.

    Attributes
    protected[this]
  37. final def parseStringKey(i: Int, stackHead: ObjArrVisitor[_, J]): Int

    Permalink
    Attributes
    protected[this]
  38. final def parseStringSimple(i: Int): Int

    Permalink

    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-16 and accesses it as chars.

    Attributes
    protected[this]
  39. def parseStringToOutputBuilder(i: Int, k: Int): Int

    Permalink
  40. final def parseStringTopLevel(i: Int, facade: Visitor[_, J]): (J, Int)

    Permalink
    Attributes
    protected[this]
  41. final def parseStringValue(i: Int, stackHead: ObjArrVisitor[_, J]): Int

    Permalink

    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-16, and access it as Char. It performs the correct checks to make sure that we don't interpret a multi-char code point incorrectly.

    Attributes
    protected[this]
  42. final def parseTopLevel(i: Int, facade: Visitor[_, J]): (J, Int)

    Permalink
    Attributes
    protected[this]
  43. final def parseTopLevel0(i: Int, facade: Visitor[_, J]): (J, Int)

    Permalink

    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]
    Annotations
    @tailrec()
  44. final def parseTrue(i: Int, facade: Visitor[_, J]): J

    Permalink

    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]
  45. def reject(j: Int): PartialFunction[Throwable, Nothing]

    Permalink
  46. def requestUntil(until: Int): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    BufferingCharParser
  47. def requestUntilOrThrow(i: Int): Unit

    Permalink
  48. def sliceArr(i: Int, n: Int): (Array[Char], Int, Int)

    Permalink
    Definition Classes
    BufferingCharParser
  49. def sliceString(i: Int, k: Int): String

    Permalink
    Definition Classes
    BufferingCharParser
  50. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  51. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  52. def tryCloseCollection(stackHead: ObjArrVisitor[_, J], stackTail: List[ObjArrVisitor[_, J]], i: Int): Option[(J, Int)]

    Permalink
  53. def unsafeCharSeqForRange(start: Int, length: Int): WrapCharArrayCharSeq

    Permalink
    Definition Classes
    BufferingCharParser
  54. def visitFloat64StringPartsWithWrapper(facade: Visitor[_, J], decIndex: Int, expIndex: Int, i: Int, j: Int): J

    Permalink
  55. def visitString(i: Int, s: CharSequence, stackHead: ObjArrVisitor[_, J]): Unit

    Permalink
  56. def visitStringKey(i: Int, s: CharSequence, stackHead: ObjArrVisitor[_, J]): Unit

    Permalink
  57. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from BufferingCharParser

Inherited from AnyRef

Inherited from Any

Ungrouped