StandardRowParser

com.phasmidsoftware.tableparser.core.parse.StandardRowParser
See theStandardRowParser companion object
case class StandardRowParser[Row](parser: LineParser)(using evidence$1: CellParser[Row]) extends StringParser[Row]

StandardRowParser: a parser which extends RowParser[Row] and will yield a Try[Row] from a String representing a line of a table.

Type parameters

Row

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

Value parameters

parser

the LineParser to use

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait StringParser[Row]
trait RowParser[Row, String]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def parse(header: Header)(input: String): 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: Strings): Try[Header]

Method to parse a String as a Try[Header].

Method to parse a String as a Try[Header].

Value parameters

xs

the header row(s) as a String.

Attributes

Returns

a Try[Header].

def parseIndexed(header: Header)(indexedString: (String, Int)): Try[Row]

Parses a given indexed string (line and its index in a file) using a provided header and the internal row parser. This method converts the parsed row of data (as Strings) into a well-defined Row object according to the header.

Parses a given indexed string (line and its index in a file) using a provided header and the internal row parser. This method converts the parsed row of data (as Strings) into a well-defined Row object according to the header.

Value parameters

header

the header object providing column information for the row.

indexedString

a tuple containing the string representation of the line and its index in the file.

Attributes

Returns

a Try[Row] representing the parsed and converted row, or a failure if the parsing or conversion fails.

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product