The CsvRenderers object provides a collection of implicit StandardCsvRenderer implementations for common data types. These renderers are used to convert data of specific types into CSV (Comma-Separated Values) format according to the defined rendering logic.
Attributes
- Companion
- trait
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CsvRenderers.type
Members list
Type members
Classlikes
An implicit object for rendering Boolean values into CSV (Comma-Separated Values) format.
An implicit object for rendering Boolean values into CSV (Comma-Separated Values) format.
CsvRendererBoolean extends the StandardCsvRenderer abstraction, which provides a base implementation for converting objects into their CSV string representation.
This implicit object handles the rendering of Boolean values by converting them to their string representation, typically as "true" or "false".
Usage: The CsvRendererBoolean can be implicitly used wherever a StandardCsvRenderer[Boolean] is required, enabling seamless conversion of Boolean values to CSV-compatible strings.
Example:
// Assuming an implicit `CsvAttributes` in scope
val renderer = summon[StandardCsvRenderer[Boolean]]
val csvValue = renderer.render(true, Map.empty)
println(csvValue) // Output: "true"
Attributes
- Supertypes
-
class StandardCsvRenderer[Boolean]trait CsvRenderer[Boolean]class Objecttrait Matchableclass AnyShow all
- Self type
-
CsvRendererBoolean.type
An implicit implementation of the StandardCsvRenderer for the Byte type.
An implicit implementation of the StandardCsvRenderer for the Byte type.
The CsvRendererByte object provides functionality to render Byte values into CSV format by extending the StandardCsvRenderer abstract class. This implementation defines the specific rendering behavior for converting Byte type data into its CSV-compatible string representation.
Attributes
- Supertypes
-
class StandardCsvRenderer[Byte]trait CsvRenderer[Byte]class Objecttrait Matchableclass AnyShow all
- Self type
-
CsvRendererByte.type
CsvRendererDouble is an implicit object that provides a mechanism to render instances of type Double into a CSV (Comma-Separated Values) format. It extends the StandardCsvRenderer abstract class, inheriting its generic rendering capabilities, and specializes the functionality for Double values.
CsvRendererDouble is an implicit object that provides a mechanism to render instances of type Double into a CSV (Comma-Separated Values) format. It extends the StandardCsvRenderer abstract class, inheriting its generic rendering capabilities, and specializes the functionality for Double values.
This implicit object allows seamless and type-safe rendering of Doubles into strings formatted for CSV output by leveraging Scala's implicit resolution mechanism.
Example usage:
import CsvRenderers._
val value: Double = 123.456
val renderedValue: String = CsvRendererDouble.render(value)
println(renderedValue) // Output: "123.456"
The CsvRendererDouble relies on the default implementation of render in the StandardCsvRenderer class, where the Double is converted to its string representation. Custom attributes influencing the rendering may be passed via a map, though they are unused in the default implementation.
Attributes
- See also
-
com.phasmidsoftware.tableparser.core.render.StandardCsvRenderer
- Supertypes
-
class StandardCsvRenderer[Double]trait CsvRenderer[Double]class Objecttrait Matchableclass AnyShow all
- Self type
-
CsvRendererDouble.type
Implicit object that provides a CSV renderer for Float values by extending the StandardCsvRenderer abstract class with type parameter Float.
Implicit object that provides a CSV renderer for Float values by extending the StandardCsvRenderer abstract class with type parameter Float.
This renderer converts Float values into their CSV string representation, utilizing the default behavior from the StandardCsvRenderer class unless overridden. The implicit nature of this object allows it to be automatically used wherever a StandardCsvRenderer for Float is required.
This renderer adheres to the base CsvRenderer trait interface, enabling consistent rendering of Float values in CSV-related operations.
Attributes
- Supertypes
-
class StandardCsvRenderer[Float]trait CsvRenderer[Float]class Objecttrait Matchableclass AnyShow all
- Self type
-
CsvRendererFloat.type
Attributes
- Supertypes
- Self type
-
CsvRendererInstant.type
Implicit object CsvRendererInt provides a concrete implementation of the StandardCsvRenderer class for rendering Int values into CSV (Comma-Separated Values) format.
Implicit object CsvRendererInt provides a concrete implementation of the StandardCsvRenderer class for rendering Int values into CSV (Comma-Separated Values) format.
This object allows the rendering of integer values into their string representation for use in CSV output while adhering to the conventions defined in the StandardCsvRenderer abstraction.
Being defined as implicit, it can be automatically utilized in any context where a StandardCsvRenderer[Int] is required, enabling seamless integration into systems that rely on type class-based serialization for CSV export.
Attributes
- Supertypes
-
class StandardCsvRenderer[Int]trait CsvRenderer[Int]class Objecttrait Matchableclass AnyShow all
- Self type
-
CsvRendererInt.type
Implicit object CsvRendererLong provides a StandardCsvRenderer implementation specifically for the Long type.
Implicit object CsvRendererLong provides a StandardCsvRenderer implementation specifically for the Long type.
This renderer is used to convert Long values into their CSV (Comma-Separated Values) string representation. It extends the StandardCsvRenderer abstract class, which defines a default rendering mechanism by converting the input object to its String representation.
As an implicit object, CsvRendererLong can be automatically applied wherever a StandardCsvRenderer[Long] is required in the context of CSV rendering operations, such as serializing data of type Long into CSV format.
Example usage:
implicit val csvAttributes: CsvAttributes = CsvAttributes() // Example of CSV configuration
val longValue: Long = 123456789L
val csvString: String = CsvRendererLong.render(longValue, Map.empty) // "123456789"
Note: Additional attributes passed in the Map parameter to the render method are supported but not utilized in this implementation.
Attributes
- Supertypes
-
class StandardCsvRenderer[Long]trait CsvRenderer[Long]class Objecttrait Matchableclass AnyShow all
- Self type
-
CsvRendererLong.type
Implicit object providing a CSV renderer for the Short type.
Implicit object providing a CSV renderer for the Short type.
This object extends the StandardCsvRenderer class, implementing the base functionality to render Short values into their string representation in CSV format. It can be used implicitly wherever a CsvRenderer[Short] is required.
It adheres to the default behavior of StandardCsvRenderer, which converts the given value to its string representation without applying additional attributes or custom processing.
Attributes
- Supertypes
-
class StandardCsvRenderer[Short]trait CsvRenderer[Short]class Objecttrait Matchableclass AnyShow all
- Self type
-
CsvRendererShort.type
Attributes
- Supertypes
-
class StandardCsvRenderer[String]trait CsvRenderer[String]class Objecttrait Matchableclass AnyShow all
- Self type
-
CsvRendererString.type
Provides an implicit instance of StandardCsvRenderer for the type java.net.URL.
Provides an implicit instance of StandardCsvRenderer for the type java.net.URL.
This object is used to render URL instances into their CSV (Comma-Separated Values) string representation. It extends the StandardCsvRenderer class, leveraging its default implementation for converting objects into a string format. Specifically, for URL instances, the toString method of the URL is used as the rendered string by default, unless overridden.
The renderer is intended for scenarios where URL objects need to be serialized or exported in CSV format, commonly for data processing or storage purposes.
Example usage:
val url: URL = new URL("https://example.com")
val renderedCsv: String = summon[StandardCsvRenderer[URL]].render(url, Map())
// renderedCsv would contain "https://example.com"
This implicit object allows seamless usage of URL type rendering in contexts where StandardCsvRenderer is required, such as within collections or for pipeline-based CSV serialization.
Attributes
- Supertypes
-
class StandardCsvRenderer[URL]trait CsvRenderer[URL]class Objecttrait Matchableclass AnyShow all
- Self type
-
CsvRendererURL.type
The StandardCsvRenderer is an abstract class that provides a base implementation of the CsvRenderer trait for rendering objects of type T into CSV (Comma-Separated Values) format.
The StandardCsvRenderer is an abstract class that provides a base implementation of the CsvRenderer trait for rendering objects of type T into CSV (Comma-Separated Values) format.
This class is typically extended to create concrete renderers for specific types. By default, it implements the render method to simply convert the input object to its string representation, but this behavior may be overridden in subclasses to implement more specific serialization logic.
Type parameters
- T
-
The type of object to be rendered into CSV format.
Attributes
- Supertypes
- Known subtypes
-
object CsvRendererBooleanobject CsvRendererByteobject CsvRendererDoubleobject CsvRendererFloatobject CsvRendererIntobject CsvRendererLongobject CsvRendererShortobject CsvRendererStringobject CsvRendererURLShow all
Value members
Concrete methods
Method to quote a String as a CSV field (as in RFC 4180), if it has to be quoted to be read back as it is: that is, if it contains the delimiter, the quote character or a line break, or if it starts or ends with whitespace. Any quote characters inside it are doubled.
Method to quote a String as a CSV field (as in RFC 4180), if it has to be quoted to be read back as it is: that is, if it contains the delimiter, the quote character or a line break, or if it starts or ends with whitespace. Any quote characters inside it are doubled.
Value parameters
- ca
-
the CsvAttributes (for the delimiter and the quote character).
- w
-
the String.
Attributes
- Returns
-
the String, quoted if necessary.
Givens
Givens
An implicit object for rendering Boolean values into CSV (Comma-Separated Values) format.
An implicit object for rendering Boolean values into CSV (Comma-Separated Values) format.
CsvRendererBoolean extends the StandardCsvRenderer abstraction, which provides a base implementation for converting objects into their CSV string representation.
This implicit object handles the rendering of Boolean values by converting them to their string representation, typically as "true" or "false".
Usage: The CsvRendererBoolean can be implicitly used wherever a StandardCsvRenderer[Boolean] is required, enabling seamless conversion of Boolean values to CSV-compatible strings.
Example:
// Assuming an implicit `CsvAttributes` in scope
val renderer = summon[StandardCsvRenderer[Boolean]]
val csvValue = renderer.render(true, Map.empty)
println(csvValue) // Output: "true"
Attributes
An implicit implementation of the StandardCsvRenderer for the Byte type.
An implicit implementation of the StandardCsvRenderer for the Byte type.
The CsvRendererByte object provides functionality to render Byte values into CSV format by extending the StandardCsvRenderer abstract class. This implementation defines the specific rendering behavior for converting Byte type data into its CSV-compatible string representation.
Attributes
CsvRendererDouble is an implicit object that provides a mechanism to render instances of type Double into a CSV (Comma-Separated Values) format. It extends the StandardCsvRenderer abstract class, inheriting its generic rendering capabilities, and specializes the functionality for Double values.
CsvRendererDouble is an implicit object that provides a mechanism to render instances of type Double into a CSV (Comma-Separated Values) format. It extends the StandardCsvRenderer abstract class, inheriting its generic rendering capabilities, and specializes the functionality for Double values.
This implicit object allows seamless and type-safe rendering of Doubles into strings formatted for CSV output by leveraging Scala's implicit resolution mechanism.
Example usage:
import CsvRenderers._
val value: Double = 123.456
val renderedValue: String = CsvRendererDouble.render(value)
println(renderedValue) // Output: "123.456"
The CsvRendererDouble relies on the default implementation of render in the StandardCsvRenderer class, where the Double is converted to its string representation. Custom attributes influencing the rendering may be passed via a map, though they are unused in the default implementation.
Attributes
- See also
-
com.phasmidsoftware.tableparser.core.render.StandardCsvRenderer
Implicit object that provides a CSV renderer for Float values by extending the StandardCsvRenderer abstract class with type parameter Float.
Implicit object that provides a CSV renderer for Float values by extending the StandardCsvRenderer abstract class with type parameter Float.
This renderer converts Float values into their CSV string representation, utilizing the default behavior from the StandardCsvRenderer class unless overridden. The implicit nature of this object allows it to be automatically used wherever a StandardCsvRenderer for Float is required.
This renderer adheres to the base CsvRenderer trait interface, enabling consistent rendering of Float values in CSV-related operations.
Attributes
Implicit object CsvRendererInt provides a concrete implementation of the StandardCsvRenderer class for rendering Int values into CSV (Comma-Separated Values) format.
Implicit object CsvRendererInt provides a concrete implementation of the StandardCsvRenderer class for rendering Int values into CSV (Comma-Separated Values) format.
This object allows the rendering of integer values into their string representation for use in CSV output while adhering to the conventions defined in the StandardCsvRenderer abstraction.
Being defined as implicit, it can be automatically utilized in any context where a StandardCsvRenderer[Int] is required, enabling seamless integration into systems that rely on type class-based serialization for CSV export.
Attributes
Implicit object CsvRendererLong provides a StandardCsvRenderer implementation specifically for the Long type.
Implicit object CsvRendererLong provides a StandardCsvRenderer implementation specifically for the Long type.
This renderer is used to convert Long values into their CSV (Comma-Separated Values) string representation. It extends the StandardCsvRenderer abstract class, which defines a default rendering mechanism by converting the input object to its String representation.
As an implicit object, CsvRendererLong can be automatically applied wherever a StandardCsvRenderer[Long] is required in the context of CSV rendering operations, such as serializing data of type Long into CSV format.
Example usage:
implicit val csvAttributes: CsvAttributes = CsvAttributes() // Example of CSV configuration
val longValue: Long = 123456789L
val csvString: String = CsvRendererLong.render(longValue, Map.empty) // "123456789"
Note: Additional attributes passed in the Map parameter to the render method are supported but not utilized in this implementation.
Attributes
Implicit object providing a CSV renderer for the Short type.
Implicit object providing a CSV renderer for the Short type.
This object extends the StandardCsvRenderer class, implementing the base functionality to render Short values into their string representation in CSV format. It can be used implicitly wherever a CsvRenderer[Short] is required.
It adheres to the default behavior of StandardCsvRenderer, which converts the given value to its string representation without applying additional attributes or custom processing.
Attributes
Provides an implicit instance of StandardCsvRenderer for the type java.net.URL.
Provides an implicit instance of StandardCsvRenderer for the type java.net.URL.
This object is used to render URL instances into their CSV (Comma-Separated Values) string representation. It extends the StandardCsvRenderer class, leveraging its default implementation for converting objects into a string format. Specifically, for URL instances, the toString method of the URL is used as the rendered string by default, unless overridden.
The renderer is intended for scenarios where URL objects need to be serialized or exported in CSV format, commonly for data processing or storage purposes.
Example usage:
val url: URL = new URL("https://example.com")
val renderedCsv: String = summon[StandardCsvRenderer[URL]].render(url, Map())
// renderedCsv would contain "https://example.com"
This implicit object allows seamless usage of URL type rendering in contexts where StandardCsvRenderer is required, such as within collections or for pipeline-based CSV serialization.