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
.
- Alphabetic
- By Inheritance
- ACursor
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
delete: ACursor
Delete the focus and move to its parent.
-
abstract
def
downArray: ACursor
If the focus is a JSON array, move to its first element.
-
abstract
def
downField(k: String): ACursor
If the focus is a JSON object, move to the value of the given key.
-
abstract
def
downN(n: Int): ACursor
If the focus is a JSON array, move to the element at the given index.
-
abstract
def
field(k: String): ACursor
If the focus is a value in a JSON object, move to a sibling with the given key.
-
abstract
def
focus: Option[Json]
The current location in the document.
-
abstract
def
keys: Option[Iterable[String]]
If the focus is a JSON object, return its field names in their original order.
-
abstract
def
left: ACursor
If the focus is an element in a JSON array, move to the left.
-
abstract
def
right: ACursor
If the focus is an element in a JSON array, move to the right.
-
abstract
def
succeeded: Boolean
Indicate whether this cursor represents the result of a successful operation.
-
abstract
def
success: Option[HCursor]
Return the cursor as an HCursor if it was successful.
-
abstract
def
top: Option[Json]
Return to the root of the document.
-
abstract
def
up: ACursor
Move the focus to the parent.
-
abstract
def
values: Option[Iterable[Json]]
If the focus is a JSON array, return its elements.
-
abstract
def
withFocus(f: (Json) ⇒ Json): ACursor
Modify the focus using the given function.
-
abstract
def
withFocusM[F[_]](f: (Json) ⇒ F[Json])(implicit F: Applicative[F]): F[ACursor]
Modify the focus in a context using the given function.
-
abstract
def
first: ACursor
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.
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use up and downArray
-
abstract
def
leftN(n: Int): ACursor
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.
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use left
-
abstract
def
rightN(n: Int): ACursor
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.
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use right
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
as[A](implicit d: Decoder[A]): Result[A]
Attempt to decode the focus as an
A
. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
failed: Boolean
Indicate whether this cursor represents the result of an unsuccessful operation.
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
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
. -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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 fieldk
is missing, then use thefallback
instead. -
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
history: List[CursorOp]
The operations that have been performed so far.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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()
-
final
def
replay(history: List[CursorOp]): ACursor
Replay history (a list of operations in reverse "chronological" order) against this cursor.
-
final
def
replayOne(op: CursorOp): ACursor
Replay an operation against this cursor.
-
final
def
set(j: Json): ACursor
Replace the focus.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )