io.circe

Cursor

abstract class Cursor extends GenericCursor[Cursor]

A zipper that represents a position in a JSON value and supports navigation around the JSON value.

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

See also

GenericCursor

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Cursor
  2. GenericCursor
  3. Serializable
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Cursor()

Type Members

  1. type Focus[x] = x

    The context that the cursor is available in.

    The context that the cursor is available in.

    Definition Classes
    CursorGenericCursor
  2. type M[x[_]] = Functor[x]

    The type class including the operations needed for withFocusM.

    The type class including the operations needed for withFocusM.

    Definition Classes
    CursorGenericCursor
  3. type Result = Option[Cursor]

    The type returned by navigation and modifications operations.

    The type returned by navigation and modifications operations.

    Definition Classes
    CursorGenericCursor

Abstract Value Members

  1. abstract def context: List[Context]

    Return the current context of the focus.

  2. abstract def delete: Result

    Delete the focus and move to its parent.

    Delete the focus and move to its parent.

    Definition Classes
    GenericCursor
  3. abstract def deleteGoField(k: String): Result

    Delete the focus and move to the sibling with the given key in a JSON object.

    Delete the focus and move to the sibling with the given key in a JSON object.

    Definition Classes
    GenericCursor
  4. abstract def deleteGoFirst: Result

    Delete the focus and move to the first element in a JSON array.

    Delete the focus and move to the first element in a JSON array.

    Definition Classes
    GenericCursor
  5. abstract def deleteGoLast: Result

    Delete the focus and move to the last element in a JSON array.

    Delete the focus and move to the last element in a JSON array.

    Definition Classes
    GenericCursor
  6. abstract def deleteGoLeft: Result

    Delete the focus and move to the left in a JSON array.

    Delete the focus and move to the left in a JSON array.

    Definition Classes
    GenericCursor
  7. abstract def deleteGoRight: Result

    Delete the focus and move to the right in a JSON array.

    Delete the focus and move to the right in a JSON array.

    Definition Classes
    GenericCursor
  8. abstract def deleteLefts: Result

    Delete all values to the left of the focus in a JSON array.

    Delete all values to the left of the focus in a JSON array.

    Definition Classes
    GenericCursor
  9. abstract def deleteRights: Result

    Delete all values to the right of the focus in a JSON array.

    Delete all values to the right of the focus in a JSON array.

    Definition Classes
    GenericCursor
  10. abstract def field(k: String): Result

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

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

    Definition Classes
    GenericCursor
  11. abstract def first: Result

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

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

    Definition Classes
    GenericCursor
  12. abstract def focus: Focus[Json]

    The current location in the document.

    The current location in the document.

    Definition Classes
    GenericCursor
  13. abstract def last: Result

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

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

    Definition Classes
    GenericCursor
  14. abstract def left: Result

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

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

    Definition Classes
    GenericCursor
  15. abstract def lefts: Option[List[Json]]

    If the focus is a JSON array, return the elements to the left.

    If the focus is a JSON array, return the elements to the left.

    Definition Classes
    GenericCursor
  16. abstract def right: Result

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

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

    Definition Classes
    GenericCursor
  17. abstract def rights: Option[List[Json]]

    If the focus is a JSON array, return the elements to the right.

    If the focus is a JSON array, return the elements to the right.

    Definition Classes
    GenericCursor
  18. abstract def setLefts(x: List[Json]): Result

    Replace all values to the left of the focus in a JSON array.

    Replace all values to the left of the focus in a JSON array.

    Definition Classes
    GenericCursor
  19. abstract def setRights(x: List[Json]): Result

    Replace all values to the right of the focus in a JSON array.

    Replace all values to the right of the focus in a JSON array.

    Definition Classes
    GenericCursor
  20. abstract def up: Result

    Move the focus to the parent.

    Move the focus to the parent.

    Definition Classes
    GenericCursor
  21. abstract def withFocus(f: (Json) ⇒ Json): Cursor

    Modify the focus using the given function.

    Modify the focus using the given function.

    Definition Classes
    GenericCursor
  22. abstract def withFocusM[F[_]](f: (Json) ⇒ F[Json])(implicit arg0: M[F]): F[Cursor]

    Modify the focus in a context using the given function.

    Modify the focus in a context using the given function.

    Definition Classes
    GenericCursor

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def as[A](implicit d: Decoder[A]): Decoder.Result[A]

    Attempt to decode the focus as an A.

    Attempt to decode the focus as an A.

    Definition Classes
    CursorGenericCursor
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def downArray: Option[Cursor]

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

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

    Definition Classes
    CursorGenericCursor
  10. final def downAt(p: (Json) ⇒ Boolean): Option[Cursor]

    If the focus is a JSON array, move to the first element that satisfies the given predicate.

    If the focus is a JSON array, move to the first element that satisfies the given predicate.

    Definition Classes
    CursorGenericCursor
  11. final def downField(k: String): Option[Cursor]

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

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

    Definition Classes
    CursorGenericCursor
  12. final def downN(n: Int): Option[Cursor]

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

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

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

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

    Definition Classes
    AnyRef → Any
  15. final def fieldSet: Option[Set[String]]

    If the focus is a JSON object, return its field names in a set.

    If the focus is a JSON object, return its field names in a set.

    Definition Classes
    CursorGenericCursor
  16. final def fields: Option[List[String]]

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

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

    Definition Classes
    CursorGenericCursor
  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def find(p: (Json) ⇒ Boolean): Option[Cursor]

    If the focus is an element in a JSON array, find the first element at or to its right that matches the given predicate.

    If the focus is an element in a JSON array, find the first element at or to its right that matches the given predicate.

    Definition Classes
    CursorGenericCursor
  19. final def get[A](k: String)(implicit d: Decoder[A]): Decoder.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.

    Definition Classes
    CursorGenericCursor
  20. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

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

    Definition Classes
    Any
  23. def leftAt(p: (Json) ⇒ Boolean): Option[Cursor]

    If the focus is an element in a JSON array, move to the left until the given predicate matches the new focus.

    If the focus is an element in a JSON array, move to the left until the given predicate matches the new focus.

    Definition Classes
    CursorGenericCursor
  24. final def leftN(n: Int): Option[Cursor]

    If the focus is an element in JSON array, move to the left the given number of times.

    If the focus is an element in JSON array, move to the left the given number of times.

    A negative value will move the cursor right.

    Definition Classes
    CursorGenericCursor
  25. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  28. final def replay(history: List[HistoryOp]): Option[Cursor]

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

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

    Definition Classes
    CursorGenericCursor
  29. final def rightAt(p: (Json) ⇒ Boolean): Option[Cursor]

    If the focus is an element in a JSON array, move to the right until the given predicate matches the new focus.

    If the focus is an element in a JSON array, move to the right until the given predicate matches the new focus.

    Definition Classes
    CursorGenericCursor
  30. final def rightN(n: Int): Option[Cursor]

    If the focus is an element in JSON array, move to the right the given number of times.

    If the focus is an element in JSON array, move to the right the given number of times.

    A negative value will move the cursor left.

    Definition Classes
    CursorGenericCursor
  31. final def set(j: Json): Cursor

    Replace the focus.

    Replace the focus.

    Definition Classes
    GenericCursor
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. def toString(): String

    Definition Classes
    AnyRef → Any
  34. final def top: Json

    Return to the root of the document.

    Return to the root of the document.

    Definition Classes
    CursorGenericCursor
  35. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. final def hcursor: HCursor

    Create an HCursor for this cursor in order to track history.

    Create an HCursor for this cursor in order to track history.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.4.0) Use HCursor.fromCursor

Inherited from GenericCursor[Cursor]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Miscellaneous utilities

Type members

Cursor fields and operations

Access and navigation

Modification

Array access

Object access

Array navigation

Object navigation

Array modification

Object modification

Decoding