sealed abstract class Cursor extends Product with Serializable
Represents a position in a JSON value and allows moving around the JSON value. Also known as a "zipper." The cursor has a focus representing the current position being referred to by the cursor. Users may update the focus using withFocus
(or the >->
alias) and move the cursor around with left
, right
, field
, downArray
, downField
and up
.
- Source
- Cursor.scala
- Alphabetic
- By Inheritance
- Cursor
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
--(q: Json.JsonField): Option[Cursor]
Move the cursor to the given sibling field in a JSON object (alias for
field
). -
def
--\(q: Json.JsonField): Option[Cursor]
Move the cursor down to a JSON object at the given field (alias for
downField
). -
def
-<-:(n: Int): Option[Cursor]
Move the cursor left in a JSON array the given number of times.
Move the cursor left in a JSON array the given number of times. A negative value will move the cursor right (alias for
leftN
). -
def
-\(p: (Json) ⇒ Boolean): Option[Cursor]
Move the cursor down to a JSON array at the first element satisfying the given predicate (alias for
downAt
). -
def
:->-(n: Int): Option[Cursor]
Move the cursor right in a JSON array the given number of times.
Move the cursor right in a JSON array the given number of times. A negative value will move the cursor left (alias for
rightN
). -
def
:->?(p: (Json) ⇒ Boolean): Option[Cursor]
Move the cursor right in a JSON array until the given predicate matches the focus (alias for
rightAt
). -
def
:=(j: Json): Cursor
Set the focus to the given value (alias for
set
). -
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
=\(n: Int): Option[Cursor]
Move the cursor down to a JSON array at the given index (alias for
downN
). -
def
>->(k: (Json) ⇒ Json): Cursor
Update the focus with the given function (alias for
withFocus
). -
def
?<-:(p: (Json) ⇒ Boolean): Option[Cursor]
Move the cursor left in a JSON array until the given predicate matches the focus (alias for
leftAt
). -
def
\\: Option[Cursor]
Move the cursor down to a JSON array at the first element (alias for
downArray
). -
def
acursor: ACursor
An ACursor for this cursor that tracks history.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
context: Context
Return the current context of the focus.
-
def
delete: Option[Cursor]
Deletes the JSON value at focus and moves up to parent (alias for
deleteGoParent
). -
def
deleteGoField(q: Json.JsonField): Option[Cursor]
Deletes the JSON value at focus and moves to the given sibling field in a JSON object.
-
def
deleteGoFirst: Option[Cursor]
Deletes the JSON value at focus and moves to the first in a JSON array.
-
def
deleteGoLast: Option[Cursor]
Deletes the JSON value at focus and moves to the last in a JSON array.
-
def
deleteGoLeft: Option[Cursor]
Deletes the JSON value at focus and moves to the left in a JSON array.
-
def
deleteGoParent: Option[Cursor]
Deletes the JSON value at focus and moves up to parent (alias for
unary_!
). -
def
deleteGoRight: Option[Cursor]
Deletes the JSON value at focus and moves to the right in a JSON array.
-
def
deleteLefts: Option[Cursor]
Deletes all JSON values to left of focus in a JSON array.
-
def
deleteRights: Option[Cursor]
Deletes all JSON values to right of focus in a JSON array.
-
def
downArray: Option[Cursor]
Move the cursor down to a JSON array at the first element (alias for
\\
). -
def
downAt(p: (Json) ⇒ Boolean): Option[Cursor]
Move the cursor down to a JSON array at the first element satisfying the given predicate (alias for
-\
). -
def
downField(q: Json.JsonField): Option[Cursor]
Move the cursor down to a JSON object at the given field (alias for
--\
). -
def
downN(n: Int): Option[Cursor]
Move the cursor down to a JSON array at the given index (alias for
=\
). -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
field(q: Json.JsonField): Option[Cursor]
Move the cursor to the given sibling field in a JSON object (alias for
--
). -
def
fieldSet: Option[Set[Json.JsonField]]
All field names in a JSON object.
-
def
fields: Option[List[Json.JsonField]]
All field names in a JSON object.
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
find(p: (Json) ⇒ Boolean): Option[Cursor]
Find the first element at or to the right of focus in a JSON array where the given predicate matches the focus.
-
def
first: Option[Cursor]
Move the cursor to the first in a JSON array.
-
def
focus: Json
Return the current focus.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hcursor: HCursor
A HCursor for this cursor that tracks history.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
last: Option[Cursor]
Move the cursor to the last in a JSON array.
-
def
left: Option[Cursor]
Move the cursor left in a JSON array.
-
def
leftAt(p: (Json) ⇒ Boolean): Option[Cursor]
Move the cursor left in a JSON array until the given predicate matches the focus (alias for
?<-:
). -
def
leftN(n: Int): Option[Cursor]
Move the cursor left in a JSON array the given number of times.
Move the cursor left in a JSON array the given number of times. A negative value will move the cursor right (alias for
-<-:
). -
def
lefts: Option[Json.JsonArray]
Return the values left of focus in a JSON array.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
productIterator: Iterator[Any]
- Definition Classes
- Product
-
def
productPrefix: String
- Definition Classes
- Product
-
def
right: Option[Cursor]
Move the cursor right in a JSON array.
-
def
rightAt(p: (Json) ⇒ Boolean): Option[Cursor]
Move the cursor right in a JSON array until the given predicate matches the focus (alias for
:->?
). -
def
rightN(n: Int): Option[Cursor]
Move the cursor right in a JSON array the given number of times.
Move the cursor right in a JSON array the given number of times. A negative value will move the cursor left (alias for
:->-
). -
def
rights: Option[Json.JsonArray]
Return the values right of focus in a JSON array.
-
def
set(j: Json): Cursor
Set the focus to the given value (alias for
:=
). -
def
setLefts(x: List[Json]): Option[Cursor]
Set the values to the left of focus in a JSON array.
-
def
setRights(x: List[Json]): Option[Cursor]
Set the values to the right of focus in a JSON array.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unary_!: Option[Cursor]
Deletes the JSON value at focus and moves up to parent (alias for
deleteGoParent
). -
def
unary_-: Json
Unapplies the cursor to the top-level parent (alias for
undo
). -
def
undo: Json
Unapplies the cursor to the top-level parent (alias for
unary_-
). -
def
up: Option[Cursor]
Move the cursor up one step to the parent context.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
withFocus(k: (Json) ⇒ Json): Cursor
Update the focus with the given function (alias for
>->
).