Package

com.rojoma.json.v3

io

Permalink

package io

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

Type Members

  1. class BlockJsonTokenIterator extends AbstractBufferedIterator[JsonToken]

    Permalink

    Convert a character-stream into a token-stream.

    Convert a character-stream into a token-stream.

    This reads characters in blocks of size blockSize, so if the underlying Reader is to be re-used for other non-JSON purposes after finishing reading, a com.rojoma.json.v3.io.JsonTokenIterator should be used instead.

    As extensions to standard JSON, this reader supports single-quoted strings and Javascript-style comments.

    Unless you actually need tokens, prefer com.rojoma.json.v3.io.FusedBlockJsonEventIterator.

    See also

    com.rojoma.json.v3.io.JsonToken

    com.rojoma.json.v3.io.JsonTokenGenerator

    com.rojoma.json.v3.io.JsonTokenIterator

  2. class CompactJsonWriter extends JsonWriter

    Permalink

    An object that will write com.rojoma.json.v3.ast.JValues in a non-human-friendly "compact" format with no spaces or newlines.

    An object that will write com.rojoma.json.v3.ast.JValues in a non-human-friendly "compact" format with no spaces or newlines. This does many small writes, so it is probably a good idea to wrap the Writer in a BufferedWriter.

  3. case class EndOfArrayEvent()(position: Position) extends JsonEvent with Product with Serializable

    Permalink
  4. case class EndOfObjectEvent()(position: Position) extends JsonEvent with Product with Serializable

    Permalink
  5. class EventJsonReader extends JsonReader

    Permalink

    Parses a token-stream into a com.rojoma.json.v3.ast.JValue.

    Parses a token-stream into a com.rojoma.json.v3.ast.JValue. As an extension, this parser accepts unquoted strings (i.e., identifiers) as field-names.

  6. type FieldCache = (String, Int) ⇒ String

    Permalink

    A function for use in caching objects' field names, for memory reduction.

    A function for use in caching objects' field names, for memory reduction. In most places, this defaults to identity. In com.rojoma.json.v3.io.JsonReader however, a com.rojoma.json.v3.io.HashMapFieldCache is used because it is already known that the entire datum will be read into memory at once.

    The parameters are the field names and the depth of nesting at which it occurs.

  7. case class FieldEvent(name: String)(position: Position) extends JsonEvent with Product with Serializable

    Permalink
  8. class FixedSetFieldCache extends FieldCache

    Permalink

    A cache of keys that are known ahead of time.

  9. class FusedBlockJsonEventIterator extends AbstractBufferedIterator[JsonEvent]

    Permalink

    Turns a raw character-stream into an event stream, checking for JSON well-formedness.

    Turns a raw character-stream into an event stream, checking for JSON well-formedness.

    A FusedBlockJsonEventIterator checks a character stream for syntactic correctness and produces events that reflect the syntax of JSON.

    As extension, this class allows comments and for unquoted identifiers to be used as object keys.

    See also

    com.rojoma.json.v3.io.JsonEvent

    com.rojoma.json.v3.io.JsonEventGenerator

    com.rojoma.json.v3.io.JsonEventIterator

  10. class FusedBlockJsonReader extends JsonReader

    Permalink
  11. class HashMapFieldCache extends FieldCache

    Permalink
  12. case class IdentifierEvent(text: String)(position: Position) extends JsonEvent with Product with Serializable

    Permalink
  13. sealed abstract class JValueGenerator extends AnyRef

    Permalink
  14. class JsonBadParse extends JsonReaderException with JsonReadException

    Permalink

    This exception should never be thrown if using the standard JsonEventIterator.

    This exception should never be thrown if using the standard JsonEventIterator. It means that either there were mismatched start/end array or object events or that an an object did not follow the pattern of FieldObject-followed-by-field-data.

  15. sealed abstract class JsonEOF extends JsonReaderException

    Permalink
  16. sealed abstract class JsonEvent extends AnyRef

    Permalink
  17. sealed abstract class JsonEventGenerator extends AnyRef

    Permalink
  18. class JsonEventIterator extends AbstractBufferedIterator[JsonEvent]

    Permalink

    Turns a raw token-stream into an event stream, checking for JSON well-formedness.

    Turns a raw token-stream into an event stream, checking for JSON well-formedness.

    A JsonEventIterator checks a token stream for syntactic correctness and produces events that reflect the syntax of JSON. It guarantees to demand no more input from the input iterator than is absolutely required.

    As an extension, this class allows unquoted identifiers to be used as object keys.

    See also

    com.rojoma.json.v3.io.JsonEvent

    com.rojoma.json.v3.io.JsonEventGenerator

    com.rojoma.json.v3.io.FusedBlockJsonEventIterator

  19. sealed trait JsonLexException extends JsonReaderException

    Permalink
  20. class JsonLexerEOF extends JsonEOF with JsonLexException

    Permalink
  21. class JsonNumberOutOfRange extends JsonReaderException with JsonLexException

    Permalink
  22. sealed trait JsonParseException extends JsonReaderException

    Permalink
  23. class JsonParserEOF extends JsonEOF with JsonParseException

    Permalink
  24. sealed trait JsonReadException extends JsonReaderException

    Permalink
  25. trait JsonReader extends AnyRef

    Permalink
  26. sealed abstract class JsonReaderException extends Exception

    Permalink
  27. sealed abstract class JsonToken extends AnyRef

    Permalink
  28. sealed abstract class JsonTokenGenerator extends AnyRef

    Permalink
  29. class JsonTokenIterator extends AbstractBufferedIterator[JsonToken]

    Permalink

    Convert a character-stream into a token-stream.

    Convert a character-stream into a token-stream.

    This is guaranteed to read no more than necessary to ensure it has reached the end of a single token. For objects, arrays, and strings, it will read only up to (and, of course, including) the closing delimiter. For other types, it may read one character further to assure itself that it has reached the end.

    A JsonTokenIterator does many small reads; it may be a good idea to wrap the input Reader into a BufferedReader. If you do not need to read non-JSON out of the underlying Reader afterward, a com.rojoma.json.v3.io.BlockJsonTokenIterator maybe be faster.

    As extensions to standard JSON, this reader supports single-quoted strings and Javascript-style comments.

    See also

    com.rojoma.json.v3.io.JsonToken

    com.rojoma.json.v3.io.JsonTokenGenerator

    com.rojoma.json.v3.io.BlockJsonTokenIterator

  30. class JsonUnexpectedCharacter extends JsonReaderException with JsonLexException

    Permalink
  31. class JsonUnexpectedToken extends JsonReaderException with JsonParseException

    Permalink
  32. class JsonUnknownIdentifier extends JsonReaderException with JsonParseException

    Permalink
  33. trait JsonWriter extends AnyRef

    Permalink

    An object that can serialize com.rojoma.json.v3.ast.JValues.

    An object that can serialize com.rojoma.json.v3.ast.JValues. The intention is to produce a (series of) JSON objects.

  34. sealed abstract class MalformedEventStreamException extends RuntimeException

    Permalink
  35. class NoSuchTokenException extends NoSuchElementException

    Permalink
  36. case class NumberEvent(number: String)(position: Position) extends JsonEvent with Product with Serializable

    Permalink
  37. final class Position extends AnyVal

    Permalink
  38. class PrettyJsonWriter extends JsonWriter

    Permalink

    An object that will write com.rojoma.json.v3.ast.JValues in a human-friendly indented format.

    An object that will write com.rojoma.json.v3.ast.JValues in a human-friendly indented format.

    The writer will try to keep as much data on a single line as possible. As a result, arrays and objects have two printing modes (selected automatically), "compact" and "indented".

    In the "compact" mode, an array is stored on a single line:

    [ elem1, elem2, ... ]

    Similarly for objects:

    { "key1" : value1, "key2 : value2, ... }

    In the "indented" mode, the delimiters appear on lines by themselves, with each element formatted on a separate line:

    [
      elem1,
      elem2,
      ...
    ]

    For objects, if a key/value pair does not fit on a single line, the value is printed on a line of its own, indented further:

    {
      "key" :
        value
    }

    Empty arrays and objects are always represented compactly, as [] or {} respectively.

    This does many small writes, so it is probably a good idea to wrap the Writer in a BufferedWriter.

  39. sealed abstract class SimpleJsonToken extends JsonToken

    Permalink
  40. case class StartOfArrayEvent()(position: Position) extends JsonEvent with Product with Serializable

    Permalink
  41. case class StartOfObjectEvent()(position: Position) extends JsonEvent with Product with Serializable

    Permalink
  42. case class StringEvent(string: String)(position: Position) extends JsonEvent with Product with Serializable

    Permalink
  43. case class TokenCloseBrace()(position: Position) extends SimpleJsonToken with Product with Serializable

    Permalink
  44. case class TokenCloseBracket()(position: Position) extends SimpleJsonToken with Product with Serializable

    Permalink
  45. case class TokenColon()(position: Position) extends SimpleJsonToken with Product with Serializable

    Permalink
  46. case class TokenComma()(position: Position) extends SimpleJsonToken with Product with Serializable

    Permalink
  47. case class TokenIdentifier(text: String)(position: Position) extends SimpleJsonToken with Product with Serializable

    Permalink
  48. case class TokenNumber(number: String)(position: Position) extends SimpleJsonToken with Product with Serializable

    Permalink
  49. case class TokenOpenBrace()(position: Position) extends SimpleJsonToken with Product with Serializable

    Permalink
  50. case class TokenOpenBracket()(position: Position) extends SimpleJsonToken with Product with Serializable

    Permalink
  51. case class TokenString(text: String)(position: Position) extends JsonToken with Product with Serializable

    Permalink

Value Members

  1. object CompactJsonWriter

    Permalink
  2. object EventJsonReader

    Permalink
  3. object EventTokenIterator extends (Iterator[JsonEvent]) ⇒ Iterator[JsonToken]

    Permalink

    A function which converts an Iterator[JsonEvent] into an Iterator[JsonToken].

    A function which converts an Iterator[JsonEvent] into an Iterator[JsonToken].

    returns

    An iterator of tokens that can be used to generate textual output

    Exceptions thrown

    MalformedEventStreamException if the event stream is not well-formed

  4. val IdentityFieldCache: FieldCache

    Permalink
  5. object JValueEventIterator extends (JValue) ⇒ Iterator[JsonEvent]

    Permalink

    A function which converts a JValue into an Iterator[JsonEvent].

    A function which converts a JValue into an Iterator[JsonEvent].

    returns

    An iterator of events that can be re-parsed or converted into tokens for output

  6. object JValueGenerator

    Permalink
  7. object JsonEvent

    Permalink
  8. object JsonEventGenerator

    Permalink
  9. object JsonEventIterator

    Permalink
  10. object JsonLexException extends Serializable

    Permalink
  11. object JsonParseException extends Serializable

    Permalink
  12. object JsonReadException extends Serializable

    Permalink
  13. object JsonReader

    Permalink
  14. object JsonReaderException extends Serializable

    Permalink
  15. object JsonToken

    Permalink
  16. object JsonTokenGenerator

    Permalink
  17. object MalformedEventStreamException extends Serializable

    Permalink
  18. object Position

    Permalink
  19. object PrettyJsonWriter

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped