package parse
- Alphabetic
- By Inheritance
- parse
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
abstract
class
AbstractTableParser[Table] extends TableParser[Table]
Abstract base class for implementations of TableParser[T].
Abstract base class for implementations of TableParser[T]. NOTE: that Table is a parametric type and does NOT refer to the type Table defined elsewhere.
- Table
the (parametric) Table type.
-
case class
AttributeSet(xs: StringList) extends Product with Serializable
This class is used for the situation where a column in a table actually contains a set of attributes, typically separated by "," and possibly bracketed by "{}".
This class is used for the situation where a column in a table actually contains a set of attributes, typically separated by "," and possibly bracketed by "{}". CONSIDER allowing "|" as a separator (as described previously in the documentation here).
- xs
the attribute values.
- case class BlankException(e: Throwable = null) extends ParseableException with Product with Serializable
-
trait
CellParser[+T] extends AnyRef
Type class trait CellParser[T].
Type class trait CellParser[T]. This trait has methods to parse and to convert from String to T.
TODO Need to define this better so that we don't have any non-implemented methods.
- T
the type of the resulting object.
- Annotations
- @implicitNotFound( ... )
-
trait
CellParsers extends AnyRef
Trait to define the various parsers for reading case classes and their parameters from table rows.
Trait to define the various parsers for reading case classes and their parameters from table rows.
NOTE: In each of these cellParser methods, the CellParser has a parse method which ignores the columns.
-
case class
CellValue(w: String) extends Convertible with Product with Serializable
A concrete Convertible corresponding to a cell value.
A concrete Convertible corresponding to a cell value.
- w
the String contained by a cell.
-
trait
ColumnHelper[T] extends AnyRef
Type class representing a mapping from a case class parameter to the corresponding column header.
Type class representing a mapping from a case class parameter to the corresponding column header.
- T
the type of the object being helped.
- Annotations
- @implicitNotFound( ... )
-
sealed abstract
class
Convertible extends AnyRef
Abstract class Convertible.
Abstract class Convertible.
CONSIDER making this a trait since it takes no value parameters.
- trait CopyableTableParser[Row, Input, Table] extends AnyRef
-
trait
DefaultRowConfig extends RowConfig
Default RowConfig trait.
-
case class
HeadedStringTableParser[X](maybeFixedHeader: Option[Header] = None, forgiving: Boolean = false)(implicit evidence$1: CellParser[X], evidence$2: ClassTag[X]) extends StringTableParser[Table[X]] with CopyableTableParser[X, String, Table[X]] with Product with Serializable
Case class to define a StringTableParser that assumes a header to be found in the input file.
Case class to define a StringTableParser that assumes a header to be found in the input file. This class attempts to provide as much built-in functionality as possible.
This class assumes that the names of the columns are in the first line. This class implements builder with a HeadedTable object. This class uses StandardRowParser of its rowParser.
- X
the underlying row type which must provide evidence of a CellParser and ClassTag.
- maybeFixedHeader
None => requires that the data source has a header row. Some(h) => specifies that the header is to be taken from h. NOTE: that the simplest is to specify the header directly from the type X:
- See also
HeadedStringTableParser#create
- case class InvalidParseException(msg: String, e: Throwable = null) extends ParseableException with Product with Serializable
-
class
LineParser extends JavaTokenParsers
LineParser: class to parse lines of a CSV file.
LineParser: class to parse lines of a CSV file. NOTE: list elements always appear as a string in the form { element0 , element1 , ... }
-
class
ListParser extends JavaTokenParsers
This class is a parser of lists.
This class is a parser of lists. A list is considered to be enclosed by {} and separated by commas.
-
trait
MultiCellParser[T] extends CellParser[T]
CONSIDER renaming this to something like RowParser, or RawRowParser.
CONSIDER renaming this to something like RowParser, or RawRowParser.
- T
the type of the result.
- case class MultiLineException[X](x: X) extends Exception with Product with Serializable
- case class ParseLogicException(msg: String, e: Throwable = null) extends Exception with Product with Serializable
-
trait
Parseable[T] extends AnyRef
Type class which describes a type which can be parsed from a String.
Type class which describes a type which can be parsed from a String.
- T
the resulting type.
- Annotations
- @implicitNotFound( ... )
- abstract class ParseableException extends Exception
-
abstract
class
ParseableOption[T] extends Parseable[Option[T]]
Abstract class to parse optional scala values.
Abstract class to parse optional scala values.
- T
the resulting type for which there must be evidence of a Parseable[T].
- case class ParserException(msg: String, e: Throwable = null) extends Exception with Product with Serializable
-
case class
ParsersException(w: String) extends Exception with Product with Serializable
CONSIDER: do we really need this exception?
CONSIDER: do we really need this exception?
- w
the message.
-
abstract
class
RawParsers extends CellParsers
Abstract class to define a raw parser, that's to say a Parser of Seq[String]
-
case class
RawTableParser(predicate: (Try[RawRow]) ⇒ Boolean = TableParser.includeAll, maybeFixedHeader: Option[Header] = None, forgiving: Boolean = false, multiline: Boolean = false) extends StringTableParser[Table[Seq[String]]] with CopyableTableParser[RawRow, String, Table[Seq[String]]] with Product with Serializable
Class used to parse files as a Table of Seq[String].
Class used to parse files as a Table of Seq[String]. That's to say, no parsing of individual (or groups of) columns.
- predicate
a predicate which, if true, allows inclusion of the input row.
- maybeFixedHeader
an optional fixed header. If None, we expect to find the header defined in the first line of the file.
- forgiving
forcing (defaults to true). If true then an individual malformed row will not prevent subsequent rows being parsed.
-
trait
RowConfig extends AnyRef
Trait to define the configuration for parsing a row.
-
trait
RowParser[Row, Input] extends AnyRef
Trait to describe a parser which will yield a Try[Row] from a String representing a row of a table.
Trait to describe a parser which will yield a Try[Row] from a String representing a row of a table.
- Row
the (parametric) Row type for which there must be evidence of a RowParser[Row, Input].
- Input
the (parametric) Input type for which there must be evidence of a RowParser[Row, Input].
- Annotations
- @implicitNotFound( ... )
-
case class
RowValues(row: Row, header: Header) extends Convertible with Product with Serializable
A concrete Convertible corresponding to a row.
A concrete Convertible corresponding to a row.
- row
the Row containing several values.
- header
the Header.
-
trait
SingleCellParser[T] extends CellParser[T]
Trait SingleCellParser, which extends CellParser[T].
Trait SingleCellParser, which extends CellParser[T].
- T
the type of the resulting object.
-
case class
StandardRowParser[Row](parser: LineParser)(implicit evidence$1: CellParser[Row]) extends StringParser[Row] with Product with Serializable
StandardRowParser: a parser which extends RowParser[Row] and will yield a Try[Row] from a String representing a line of a table.
StandardRowParser: a parser which extends RowParser[Row] and will yield a Try[Row] from a String representing a line of a table.
- Row
the (parametric) Row type for which there must be evidence of a CellParser[Row].
- parser
the LineParser to use
-
case class
StandardStringsParser[Row]()(implicit evidence$3: CellParser[Row]) extends StringsParser[Row] with Product with Serializable
StandardRowParser: a parser which extends RowParser[Row] and will yield a Try[Row] from a String representing a line of a table.
StandardRowParser: a parser which extends RowParser[Row] and will yield a Try[Row] from a String representing a line of a table.
- Row
the (parametric) Row type for which there must be evidence of a CellParser[Row].
-
type
StringList = List[String]
type alias for the results of parsing repetitions of String.
-
trait
StringParser[Row] extends RowParser[Row, String]
A RowParser whose input type is String.
A RowParser whose input type is String.
- Row
the (parametric) Row type for which there must be evidence of a RowParser[Row, Input].
-
abstract
class
StringTableParser[Table] extends AbstractTableParser[Table]
Abstract class to extend AbstractTableParser but with Input = String.
Abstract class to extend AbstractTableParser but with Input = String. This is the normal situation where a file is a sequence of Strings, each representing one line.
- Table
the table type.
-
type
Strings = Seq[String]
type alias for parsing rows which are composed of a sequence of String.
-
trait
StringsParser[Row] extends RowParser[Row, Strings]
Trait to describe a parser which will yield a Try[Row] from a sequence of Strings representing a row of a table.
Trait to describe a parser which will yield a Try[Row] from a sequence of Strings representing a row of a table.
- Row
the (parametric) Row type for which there must be evidence of a CellParser[Row].
-
abstract
class
StringsTableParser[Table] extends AbstractTableParser[Table]
Abstract class to extend AbstractTableParser but with Input = Strings This is the unusual situation where a file is a sequence of a sequence of Strings, each representing one value.
Abstract class to extend AbstractTableParser but with Input = Strings This is the unusual situation where a file is a sequence of a sequence of Strings, each representing one value.
- Table
the table type.
-
trait
TableParser[Table] extends AnyRef
Type class to parse a set of rows as a Table.
Type class to parse a set of rows as a Table.
- Table
the Table type.
- Annotations
- @implicitNotFound( ... )
- case class TableParserException(msg: String, e: Option[Throwable] = None) extends Exception with Product with Serializable
-
abstract
class
TableParserHelper[X] extends CellParsers
TableParserHelper: abstract class to help with defining an implicit TableParser of Table[X].
TableParserHelper: abstract class to help with defining an implicit TableParser of Table[X]. Note that this class extends CellParser[X]. It is expected that this should be sub-classed by the object which is the companion object of X. That will make it easiest for the compiler to discover the implicit value of type TableParser of Table[X]
NOTE: this class should be used for simple cases where the the data and type X match according to one of options for sourceHasHeaderRow. More complex situations can easily be handled but not using this TableParserHelper class.
- X
the type for which we require a TableParser[X].
Value Members
- def cellReader[T](implicit cellParser: CellParser[T]): CellParser[T]
- object AbstractTableParser
- object AttributeSet extends Serializable
- object CellParser
-
object
CellParsers
This companion object comprises CellParser[T] objects which represent conversions that are fixed, i.e.
This companion object comprises CellParser[T] objects which represent conversions that are fixed, i.e. they don't depend on some other parameter such as the formatter in DateTime conversions.
- object ColumnHelper
- object HeadedStringTableParser extends Serializable
- object LineParser
- object Parseable
- object ParseableOption
- object RawParsers
-
object
RowConfig
Companion object to RowConfig.
- object RowValues extends Serializable
- object StandardRowParser extends Serializable
- object TableParser