Packages

abstract class ACursor extends Serializable

A zipper that represents a position in a JSON document and supports navigation and modification.

The focus represents the current position of the cursor; it may be updated with withFocus or changed using navigation methods like left and right.

Source
ACursor.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. ACursor
  2. Serializable
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ACursor(lastCursor: HCursor, lastOp: CursorOp)

Abstract Value Members

  1. abstract def delete: ACursor

    Delete the focus and move to its parent.

  2. abstract def downArray: ACursor

    If the focus is a JSON array, move to its first element.

  3. abstract def downField(k: String): ACursor

    If the focus is a JSON object, move to the value of the given key.

  4. abstract def downN(n: Int): ACursor

    If the focus is a JSON array, move to the element at the given index.

  5. abstract def field(k: String): ACursor

    If the focus is a value in a JSON object, move to a sibling with the given key.

  6. abstract def focus: Option[Json]

    The current location in the document.

  7. abstract def keys: Option[Iterable[String]]

    If the focus is a JSON object, return its field names in their original order.

  8. abstract def left: ACursor

    If the focus is an element in a JSON array, move to the left.

  9. abstract def right: ACursor

    If the focus is an element in a JSON array, move to the right.

  10. abstract def succeeded: Boolean

    Indicate whether this cursor represents the result of a successful operation.

  11. abstract def success: Option[HCursor]

    Return the cursor as an HCursor if it was successful.

  12. abstract def top: Option[Json]

    Return to the root of the document.

  13. abstract def up: ACursor

    Move the focus to the parent.

  14. abstract def values: Option[Iterable[Json]]

    If the focus is a JSON array, return its elements.

  15. abstract def withFocus(f: (Json) => Json): ACursor

    Modify the focus using the given function.

  16. abstract def withFocusM[F[_]](f: (Json) => F[Json])(implicit F: Applicative[F]): F[ACursor]

    Modify the focus in a context using the given function.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from ACursor toany2stringadd[ACursor] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ACursor, B)
    Implicit
    This member is added by an implicit conversion from ACursor toArrowAssoc[ACursor] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def as[A](implicit d: Decoder[A]): Result[A]

    Attempt to decode the focus as an A.

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def ensuring(cond: (ACursor) => Boolean, msg: => Any): ACursor
    Implicit
    This member is added by an implicit conversion from ACursor toEnsuring[ACursor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (ACursor) => Boolean): ACursor
    Implicit
    This member is added by an implicit conversion from ACursor toEnsuring[ACursor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: => Any): ACursor
    Implicit
    This member is added by an implicit conversion from ACursor toEnsuring[ACursor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): ACursor
    Implicit
    This member is added by an implicit conversion from ACursor toEnsuring[ACursor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. final def failed: Boolean

    Indicate whether this cursor represents the result of an unsuccessful operation.

  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  17. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from ACursor toStringFormat[ACursor] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  18. final def get[A](k: String)(implicit d: Decoder[A]): Result[A]

    Attempt to decode the value at the given key in a JSON object as an A.

  19. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. final def getOrElse[A](k: String)(fallback: => A)(implicit d: Decoder[A]): Result[A]

    Attempt to decode the value at the given key in a JSON object as an A.

    Attempt to decode the value at the given key in a JSON object as an A. If the field k is missing, then use the fallback instead.

  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def history: List[CursorOp]

    The operations that have been performed so far.

  23. def index: Option[Int]

    If the focus is a value in a JSON object, return the key.

  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. def key: Option[String]

    If the focus is a value in a JSON object, return the key.

  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. final def replay(history: List[CursorOp]): ACursor

    Replay history (a list of operations in reverse "chronological" order) against this cursor.

  30. final def replayOne(op: CursorOp): ACursor

    Replay an operation against this cursor.

  31. def root: HCursor

    Return the cursor to the root of the document.

  32. final def set(j: Json): ACursor

    Replace the focus.

  33. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  34. def toString(): String
    Definition Classes
    AnyRef → Any
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def [B](y: B): (ACursor, B)
    Implicit
    This member is added by an implicit conversion from ACursor toArrowAssoc[ACursor] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromACursor to any2stringadd[ACursor]

Inherited by implicit conversion StringFormat fromACursor to StringFormat[ACursor]

Inherited by implicit conversion Ensuring fromACursor to Ensuring[ACursor]

Inherited by implicit conversion ArrowAssoc fromACursor to ArrowAssoc[ACursor]

Miscellaneous utilities

Access and navigation

Modification

Array access

Object access

Array navigation

Object navigation

Decoding

Ungrouped