EncryptedHeadedStringTableParser
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
- A
-
the cipher algorithm (for which there must be evidence of HexEncryption[A]).
- X
-
the underlying row type for which there must be evidence of a CellParser.
Value parameters
- encryptedRowPredicate
-
a function which takes a String and returns a Boolean.
- 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.
- keyFunction
-
a function which takes a String and returns a String (input might be ignored).
- 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
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass HeadedStringTableParser[X]class Objecttrait Matchableclass AnyShow all
Members list
Type members
Inherited types
The input type, typically String or Strings.
The row type.
Value members
Concrete methods
Method to parse an encrypted table, as Table.parse (and parseFile, parseResource, etc.) do. This is parseIO, run synchronously (decryption is done in IO). Up to 2.0.1, this was the parse method of HeadedStringTableParser, which doesn't decrypt.
Method to parse an encrypted table, as Table.parse (and parseFile, parseResource, etc.) do. This is parseIO, run synchronously (decryption is done in IO). Up to 2.0.1, this was the parse method of HeadedStringTableParser, which doesn't decrypt.
Value parameters
- n
-
the number of lines which make up the header.
- xs
-
the lines of the input.
Attributes
- Returns
-
a Try[Table].
- Definition Classes
Method to parse an encrypted table. The first n lines are the (plaintext) header. Each of the other lines is a key and the encrypted row, separated by "|" (see CsvTableEncryptedFileRenderer). Only the rows whose key satisfies encryptedRowPredicate are decrypted (with the key given by keyFunction), and they are then parsed as plaintext rows, with the header.
Method to parse an encrypted table. The first n lines are the (plaintext) header. Each of the other lines is a key and the encrypted row, separated by "|" (see CsvTableEncryptedFileRenderer). Only the rows whose key satisfies encryptedRowPredicate are decrypted (with the key given by keyFunction), and they are then parsed as plaintext rows, with the header.
Value parameters
- n
-
the number of lines which make up the header.
- xr
-
the lines of the input.
Attributes
- Returns
-
an IO[Table].
Set the value of forgiving for the plaintext TableParser.
Set the value of forgiving for the plaintext TableParser.
Value parameters
- b
-
true or false. See TableParser.
Attributes
- Returns
-
a TableParser of Table[X]
Set the Header for the plaintext TableParser.
Set the Header for the plaintext TableParser.
CONSIDER does this make sense to allow?
Value parameters
- header
-
the required Header.
Attributes
- Returns
-
a TableParser of Table[X]
Set the value of multiline for the plaintext TableParser.
Set the value of multiline for the plaintext TableParser.
Value parameters
- b
-
value of multiline for the plaintext TableParser. See TableParser.
Attributes
- Returns
-
a TableParser of Table[X]
Set the value of predicate for the plaintext TableParser.
Set the value of predicate for the plaintext TableParser.
Value parameters
- p
-
predicate for the plaintext TableParser.
Attributes
- Returns
-
a TableParser of Table[X]
Set the predicate for the plaintext TableParser.
Set the predicate for the plaintext TableParser.
Value parameters
- predicate
-
a predicate which will be applied to each X (i.e. AFTER decryption).
Attributes
- Returns
-
a TableParser of Table[X]
Set the value of the row parser for the plaintext TableParser.
Set the value of the row parser for the plaintext TableParser.
Value parameters
- rp
-
the row parser for the plaintext TableParser.
Attributes
- Returns
-
a TableParser of Table[X]
Inherited methods
Parses rows of input data into a table representation.
Parses rows of input data into a table representation.
This method utilizes an IndexedInputToRowsAggregator to transform an iterator of inputs into rows using the provided header and transformation function. It processes the input, materializes the resulting rows into a list, and constructs a table representation from the processed rows and header.
Value parameters
- ev
-
an implicit evidence parameter ensuring the input type adheres to the
Joinabletype class, which defines how input elements can be combined or validated during processing. - f
-
a transformation function that maps the
Headerto a function capable of transforming a tuple of input and its index into aTry[Row]. This function encapsulates row processing logic and error handling for each input element. - header
-
the
Headercontaining column metadata to guide the transformation process. - ts
-
an iterator of inputs to be parsed into rows.
Attributes
- Returns
-
a
Trycontaining aTableif the parsing is successful, or an error in case of failure. - Inherited from:
- AbstractTableParser
Parses rows from an iterator of input strings (ws) using the provided header and row parsing logic.
Parses rows from an iterator of input strings (ws) using the provided header and row parsing logic.
This method utilizes the doParseRows function to process each row in the input iterator, applying the provided rowParser.parse function to convert input strings into logical rows, while using the header to guide parsing and interpretation of the input.
Value parameters
- header
-
the
Headerobject that describes the expected structure of the table (e.g., column names). - ws
-
an iterator over the input strings, where each string represents a row in the table.
Attributes
- Returns
-
a
Tryof the parsedTableobject. On success, it contains the resulting table; on failure, it contains the parsing error. - Inherited from:
- StringTableParser
Method to parse the input into a Table of the selected rows (see rows). As in parse, if this parser isn't forgiving, a row which can't be parsed makes the result a Failure.
Method to parse the input into a Table of the selected rows (see rows). As in parse, if this parser isn't forgiving, a row which can't be parsed makes the result a Failure.
Value parameters
- n
-
the number of header lines (defaults to headerRowsToRead).
- selection
-
the rows to select (RFC 7111: see CsvFragment).
- xs
-
the lines of the input.
Attributes
- Returns
-
a Try[Table].
- Inherited from:
- StringTableParser
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
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
Method to parse the input lazily, as a stream of rows rather than a Table (see, e.g., IOTable.stream). The header is read now (from the first n lines, unless this parser has a fixed header); each row is parsed only when it is pulled from the iterator. As in parse, the predicate selects the rows; and, if this parser is forgiving, a row which can't be parsed is logged and left out. Otherwise, it is a Failure in the iterator.
Method to parse the input lazily, as a stream of rows rather than a Table (see, e.g., IOTable.stream). The header is read now (from the first n lines, unless this parser has a fixed header); each row is parsed only when it is pulled from the iterator. As in parse, the predicate selects the rows; and, if this parser is forgiving, a row which can't be parsed is logged and left out. Otherwise, it is a Failure in the iterator.
The selection (of RFC 7111 rows: see CsvFragment) applies before the predicate, since its row numbers are those of the input.
Value parameters
- n
-
the number of header lines (defaults to headerRowsToRead).
- selection
-
the rows to select (by default, all of them).
- xs
-
the lines of the input.
Attributes
- Returns
-
a Try of the header and an Iterator of the rows (each a Try).
- Inherited from:
- StringTableParser
Inherited fields
Predicate to filter rows. Defaults to including all rows.
Method to define a row parser.
Method to define a row parser.
Attributes
- Returns
-
a RowParser[Row, Input].
- Inherited from:
- HeadedStringTableParser