trait CellParsers extends AnyRef
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.
- Alphabetic
- By Inheritance
- CellParsers
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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 cellParser[P, T](construct: (P) => T)(implicit arg0: CellParser[P], arg1: ClassTag[T]): CellParser[T]
Method to return a CellParser[T] based on a function to convert a P into a T
Method to return a CellParser[T] based on a function to convert a P into a T
- P
the type of the intermediate type.
- T
the underlying type of the result.
- construct
a function P => T.
- returns
a SingleCellParser which converts a String into the intermediate type P and thence into a T
- def cellParser1[P1, T <: Product](construct: (P1) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: ClassTag[T], arg2: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 1-ary Product and which is based on a function to convert a P into a T.
Method to return a CellParser[T] where T is a 1-ary Product and which is based on a function to convert a P into a T.
NOTE: be careful using this method it only applies where T is a 1-tuple (e.g. a case class with one field). It probably shouldn't ever be used in practice. It can cause strange initialization errors! This note may be irrelevant now that we have overridden convertString to fix issue #1.
- P1
the type of the (single) field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function P => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts a String from a Row into the field type P and thence into a T
- def cellParser10[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, T <: Product](construct: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: CellParser[P2], arg2: CellParser[P3], arg3: CellParser[P4], arg4: CellParser[P5], arg5: CellParser[P6], arg6: CellParser[P7], arg7: CellParser[P8], arg8: CellParser[P9], arg9: CellParser[P10], arg10: ClassTag[T], arg11: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 10-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7,P8,P9,P10) into a T.
Method to return a CellParser[T] where T is a 10-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7,P8,P9,P10) into a T.
- P1
the type of the first field of the Product type T.
- P2
the type of the second field of the Product type T.
- P3
the type of the second field of the Product type T.
- P4
the type of the fourth field of the Product type T.
- P5
the type of the fifth field of the Product type T.
- P6
the type of the sixth field of the Product type T.
- P7
the type of the seventh field of the Product type T.
- P8
the type of the eighth field of the Product type T.
- P9
the type of the ninth field of the Product type T.
- P10
the type of the tenth field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (P1,P2,P3,P4,P5,P6,P7,P8,P9,P10) => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts Strings from a Row into the field types P1, P2, P3, P4, P5, P6, P7, P8, P9 and P10 and thence into a T
- def cellParser11[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, T <: Product](construct: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: CellParser[P2], arg2: CellParser[P3], arg3: CellParser[P4], arg4: CellParser[P5], arg5: CellParser[P6], arg6: CellParser[P7], arg7: CellParser[P8], arg8: CellParser[P9], arg9: CellParser[P10], arg10: CellParser[P11], arg11: ClassTag[T], arg12: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 11-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11) into a T.
Method to return a CellParser[T] where T is a 11-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11) into a T.
- P1
the type of the first field of the Product type T.
- P2
the type of the second field of the Product type T.
- P3
the type of the second field of the Product type T.
- P4
the type of the fourth field of the Product type T.
- P5
the type of the fifth field of the Product type T.
- P6
the type of the sixth field of the Product type T.
- P7
the type of the seventh field of the Product type T.
- P8
the type of the eighth field of the Product type T.
- P9
the type of the ninth field of the Product type T.
- P10
the type of the tenth field of the Product type T.
- P11
the type of the eleventh field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11) => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts Strings from a Row into the field types P1, P2, P3, P4, P5, P6, P7, P8, P9, P10 and P11 and thence into a T
- def cellParser12[P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, T <: Product](construct: (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: CellParser[P2], arg2: CellParser[P3], arg3: CellParser[P4], arg4: CellParser[P5], arg5: CellParser[P6], arg6: CellParser[P7], arg7: CellParser[P8], arg8: CellParser[P9], arg9: CellParser[P10], arg10: CellParser[P11], arg11: CellParser[P12], arg12: ClassTag[T], arg13: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 12-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12) into a T.
Method to return a CellParser[T] where T is a 12-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12) into a T.
- P1
the type of the first field of the Product type T.
- P2
the type of the second field of the Product type T.
- P3
the type of the second field of the Product type T.
- P4
the type of the fourth field of the Product type T.
- P5
the type of the fifth field of the Product type T.
- P6
the type of the sixth field of the Product type T.
- P7
the type of the seventh field of the Product type T.
- P8
the type of the eighth field of the Product type T.
- P9
the type of the ninth field of the Product type T.
- P10
the type of the tenth field of the Product type T.
- P11
the type of the eleventh field of the Product type T.
- P12
the type of the twelfth field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12) => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts Strings from a Row into the field types P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11 and P12 and thence into a T
- def cellParser2[P1, P2, T <: Product](construct: (P1, P2) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: CellParser[P2], arg2: ClassTag[T], arg3: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 2-ary Product and which is based on a function to convert a (P1,P2) into a T.
Method to return a CellParser[T] where T is a 2-ary Product and which is based on a function to convert a (P1,P2) into a T.
- P1
the type of the first field of the Product type T.
- P2
the type of the second field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (P1,P2) => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts Strings from a Row into the field types P1 and P2 and thence into a T
- def cellParser2Conditional[K, P, T <: Product](construct: (K, P) => T, parsers: Map[K, CellParser[P]], fields: Seq[String] = Nil)(implicit arg0: CellParser[K], arg1: ClassTag[T], arg2: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 2-ary Product and which is based on a function to convert a (K,P) into a T.
Method to return a CellParser[T] where T is a 2-ary Product and which is based on a function to convert a (K,P) into a T. This method differs from cellParser2 in that the parser of P (a CellParser[P]) is not found implicitly, but rather is looked up dynamically depending on the value of the first parameter (of type K).
- K
the type of the conditional lookup key, which is also the type of the first field of T. Typically, this will be a String, but it could also be an Int or something more exotic.
- P
the type of the second field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (K,P) => T, usually the apply method of a case class.
- parsers
a Map[K, CellParser[P] ] which determines which particular parser of P will be used. The key value looked up is the value of the first (K) field.
- returns
a MultiCellParser which converts Strings from a Row into the field types K and P and thence into a T.
- Exceptions thrown
NoSuchElementException
if the key (from the first K-type parameter) is not present in the map given by parsers.
- def cellParser3[P1, P2, P3, T <: Product](construct: (P1, P2, P3) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: CellParser[P2], arg2: CellParser[P3], arg3: ClassTag[T], arg4: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 3-ary Product and which is based on a function to convert a (P1,P2,P3) into a T.
Method to return a CellParser[T] where T is a 3-ary Product and which is based on a function to convert a (P1,P2,P3) into a T.
- P1
the type of the first field of the Product type T.
- P2
the type of the second field of the Product type T.
- P3
the type of the third field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (P1,P2,P3) => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts Strings from a Row into the field types P1, P2 and P3 and thence into a T
- def cellParser4[P1, P2, P3, P4, T <: Product](construct: (P1, P2, P3, P4) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: CellParser[P2], arg2: CellParser[P3], arg3: CellParser[P4], arg4: ClassTag[T], arg5: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 4-ary Product and which is based on a function to convert a (P1,P2,P3,P4) into a T.
Method to return a CellParser[T] where T is a 4-ary Product and which is based on a function to convert a (P1,P2,P3,P4) into a T.
- P1
the type of the first field of the Product type T.
- P2
the type of the second field of the Product type T.
- P3
the type of the second field of the Product type T.
- P4
the type of the fourth field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (P1,P2,P3,P4) => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts Strings from a Row into the field types P1, P2, P3 and P4 and thence into a T
- def cellParser5[P1, P2, P3, P4, P5, T <: Product](construct: (P1, P2, P3, P4, P5) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: CellParser[P2], arg2: CellParser[P3], arg3: CellParser[P4], arg4: CellParser[P5], arg5: ClassTag[T], arg6: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 5-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5) into a T.
Method to return a CellParser[T] where T is a 5-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5) into a T.
- P1
the type of the first field of the Product type T.
- P2
the type of the second field of the Product type T.
- P3
the type of the second field of the Product type T.
- P4
the type of the fourth field of the Product type T.
- P5
the type of the fifth field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (P1,P2,P3,P4,P5) => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts Strings from a Row into the field types P1, P2, P3, P4 and P5 and thence into a T
- def cellParser6[P1, P2, P3, P4, P5, P6, T <: Product](construct: (P1, P2, P3, P4, P5, P6) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: CellParser[P2], arg2: CellParser[P3], arg3: CellParser[P4], arg4: CellParser[P5], arg5: CellParser[P6], arg6: ClassTag[T], arg7: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 6-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6) into a T.
Method to return a CellParser[T] where T is a 6-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6) into a T.
- P1
the type of the first field of the Product type T.
- P2
the type of the second field of the Product type T.
- P3
the type of the second field of the Product type T.
- P4
the type of the fourth field of the Product type T.
- P5
the type of the fifth field of the Product type T.
- P6
the type of the sixth field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (P1,P2,P3,P4,P5,P6) => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts Strings from a Row into the field types P1, P2, P3, P4, P5 and P6 and thence into a T
- def cellParser7[P1, P2, P3, P4, P5, P6, P7, T <: Product](construct: (P1, P2, P3, P4, P5, P6, P7) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: CellParser[P2], arg2: CellParser[P3], arg3: CellParser[P4], arg4: CellParser[P5], arg5: CellParser[P6], arg6: CellParser[P7], arg7: ClassTag[T], arg8: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 7-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7) into a T.
Method to return a CellParser[T] where T is a 7-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7) into a T.
- P1
the type of the first field of the Product type T.
- P2
the type of the second field of the Product type T.
- P3
the type of the second field of the Product type T.
- P4
the type of the fourth field of the Product type T.
- P5
the type of the fifth field of the Product type T.
- P6
the type of the sixth field of the Product type T.
- P7
the type of the seventh field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (P1,P2,P3,P4,P5,P6,P7) => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts Strings from a Row into the field types P1, P2, P3, P4, P5, P6 and P7 and thence into a T
- def cellParser8[P1, P2, P3, P4, P5, P6, P7, P8, T <: Product](construct: (P1, P2, P3, P4, P5, P6, P7, P8) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: CellParser[P2], arg2: CellParser[P3], arg3: CellParser[P4], arg4: CellParser[P5], arg5: CellParser[P6], arg6: CellParser[P7], arg7: CellParser[P8], arg8: ClassTag[T], arg9: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 8-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7,P8) into a T.
Method to return a CellParser[T] where T is a 8-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7,P8) into a T.
- P1
the type of the first field of the Product type T.
- P2
the type of the second field of the Product type T.
- P3
the type of the second field of the Product type T.
- P4
the type of the fourth field of the Product type T.
- P5
the type of the fifth field of the Product type T.
- P6
the type of the sixth field of the Product type T.
- P7
the type of the seventh field of the Product type T.
- P8
the type of the eighth field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (P1,P2,P3,P4,P5,P6,P7,P8) => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts Strings from a Row into the field types P1, P2, P3, P4, P5, P6, P7 and P8 and thence into a T
- def cellParser9[P1, P2, P3, P4, P5, P6, P7, P8, P9, T <: Product](construct: (P1, P2, P3, P4, P5, P6, P7, P8, P9) => T, fields: Seq[String] = Nil)(implicit arg0: CellParser[P1], arg1: CellParser[P2], arg2: CellParser[P3], arg3: CellParser[P4], arg4: CellParser[P5], arg5: CellParser[P6], arg6: CellParser[P7], arg7: CellParser[P8], arg8: CellParser[P9], arg9: ClassTag[T], arg10: ColumnHelper[T]): CellParser[T]
Method to return a CellParser[T] where T is a 9-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7,P8,P9) into a T.
Method to return a CellParser[T] where T is a 9-ary Product and which is based on a function to convert a (P1,P2,P3,P4,P5,P6,P7,P8,P9) into a T.
- P1
the type of the first field of the Product type T.
- P2
the type of the second field of the Product type T.
- P3
the type of the second field of the Product type T.
- P4
the type of the fourth field of the Product type T.
- P5
the type of the fifth field of the Product type T.
- P6
the type of the sixth field of the Product type T.
- P7
the type of the seventh field of the Product type T.
- P8
the type of the eighth field of the Product type T.
- P9
the type of the ninth field of the Product type T.
- T
the underlying type of the result, a Product.
- construct
a function (P1,P2,P3,P4,P5,P6,P7,P8,P9) => T, usually the apply method of a case class.
- returns
a MultiCellParser which converts Strings from a Row into the field types P1, P2, P3, P4, P5, P6, P7, P8 and P9 and thence into a T
- def cellParserOption[P](implicit arg0: CellParser[P]): CellParser[Option[P]]
Method to return a CellParser[Option[P].
Method to return a CellParser[Option[P].
This class is used for optional types which are non-scalar, i.e. there are no implicitly-defined parsers for the Option[P].
- P
the underlying type of the result
- returns
a SingleCellParser[Option[P]
- lazy val cellParserOptionNonEmptyString: CellParser[Option[String]]
Method to return a CellParser[Option[String].
Method to return a CellParser[Option[String].
TODO: why do we need this in addition to cellParserOption?
CONSIDER: using BlankException as above...
- returns
a SingleCellParser[Option[String]
- def cellParserRepetition[P](start: Int = 1)(implicit arg0: CellParser[P], arg1: ColumnHelper[P]): CellParser[Seq[P]]
Method to return a CellParser[Seq[P] from a potentially unlimited set of P objects.
Method to return a CellParser[Seq[P] from a potentially unlimited set of P objects. The counting of the elements starts at start (defaults to 1).
- P
the underlying type of the result
- returns
a MultiCellParser[Seq[P]
- def cellParserSeq[P](implicit arg0: CellParser[P]): CellParser[Seq[P]]
Method to return a CellParser[Seq[P].
Method to return a CellParser[Seq[P]. This is used only by unit tests. CONSIDER eliminating this; only used in unit tests
- P
the underlying type of the result
- returns
a MultiCellParser[Seq[P]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def columnHelper[T](aliases: (String, String)*): ColumnHelper[T]
Method to yield a ColumnHelper[T] based on some number of explicit aliases,
Method to yield a ColumnHelper[T] based on some number of explicit aliases,
- T
the underlying type of the resulting ColumnHelper
- aliases
a variable number of explicit aliases to translate specific case class parameter names into their column name equivalents.
- returns
a new instance of ColumnHelper[T]
- def columnHelper[T](columnNameMapper: (String) => String, maybePrefix: Option[String], aliases: (String, String)*): ColumnHelper[T]
Method to yield a ColumnHelper[T] based on a column name mapper, an optional prefix, and some number of explicit aliases,
Method to yield a ColumnHelper[T] based on a column name mapper, an optional prefix, and some number of explicit aliases,
- T
the underlying type of the resulting ColumnHelper
- columnNameMapper
a mapper of String=>String which will translate case class parameter names into column names.
- maybePrefix
an optional prefix for the column name.
- aliases
a variable number of explicit aliases to translate specific case class parameter names into their column name equivalents.
- returns
a new instance of ColumnHelper[T]
- def columnHelper[T](columnNameMapper: (String) => String, aliases: (String, String)*): ColumnHelper[T]
Method to yield a ColumnHelper[T] based on a column name mapper, and some number of explicit aliases,
Method to yield a ColumnHelper[T] based on a column name mapper, and some number of explicit aliases,
- T
the underlying type of the resulting ColumnHelper
- columnNameMapper
a mapper of String=>String which will translate case class parameter names into column names.
- aliases
a variable number of explicit aliases to translate specific case class parameter names into their column name equivalents.
- returns
a new instance of ColumnHelper[T]
- def columnHelper[T](maybePrefix: Option[String], aliases: (String, String)*): ColumnHelper[T]
Method to yield a ColumnHelper[T] based on an optional prefix, and some number of explicit aliases,
Method to yield a ColumnHelper[T] based on an optional prefix, and some number of explicit aliases,
- T
the underlying type of the resulting ColumnHelper
- maybePrefix
an optional prefix for the column name.
- aliases
a variable number of explicit aliases to translate specific case class parameter names into their column name equivalents.
- returns
a new instance of ColumnHelper[T]
- implicit def defaultColumnHelper[T]: ColumnHelper[T]
A default column mapper which will work for any underlying type T and which provides no column name mapping at all.
A default column mapper which will work for any underlying type T and which provides no column name mapping at all. This is suitable for the usual case where the names of the, e.g., CSV columns are the same as the names of the case class parameters.
- T
the underlying type of the resulting ColumnHelper
- returns
a new instance of ColumnHelper[T]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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()