com.phasmidsoftware.tableparser.core.parse
Members list
Type members
Classlikes
Abstract class representing a row processor for handling input rows and parsing them into a specified row type.
Abstract class representing a row processor for handling input rows and parsing them into a specified row type.
This class extends the RowProcessor type class and provides additional methods for processing iterators of input rows based on headers and transformation functions. It relies on the implicit evidence of the Joinable type class to define behavior for handling the input type.
Type parameters
- Row
-
the type of rows output by this processor.
Attributes
- Supertypes
- Known subtypes
-
class StringRowProcessor[Row]
The AbstractTableParser companion object provides utility methods for logging exceptions during the table parsing process.
The AbstractTableParser companion object provides utility methods for logging exceptions during the table parsing process.
This object includes methods to log exceptions, whether they are directly provided as a Throwable or wrapped inside a Try result.
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AbstractTableParser.type
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.
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.
CONSIDER making this a trait
Type parameters
- Table
-
the (parametric) Table type.
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
class StringTableParser[Table]class HeadedCSVTableParser[T]class HeadedStringTableParser[X]class PlainTextHeadedStringTableParser[X]class RawTableParserclass StringsTableParser[Table]Show all
The AttributeSet object provides utility methods for constructing and parsing instances of the AttributeSet class. This is primarily used for handling a column in a table that represents a set of attributes, typically formatted as a comma-separated list, and potentially enclosed in brackets or other separators.
The AttributeSet object provides utility methods for constructing and parsing instances of the AttributeSet class. This is primarily used for handling a column in a table that represents a set of attributes, typically formatted as a comma-separated list, and potentially enclosed in brackets or other separators.
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrortrait CsvRendererstrait CsvGeneratorstrait CellParsersclass Objecttrait Matchableclass AnyShow all
- Self type
-
AttributeSet.type
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).
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).
Value parameters
- xs
-
the attribute values.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A case class representing a specific exception type BlankException used when a blank value or an error associated with a blank value is encountered during the parsing process. It extends ParseableException as its base type.
A case class representing a specific exception type BlankException used when a blank value or an error associated with a blank value is encountered during the parsing process. It extends ParseableException as its base type.
Value parameters
- e
-
an optional
Throwablecause associated with the exception. Defaults tonullif not provided.
Attributes
- Constructor
-
Creates a new
BlankExceptionby delegating to the baseParseableExceptionand providing the message identifier "blank" along with the optional causee. - Example
-
// Throwing a BlankException with a cause throw BlankException(new IllegalArgumentException("Blank value encountered")) // Throwing a BlankException without a cause throw BlankException() - Supertypes
-
trait Producttrait Equalsclass ParseableExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Type-class trait CellParser[T]. This trait has methods to parse and to convert from String to 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.
Type parameters
- T
-
the (covariant) type of the resulting object.
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
trait MultiCellParser[T]class ProductCellParser[T]trait SingleCellParser[T]object BigDecimalCellParserobject BigIntCellParserobject BooleanCellParserobject ByteCellParserobject CharCellParserobject DoubleCellParserobject FileParserobject FloatCellParserobject IntCellParserobject LocalDateParserobject LongCellParserclass OptionParser[T]object BooleanOptionParserobject DoubleOptionParserobject FileOptionParserobject IntOptionParserobject LocalDateOptionParserobject LongOptionParserobject URLOptionParserobject ShortCellParserobject StringCellParserobject URLParserShow all
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CellParser.type
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.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object AttributeSetclass RawParsersobject WithHeaderRowobject StdCellParsersclass TableParserHelper[X]
A concrete Convertible corresponding to a cell value.
A concrete Convertible corresponding to a cell value.
Value parameters
- w
-
the String contained by a cell.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Convertibleclass Objecttrait Matchableclass AnyShow all
Object containing utility functions for mapping and transforming column names, providing multiple default strategies for common transformations.
Object containing utility functions for mapping and transforming column names, providing multiple default strategies for common transformations.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ColumnHelper.type
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.
Type parameters
- T
-
the type of the object being helped.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
The CellParser made by CellParsers.cellParser2Conditional.
The CellParser made by CellParsers.cellParser2Conditional.
Type parameters
- K
-
the type of the first field of T.
- P
-
the type of the second field of T.
- T
-
the type of the result.
Value parameters
- construct
-
a function (K,P) => T.
- fields
-
the names of the two fields of T.
- parsers
-
the parser of P to use for each value of K.
- typeName
-
the name of T (used in error messages).
Attributes
- Supertypes
-
trait MultiCellParser[T]trait CellParser[T]trait StringConverter[T]class Objecttrait Matchableclass AnyShow all
A trait representing a parser for tables that supports configurability and row-level parsing.
A trait representing a parser for tables that supports configurability and row-level parsing.
The CopyableTableParser provides methods to configure the parsing behavior of tables, such as defining headers, enabling forgiving or multiline parsing modes, setting predicates for row filtering, and defining custom row parsing logic. It operates generically over three types: Row, representing a single row in the table; Input, representing raw input data for parsing rows; and Table, representing the parsed table as a whole.
Type parameters
- Input
-
the type of the raw input data used to parse rows.
- Row
-
the type of a single row in the table.
- Table
-
the type of the parsed table.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Abstract class for parsing tables from CSV-formatted strings, where the table has a defined header. This is the most convenient subtype of TableParser for most CSV files.
Abstract class for parsing tables from CSV-formatted strings, where the table has a defined header. This is the most convenient subtype of TableParser for most CSV files.
Type parameters
- T
-
the parametric type of rows in the table.
Value parameters
- rp
-
an implicit
RowParser, which defines the logic for parsing individual rows of typeTfrom strings.
Attributes
- Supertypes
-
class Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
Abstract class to define a StringTableParser that assumes a header to be found in the input file. There are two subclasses: PlainTextHeadedStringTableParser and EncryptedHeadedStringTableParser This class attempts to provide as much built-in functionality as possible.
Abstract class to define a StringTableParser that assumes a header to be found in the input file. There are two subclasses: PlainTextHeadedStringTableParser and EncryptedHeadedStringTableParser 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.
NOTE that this class and HeadedCSVTableParser are extremely similar (maybe identical) CONSIDER merging with HeadedCSVTableParser
Type parameters
- X
-
the underlying row type for which there must be evidence of a CellParser and ClassTag.
Value parameters
- forgiving
-
if true, exceptions when parsing individual rows will be logged then ignored. if false, any exception will terminate the parsing. Defaults to false.
- headerRowsToRead
-
the number of header rows expected in the input file defaults to 1.
- maybeFixedHeader
-
None => requires that the data source has a header row. Some(h) => specifies that the header is to be taken from h. Defaults to None. NOTE: that the simplest is to specify the header directly from the type X.
Attributes
- See also
-
HeadedStringTableParser#create
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class PlainTextHeadedStringTableParser[X]
The IndexedInputToRowsAggregator class provides functionality to process and aggregate input data of type Input into structured rows of type Row, with support for error handling, validation, and conditional processing. It extends the abstract class InputAggregator.
The IndexedInputToRowsAggregator class provides functionality to process and aggregate input data of type Input into structured rows of type Row, with support for error handling, validation, and conditional processing. It extends the abstract class InputAggregator.
The class leverages implicit Joinable behavior for Input and works with Try to handle potential failures during the transformation of input data into rows. The flexibility is further increased with options to apply a custom predicate to filter rows, enable forgiving behavior (ignoring failures), and process multi-line inputs.
Type parameters
- Input
-
the type of input elements to be processed.
- Row
-
the type of rows transformed from the input.
Value parameters
- f
-
a function that takes a tuple of
(Input, Int)and returns aTry[Row], used to transform each input element and its index into aRow. - forgiving
-
a flag indicating whether forgiving behavior is enabled (i.e., failures are logged and ignored rather than propagated).
- multiline
-
a flag indicating whether multi-line input processing is enabled.
- predicate
-
a function that takes a
Try[Row]and returns a boolean, used to filter processed rows based on custom validation logic.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
A transformer class designed to map and process inputs to rows while handling indexed inputs.
A transformer class designed to map and process inputs to rows while handling indexed inputs.
This class extends InputTransformer and provides functionality to apply a transformation defined by a function f to indexed inputs ((Input, Int)), processing the resulting Try[Row] instances to either extract valid Row results or handle errors using logging.
Type parameters
- Input
-
The type of input elements to be processed. Must have an implicit
Joinable[Input]defined. - Row
-
The type of rows produced after transformation.
Value parameters
- f
-
A function that takes an
(Input, Int)tuple and maps it to aTry[Row], representing the transformation logic from input to row with error handling. - multiline
-
A boolean flag indicating whether the transformation operates in a multiline mode.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
The InputAggregator abstract class extends the InputPreprocessor trait to provide additional higher-level processing functionality for input data. It focuses on aggregating and processing transformed rows encapsulated in Try, with support for filtering invalid or failed transformations and wrapping the successfully processed rows in a desired container type Wrapper[_].
The InputAggregator abstract class extends the InputPreprocessor trait to provide additional higher-level processing functionality for input data. It focuses on aggregating and processing transformed rows encapsulated in Try, with support for filtering invalid or failed transformations and wrapping the successfully processed rows in a desired container type Wrapper[_].
This class serves as an abstraction for handling the pipeline of parsing, processing, and aggregating data within a flexible and reusable structure, designed to be used in applications that involve parsing and pre-processing input data into structured forms.
Type parameters
- Input
-
the type of input elements to be processed, such as raw data or records.
- Row
-
the type of rows that result from processing the inputs, typically structured representations.
- Wrapper
-
the container type used to wrap the successfully processed rows, e.g.,
Option,Either, orList.
Attributes
- Supertypes
- Known subtypes
-
A trait that defines a contract for mapping an input of type Input to a row of type Row as a computation that can either succeed or fail, represented by Try[Row].
A trait that defines a contract for mapping an input of type Input to a row of type Row as a computation that can either succeed or fail, represented by Try[Row].
InputMapper is designed to abstract the process of parsing or transforming an input into a structured row representation, where the input may come from any external or internal source and the row represents a meaningful structured output.
NOTE this does not handle sequenced input. If you potentially need to handle sequenced input, use InputPreprocessor instead.
Type parameters
- Input
-
the type of input that will be processed or parsed (e.g., raw data).
- Row
-
the type of the resulting row produced by the mapping (e.g., structured data).
Attributes
- Supertypes
-
trait Input => Try[Row]class Objecttrait Matchableclass Any
A trait for preprocessing input data elements into rows, representing an early stage in data transformation pipelines. The InputPreprocessor trait defines a contract for mapping input data of type Input into rows of type Row, encapsulated in Try to handle processing outcomes.
A trait for preprocessing input data elements into rows, representing an early stage in data transformation pipelines. The InputPreprocessor trait defines a contract for mapping input data of type Input into rows of type Row, encapsulated in Try to handle processing outcomes.
This abstraction is intended to facilitate robust and reusable data-parsing workflows, allowing the encapsulation of individual transformations or mappings with error-handling functionality. Implementations of this trait can provide specific strategies or rules for transforming input into rows, effectively bridging raw input data and downstream processing.
Type parameters
- Input
-
the type of input elements to be processed, e.g., raw data points or records.
- Row
-
the type of rows to be produced by the mapping, e.g., structured representations of the input (such as case classes or key-value mappings).
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
An abstract class InputTransformer that extends InputPreprocessor and defines methods for transforming input data into rows, including error handling and extracting valid data rows.
An abstract class InputTransformer that extends InputPreprocessor and defines methods for transforming input data into rows, including error handling and extracting valid data rows.
This class provides a scaffold for implementing data preprocessing pipelines by utilizing input-to-row transformations (mapTsToRows) and processing the results to extract valid rows while disregarding or handling errors (processTriedRows). It facilitates robust and reusable approaches in data processing workflows, making it easier to define reusable transformation logic for specific input data types and row structures.
Type parameters
- Input
-
the type of input elements to be processed, for example, raw data records or strings.
- Row
-
the type of rows to be produced after transformation, typically structured representations like case classes or tuples.
Attributes
- Supertypes
- Known subtypes
-
A case class representing an exception that occurs when a parsing error is encountered and the parsing operation fails to produce a valid result.
A case class representing an exception that occurs when a parsing error is encountered and the parsing operation fails to produce a valid result.
This exception is a specialized form of ParseableException.
Value parameters
- e
-
An optional
Throwablecause for the exception (default isnull). - msg
-
A string message providing details about the parsing error.
Attributes
- Constructor
-
Creates an instance of
InvalidParseException. - Supertypes
-
trait Producttrait Equalsclass ParseableExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Companion object for the LineParser class, responsible for constructing instances of LineParser and providing logging capabilities.
Companion object for the LineParser class, responsible for constructing instances of LineParser and providing logging capabilities.
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
LineParser.type
LineParser: class to parse lines of a CSV file. NOTE: list elements always appear as a string in the form { element0 , element1 , ... }
LineParser: class to parse lines of a CSV file. NOTE: list elements always appear as a string in the form { element0 , element1 , ... }
Value parameters
- delimiter
-
a Regex used to match a delimiter between cells in a row.
- enclosures
-
the enclosure characters around a list (if any).
- listSeparator
-
the list separator character.
- quote
-
the quote character which is able to preempt the string regex: between two quote characters, there can be any number of any character (other than quote).
- string
-
a Regex used to match the content of a cell.
- verbose
-
will print the various parameters.
Attributes
- Companion
- object
- Supertypes
-
trait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
This object is a parser of lists. A list is considered to be enclosed by {} and separated by commas.
This object is a parser of lists. A list is considered to be enclosed by {} and separated by commas.
Attributes
- Supertypes
-
trait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Self type
-
ListParser.type
CONSIDER renaming this to something like RowParser, or RawRowParser.
CONSIDER renaming this to something like RowParser, or RawRowParser.
Type parameters
- T
-
the type of the result.
Attributes
- Supertypes
- Known subtypes
-
class ProductCellParser[T]
The MultiLineException class is a case class that extends the Exception class. This exception is designed to handle multi-line exception scenarios where custom content is provided to describe the error.
The MultiLineException class is a case class that extends the Exception class. This exception is designed to handle multi-line exception scenarios where custom content is provided to describe the error.
Type parameters
- X
-
The generic type of the content that can represent the cause or context of the exception. The exception message is constructed dynamically by concatenating the string "multi-line exception: " with the provided content. Usage example:
val exception = MultiLineException("An error occurred") throw exception
Value parameters
- x
-
The content of type
Xthat describes the exception or provides context for it.
Attributes
- Supertypes
-
trait Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Exception class representing an error encountered during parsing logic.
Exception class representing an error encountered during parsing logic.
This exception is used to indicate situations where parsing fails due to some issue in the business or logical rules during the process of parsing data.
Value parameters
- e
-
The underlying cause of the exception, if any. Defaults to
nullif no specific cause is provided. - msg
-
A descriptive message providing information about the error. This message is used to help diagnose the cause of the parsing failure.
Attributes
- Supertypes
-
trait Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
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.
Type parameters
- T
-
the resulting type.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait ParseableBigDecimalobject ParseableBigDecimaltrait ParseableBigIntobject ParseableBigInttrait ParseableBooleanobject ParseableBooleantrait ParseableByteobject ParseableBytetrait ParseableCharobject ParseableChartrait ParseableDoubleobject ParseableDoubletrait ParseableFileobject ParseableFiletrait ParseableFloatobject ParseableFloattrait ParseableIntobject ParseableInttrait ParseableLocalDateobject ParseableLocalDatetrait ParseableLongobject ParseableLongtrait ParseablePathobject ParseablePathtrait ParseableShortobject ParseableShorttrait ParseableStringobject ParseableStringtrait ParseableStringListobject ParseableStringListtrait ParseableURLobject ParseableURLclass ParseableOption[T]object ParseableOptionBigDecimalobject ParseableOptionBigIntobject ParseableOptionBooleanobject ParseableOptionByteobject ParseableOptionDoubleobject ParseableOptionFileobject ParseableOptionFloatobject ParseableOptionIntobject ParseableOptionLocalDateobject ParseableOptionLongobject ParseableOptionPathobject ParseableOptionShortobject ParseableOptionStringobject ParseableOptionURLShow all
The Parseable object provides a set of predefined Parseable type class instances that enable parsing of String representations into instances of various data types. These parsers operate based on the Parseable[T] trait, which defines a parse method that returns a Try[T].
The Parseable object provides a set of predefined Parseable type class instances that enable parsing of String representations into instances of various data types. These parsers operate based on the Parseable[T] trait, which defines a parse method that returns a Try[T].
This framework is designed to handle common data parsing scenarios with support for additional parsing behaviors through optional modifiers.
The parsers handle parsing errors gracefully, returning a Failure instance with an appropriate exception message when parsing fails.
Attributes
Abstract class ParseableException is an extension of the standard Scala Exception class and provides a base structure for defining custom exceptions that can carry a parse error message and an optional cause (a Throwable).
Abstract class ParseableException is an extension of the standard Scala Exception class and provides a base structure for defining custom exceptions that can carry a parse error message and an optional cause (a Throwable).
This class can be used as a foundation for defining exceptions when parsing operations fail or encounter errors, allowing informative and structured error reporting.
Value parameters
- e
-
an optional throwable that caused this exception, defaulting to
nullif not provided. - msg
-
the error message detailing the cause or nature of the parsing issue.
Attributes
- Supertypes
-
class Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class BlankExceptionclass InvalidParseException
The ParseableOption object provides implicit instances of ParseableOption for various types, enabling the parsing of optional Scala values.
The ParseableOption object provides implicit instances of ParseableOption for various types, enabling the parsing of optional Scala values.
ParseableOption works in conjunction with the abstract class of the same name, allowing strings to be parsed into optional values of specified types while handling blanks as None. This is achieved through the underlying Parseable evidence available for the corresponding type.
The implicit objects defined here provide type-specific implementations for common data types like String, Int, Boolean, LocalDate, and more.
These implicit objects are particularly useful in scenarios involving generic parsing where the target type is optional, and blanks should not raise errors but return None.
Example:
import com.phasmidsoftware.tableparser.core.parse._
import ParseableOption._
val maybeInt: Try[Option[Int]] = summon[Parseable[Option[Int]]].parse("42", None)
val maybeNone: Try[Option[Int]] = summon[Parseable[Option[Int]]].parse("", None)
The implicit instances provided:
ParseableOptionString: Parses optionalStringParseableOptionBoolean: Parses optionalBooleanParseableOptionByte: Parses optionalByteParseableOptionShort: Parses optionalShortParseableOptionInt: Parses optionalIntParseableOptionFloat: Parses optionalFloatParseableOptionDouble: Parses optionalDoubleParseableOptionLong: Parses optionalLongParseableOptionBigInt: Parses optionalBigIntParseableOptionBigDecimal: Parses optionalBigDecimalParseableOptionLocalDate: Parses optionalLocalDateParseableOptionURL: Parses optionaljava.net.URLParseableOptionFile: Parses optionaljava.io.File
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ParseableOption.type
Abstract class to parse optional scala values.
Abstract class to parse optional scala values.
Type parameters
- T
-
the resulting type for which there must be evidence of a Parseable[T].
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
object ParseableOptionBigDecimalobject ParseableOptionBigIntobject ParseableOptionBooleanobject ParseableOptionByteobject ParseableOptionDoubleobject ParseableOptionFileobject ParseableOptionFloatobject ParseableOptionIntobject ParseableOptionLocalDateobject ParseableOptionLongobject ParseableOptionPathobject ParseableOptionShortobject ParseableOptionStringobject ParseableOptionURLShow all
Represents an exception that occurs during parsing operations.
Represents an exception that occurs during parsing operations.
Value parameters
- e
-
the underlying throwable that caused this exception (optional, defaults to null).
- msg
-
the message describing the cause of the exception.
Attributes
- Supertypes
-
trait Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
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.
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.
Type parameters
- X
-
the underlying row type for which there must be evidence of a CellParser and ClassTag.
Value parameters
- forgiving
-
if true, exceptions when parsing individual rows will be logged then ignored. if false, any exception will terminate the parsing. Defaults to false.
- headerRowsToRead
-
the number of header rows expected in the input file defaults to 1.
- maybeHeader
-
None => requires that the data source has a header row. Some(h) => specifies that the header is to be taken from h. Defaults to None. NOTE: that the simplest is to specify the header directly from the type X.
Attributes
- See also
-
HeadedStringTableParser#create
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass HeadedStringTableParser[X]class Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ProductCellParser.type
The CellParser of a case class T, as derived by CellParser.derived.
The CellParser of a case class T, as derived by CellParser.derived.
Type parameters
- T
-
the type of the result.
Value parameters
- construct
-
a function to construct a T from the values of its fields.
- fieldNames
-
the names of the fields of T, in declaration order.
- fieldParsers
-
the CellParsers of the fields of T, in the same order.
- helper
-
the ColumnHelper[T] which maps field names to column names.
- typeName
-
the name of T (used in error messages).
Attributes
- Companion
- object
- Supertypes
-
trait MultiCellParser[T]trait CellParser[T]trait StringConverter[T]class Objecttrait Matchableclass AnyShow all
Object RawParsers provides utility instances for parsing raw data represented as sequences of strings. Specifically, it provides pre-configured parsers for handling different use cases.
Object RawParsers provides utility instances for parsing raw data represented as sequences of strings. Specifically, it provides pre-configured parsers for handling different use cases.
Example use cases include parsing data with a pre-defined header row.
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
RawParsers.type
Abstract class to define a raw parser, that's to say a Parser of Seq[String]
Abstract class to define a raw parser, that's to say a Parser of Seq[String]
Value parameters
- forgiving
-
true if we want this parser to be forgiving (defaults to false).
- optionalHeader
-
a header if appropriate.
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
object WithHeaderRow
- Self type
Class used to parse files as a Table of Seq[String]. That's to say, no parsing of individual (or groups of) columns.
Class used to parse files as a Table of Seq[String]. That's to say, no parsing of individual (or groups of) columns.
Value parameters
- forgiving
-
forcing (defaults to true). If true then an individual malformed row will not prevent subsequent rows being parsed.
- maybeHeader
-
an optional fixed header. If None, we expect to find the header defined in the first line of the file.
- predicate
-
a predicate which, if true, allows inclusion of the input row.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass StringTableParser[RawTable]class AbstractTableParser[RawTable]trait TableParser[RawTable]trait TableBuilder[RawTable]class Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
RawTableParser.type
Case class to define the configuration for parsing a row (see LineParser).
Case class to define the configuration for parsing a row (see LineParser).
The default reads CSV as defined by RFC 4180 (https://www.rfc-editor.org/rfc/rfc4180): fields are separated by commas, and spaces are part of a field; a field may be quoted (with "), in which case it may contain commas, line breaks and quotes (which are doubled).
The regular expressions which LineParser uses are derived from the characters, so that changing the delimiter (for example) changes everything that depends on it. Use the copy methods (withDelimiter, etc.) to change one property, e.g. given RowConfig = RowConfig.default.withDelimiter('\t') or simply given RowConfig = RowConfig(delimiter = '\t').
Value parameters
- delimiter
-
the character which separates fields. Defaults to ','.
- listEnclosure
-
the (two) characters which enclose a list within a field, or "" if lists are not enclosed. Defaults to "{}".
- listSep
-
the character which separates the elements of a list within a field. Defaults to '|'.
- maybeString
-
an explicit Regex for a field which is not quoted, if the default (any characters other than the delimiter and the quote) is not wanted.
- quote
-
the character which encloses a quoted field. Defaults to '"'.
- trim
-
if true, any spaces next to a delimiter are ignored (so that "a, b" has the fields "a" and "b"), as in 1.x; this is not RFC 4180. Defaults to false.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
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.
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
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait StringParser[Row]class StandardRowParser[Row]trait StringsParser[Row]class StandardStringsParser[Row]
Typeclass trait representing a row processor that defines how rows of input data can be parsed into specific types, typically useful for parsing and processing tabular data with headers. CONSIDER finding a common super-type between this and TableParser.
Typeclass trait representing a row processor that defines how rows of input data can be parsed into specific types, typically useful for parsing and processing tabular data with headers. CONSIDER finding a common super-type between this and TableParser.
Type parameters
- Row
-
the type that each row will be processed into.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class AbstractRowProcessor[Row]class StringRowProcessor[Row]
Attributes
- Supertypes
-
trait Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
A concrete Convertible corresponding to a row.
A concrete Convertible corresponding to a row.
Value parameters
- header
-
the Header.
- row
-
the Row containing several values.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Convertibleclass Objecttrait Matchableclass AnyShow all
Trait SingleCellParser, which extends CellParser[T].
Trait SingleCellParser, which extends CellParser[T].
Type parameters
- T
-
the type of the resulting object.
Attributes
- Supertypes
- Known subtypes
-
object BigDecimalCellParserobject BigIntCellParserobject BooleanCellParserobject ByteCellParserobject CharCellParserobject DoubleCellParserobject FileParserobject FloatCellParserobject IntCellParserobject LocalDateParserobject LongCellParserclass OptionParser[T]object BooleanOptionParserobject DoubleOptionParserobject FileOptionParserobject IntOptionParserobject LocalDateOptionParserobject LongOptionParserobject URLOptionParserobject ShortCellParserobject StringCellParserobject URLParserShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
StandardRowParser.type
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.
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
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait StringParser[Row]class Objecttrait Matchableclass AnyShow all
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.
Type parameters
- Row
-
the (parametric) Row type for which there must be evidence of a CellParser[Row].
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait StringsParser[Row]class Objecttrait Matchableclass AnyShow all
TODO resolve the naming issue here.
Trait to convert a String into a T (see CellParser, which extends it).
Trait to convert a String into a T (see CellParser, which extends it).
NOTE: up to 2.0, the companion object had instances for the basic types, but nothing used them (CellParser's own instances are found instead).
Type parameters
- T
-
the type of the result.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait CellParser[T]trait MultiCellParser[T]class ProductCellParser[T]trait SingleCellParser[T]object BigDecimalCellParserobject BigIntCellParserobject BooleanCellParserobject ByteCellParserobject CharCellParserobject DoubleCellParserobject FileParserobject FloatCellParserobject IntCellParserobject LocalDateParserobject LongCellParserclass OptionParser[T]object BooleanOptionParserobject DoubleOptionParserobject FileOptionParserobject IntOptionParserobject LocalDateOptionParserobject LongOptionParserobject URLOptionParserobject ShortCellParserobject StringCellParserobject URLParserShow all
A RowParser whose input type is String.
A RowParser whose input type is String.
Type parameters
- Row
-
the (parametric) Row type for which there must be evidence of a RowParser[Row, Input].
Attributes
- Supertypes
- Known subtypes
-
class StandardRowParser[Row]
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.
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.
Type parameters
- Row
-
the row type.
Attributes
- Supertypes
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.
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.
Type parameters
- Table
-
the table type.
Attributes
- Supertypes
-
class AbstractTableParser[Table]trait TableParser[Table]trait TableBuilder[Table]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class HeadedCSVTableParser[T]class HeadedStringTableParser[X]class PlainTextHeadedStringTableParser[X]class RawTableParserShow all
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.
Type parameters
- Row
-
the (parametric) Row type for which there must be evidence of a CellParser[Row].
Attributes
- Supertypes
- Known subtypes
-
class StandardStringsParser[Row]
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.
Type parameters
- Table
-
the table type.
Attributes
- Supertypes
-
class AbstractTableParser[Table]trait TableParser[Table]trait TableBuilder[Table]class Objecttrait Matchableclass AnyShow all
Minimal trait expressing the table-building contract, independent of how the input source is read.
Minimal trait expressing the table-building contract, independent of how the input source is read.
TableParser extends this for string-based sources. ParquetTableParser extends this directly for Parquet sources. Future source types (JDBC ResultSet, JSON, etc.) can do the same.
Type parameters
- Table
-
the table type to be built.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait TableParser[Table]class AbstractTableParser[Table]class StringTableParser[Table]class HeadedCSVTableParser[T]class HeadedStringTableParser[X]class PlainTextHeadedStringTableParser[X]class RawTableParserclass StringsTableParser[Table]class ParquetTableParser[R]Show all
The TableParser object provides functionality for parsing tabular data from various sources using a StringTableParser. It includes utilities for character-by-character parsing of sources, working with sampled data, and handling parsing results effectively. The object also provides implicit and utility functions to enhance parsing workflows.
The TableParser object provides functionality for parsing tabular data from various sources using a StringTableParser. It includes utilities for character-by-character parsing of sources, working with sampled data, and handling parsing results effectively. The object also provides implicit and utility functions to enhance parsing workflows.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TableParser.type
Type class to parse a set of rows as a Table.
Type class to parse a set of rows as a Table.
Type parameters
- Table
-
the Table type.
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
class AbstractTableParser[Table]class StringTableParser[Table]class HeadedCSVTableParser[T]class HeadedStringTableParser[X]class PlainTextHeadedStringTableParser[X]class RawTableParserclass StringsTableParser[Table]Show all
Attributes
- Supertypes
-
trait Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
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]
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.
Type parameters
- X
-
the type for which we require a TableParser[X].
Value parameters
- forgiving
-
true if individual rows of the source which do not parse successfully, are logged but otherwise do not affect the success of the overall parsing.
- sourceHasHeaderRow
-
true (default) if the data to be read has an explicit header row with column names that match the parameters of type X; false if there is no header row in the data AND if the data has (unnamed) columns of the same number and in the same order as defined by type X.
Attributes
- Supertypes
Types
type alias for the results of parsing repetitions of String.
type alias for the results of parsing repetitions of String.
Attributes
type alias for parsing rows which are composed of a sequence of String.
type alias for parsing rows which are composed of a sequence of String.