Cursor

cats.xml.cursor.Cursor
See theCursor companion object
sealed trait Cursor[+X <: Xml] extends Serializable

Attributes

Companion
object
Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
trait HCursor[HFocus, VC, HC]
class AttrCursor
trait VCursor[HFocus, VC]
trait NodeCursor
object Root
class Simple
class TextCursor
Show all

Members list

Type members

Types

type Focus

Value members

Abstract methods

def focus(input: XmlNode): Result[X]

Apply the current cursor to the specified input. This allows to select a precise part of the Xml tree.

Apply the current cursor to the specified input. This allows to select a precise part of the Xml tree.

The method is pure and return a Left when the focusing fails

Value parameters

input

target of the cursor

Attributes

Returns

Right when succeed Left when fail

def path: String

A String representation of the cursor.

A String representation of the cursor.

Attributes

Returns

a String which represent the cursor path

Concrete methods

def as[T : Decoder]: FreeCursor[T]

Create a FreeCursor which represent a cursor with a free T type as result of the focusing, this implies that a Decoder instance is need to convert the fixed Xml type of the Cursor to the free T type of the FreeCursor.

Create a FreeCursor which represent a cursor with a free T type as result of the focusing, this implies that a Decoder instance is need to convert the fixed Xml type of the Cursor to the free T type of the FreeCursor.

So, practically speaking, when the FreeCursor is applied this Cursor is applied and the result is decoded using the specified Decoder for type T.

Type parameters

T

free type in which decode the current cursor result

Attributes

Returns

A new FreeCursor

final override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any