case class EncryptedHeadedStringTableParser[X, A](encryptedRowPredicate: (String) => Boolean, keyFunction: (String) => String, maybeHeader: Option[Header] = None, forgiving: Boolean = false, headerRowsToRead: Int = 1)(implicit evidence$1: CellParser[X], evidence$2: ClassTag[X], evidence$3: HexEncryption[A]) extends HeadedStringTableParser[X] with Product with Serializable
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 for which there must be evidence of a CellParser and ClassTag.
- A
the cipher algorithm (for which there must be evidence of HexEncryption[A]).
- encryptedRowPredicate
a function which takes a String and returns a Boolean.
- 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.
- 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.
- Alphabetic
- By Inheritance
- EncryptedHeadedStringTableParser
- Serializable
- Product
- Equals
- HeadedStringTableParser
- CopyableTableParser
- StringTableParser
- AbstractTableParser
- TableParser
- TableBuilder
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new EncryptedHeadedStringTableParser(encryptedRowPredicate: (String) => Boolean, keyFunction: (String) => String, maybeHeader: Option[Header] = None, forgiving: Boolean = false, headerRowsToRead: Int = 1)(implicit arg0: CellParser[X], arg1: ClassTag[X], arg2: HexEncryption[A])
- encryptedRowPredicate
a function which takes a String and returns a Boolean.
- 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.
- 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.
Type Members
- type Input = String
The input type, typically
StringorStrings.The input type, typically
StringorStrings.- Definition Classes
- StringTableParser → TableParser
- type Row = X
The row type.
The row type.
- Definition Classes
- HeadedStringTableParser → TableBuilder
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def builder(rows: Iterator[X], header: Header): Table[Row]
Method to construct a Table based on the given iterator of rows and the given header.
Method to construct a Table based on the given iterator of rows and the given header.
- rows
an iterator of Row objects representing the data rows.
- header
a Header object representing the table's column headers.
- returns
the constructed Table based on the input rows and header.
- Attributes
- protected
- Definition Classes
- HeadedStringTableParser → TableBuilder
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def doParseRows(ts: Iterator[Input], header: Header, f: ((Input, Int)) => Try[Row])(implicit ev: Joinable[Input]): Try[Table[X]]
Parses rows of input data into a table representation.
Parses rows of input data into a table representation.
This method utilizes an
IndexedInputToRowsAggregatorto 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.- ts
an iterator of inputs to be parsed into rows.
- header
the
Headercontaining column metadata to guide the transformation process.- 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.- 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.- returns
a
Trycontaining aTableif the parsing is successful, or an error in case of failure.
- Definition Classes
- AbstractTableParser
- val encryptedRowPredicate: (String) => Boolean
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val forgiving: Boolean
If true, individual row failures are logged but do not cause the overall parse to fail.
If true, individual row failures are logged but do not cause the overall parse to fail.
- Definition Classes
- EncryptedHeadedStringTableParser → HeadedStringTableParser → TableBuilder
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val headerRowsToRead: Int
This indicates the number of header rows which must be read from the input.
This indicates the number of header rows which must be read from the input. The value is usually 1 but some types of CSV file have more than one header line. If maybeHeader exists, then this number is ignored.
CONSIDER if this is really ignored when maybeHeader is defined, then we should eliminate such places where this value has an override of 0.
- Definition Classes
- EncryptedHeadedStringTableParser → HeadedStringTableParser → TableParser
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val keyFunction: (String) => String
- val maybeHeader: Option[Header]
This variable determines if there is a programmed, i.e., fixed, header for the parser.
This variable determines if there is a programmed, i.e., fixed, header for the parser. If its value is None, it signifies that we must look to the first line(s) of data for an appropriate header.
- Definition Classes
- EncryptedHeadedStringTableParser → TableParser
- val multiline: Boolean
Value to determine whether it is acceptable to have a quoted string span more than one line.
Value to determine whether it is acceptable to have a quoted string span more than one line.
- returns
true if quoted strings may span more than one line.
- Attributes
- protected
- Definition Classes
- TableParser
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def parse(xs: Iterator[String], n: Int = headerRowsToRead): Try[Table[X]]
Method to parse a table based on a sequence of Inputs.
Method to parse a table based on a sequence of Inputs. NOTE: this is required so that we can invoke this method with an Iterator[String].
- xs
the sequence of Inputs, one for each row
- n
the number of rows to drop (length of the header)--defaults to 1.
- returns
a Try[Table].
- Definition Classes
- StringTableParser → AbstractTableParser → TableParser
- def parseIO(xr: Iterator[String], n: Int): IO[Table[X]]
TESTME
TESTME
- xr
the sequence of Inputs, one for each row
- n
the number of lines that should be used as a Header. If n == 0 == maybeHeader.empty then there is a logic error.
- returns
an IO[Table]
- def parseRows(ws: Iterator[String], header: Header): Try[Table[X]]
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
doParseRowsfunction to process each row in the input iterator, applying the providedrowParser.parsefunction to convert input strings into logical rows, while using the header to guide parsing and interpretation of the input.- ws
an iterator over the input strings, where each string represents a row in the table.
- header
the
Headerobject that describes the expected structure of the table (e.g., column names).- returns
a
Tryof the parsedTableobject. On success, it contains the resulting table; on failure, it contains the parsing error.
- Definition Classes
- StringTableParser → AbstractTableParser
- val predicate: (Try[Row]) => Boolean
Predicate to filter rows.
Predicate to filter rows. Defaults to including all rows.
- Attributes
- protected
- Definition Classes
- TableBuilder
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val rowParser: RowParser[X, String]
Method to define a row parser.
Method to define a row parser.
- returns
a RowParser[Row, Input].
- Definition Classes
- HeadedStringTableParser → TableParser
- def setForgiving(b: Boolean): TableParser[Table[X]]
Set the value of forgiving for the plaintext TableParser.
Set the value of forgiving for the plaintext TableParser.
- b
true or false. See TableParser.
- returns
a TableParser of Table[X]
- Definition Classes
- EncryptedHeadedStringTableParser → CopyableTableParser
- def setHeader(header: Header): TableParser[Table[X]]
Set the Header for the plaintext TableParser.
Set the Header for the plaintext TableParser.
CONSIDER does this make sense to allow?
- header
the required Header.
- returns
a TableParser of Table[X]
- Definition Classes
- EncryptedHeadedStringTableParser → CopyableTableParser
- def setMultiline(b: Boolean): TableParser[Table[X]]
Set the value of multiline for the plaintext TableParser.
Set the value of multiline for the plaintext TableParser.
- b
value of multiline for the plaintext TableParser. See TableParser.
- returns
a TableParser of Table[X]
- Definition Classes
- EncryptedHeadedStringTableParser → CopyableTableParser
- def setPlaintextPredicate(p: (Try[X]) => Boolean): TableParser[Table[X]]
Set the value of predicate for the plaintext TableParser.
Set the value of predicate for the plaintext TableParser.
- p
predicate for the plaintext TableParser.
- returns
a TableParser of Table[X]
- def setPredicate(predicate: (Try[X]) => Boolean): TableParser[Table[X]]
Set the predicate for the plaintext TableParser.
Set the predicate for the plaintext TableParser.
- predicate
a predicate which will be applied to each X (i.e. AFTER decryption).
- returns
a TableParser of Table[X]
- Definition Classes
- EncryptedHeadedStringTableParser → CopyableTableParser
- def setRowParser(rp: RowParser[X, Input]): TableParser[Table[X]]
Set the value of the row parser for the plaintext TableParser.
Set the value of the row parser for the plaintext TableParser.
- rp
the row parser for the plaintext TableParser.
- returns
a TableParser of Table[X]
- Definition Classes
- EncryptedHeadedStringTableParser → CopyableTableParser
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)