RowParser

com.phasmidsoftware.tableparser.core.parse.RowParser
trait RowParser[Row, Input]

Trait to describe a parser which will yield a Try[Row] from a String representing a row of a table.

Type parameters

Input

the (parametric) Input type for which there must be evidence of a RowParser[Row, Input].

Row

the (parametric) Row type for which there must be evidence of a RowParser[Row, Input].

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait StringParser[Row]
class StandardRowParser[Row]
trait StringsParser[Row]

Members list

Value members

Abstract methods

def parse(header: Header)(input: Input): Try[Row]

Parses the given input using the provided header and produces a result wrapped in a Try.

Parses the given input using the provided header and produces a result wrapped in a Try.

Value parameters

header

the header object that defines the schema or metadata for parsing the row.

input

the input of type Input to be parsed into a row of type Row.

Attributes

Returns

a Try[Row], where Success contains the parsed row if parsing succeeds, or Failure contains an exception if parsing fails.

def parseHeader(xs: Seq[Input]): Try[Header]

Parse the Input, resulting in a Try[Header]

Parse the Input, resulting in a Try[Header]

CONSIDER making this share the same signature as parse but for different Row type.

Value parameters

xs

a sequence of Inputs to be parsed.

Attributes

Returns

a Try[Header]

def parseIndexed(header: Header)(indexedRow: (Input, Int)): Try[Row]

Parses an indexed row, using the given header, into a Try[Row].

Parses an indexed row, using the given header, into a Try[Row].

Value parameters

header

the header which defines the schema or metadata for parsing the row.

indexedRow

a tuple containing the input row (of type Input) and its index (of type Int).

Attributes

Returns

a Try[Row] which will be a Success containing the parsed row if parsing is successful, or a Failure with an exception if parsing fails.