FreeCursor

cats.xml.cursor.FreeCursor
See theFreeCursor companion object
sealed trait FreeCursor[+O] extends Serializable

FreeCursor represent a cursor with a free O type as result of the focusing.

Type parameters

O

Output type of the FreeCursor

Attributes

Companion
object
Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Self type

Members list

Value members

Abstract methods

def focus(input: Xml): Result[O]

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

Apply the current cursor to the specified input of type I. This allows to select a precise part of the input I 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

Concrete methods

def map[U](f: O => U): FreeCursor[U]

Map the result of this cursor when succeed

Map the result of this cursor when succeed

Type parameters

U

Type of mapped value

Value parameters

f

Function to map the result of this cursor

Attributes

Returns

A new FreeCursor which once applied, apply this cursor and then if succeed apply the function f in order to map the result

def validate[OO >: O](validator: Validator[OO]): FreeCursor[OO]

Create a new FreeCursor where the output of this cursor is validated with the specified Validator

Create a new FreeCursor where the output of this cursor is validated with the specified Validator

Type parameters

OO

Output type of the new validated FreeCursor

Value parameters

validator

Validator instance to validate the output of this cursor

Attributes

Returns

A new validated FreeCursor