info.fingo.spata.text

Members list

Type members

Classlikes

final class BooleanFormatter(tt: String, ft: String, locale: Locale)

Formatter used to format and parse string representation of boolean values.

Formatter used to format and parse string representation of boolean values.

Value parameters

ft

the term representing false, case insensitive

locale

the locale used to handle case conversion

tt

the term representing true, case insensitive

Attributes

Constructor

Creates formatter.

Companion
object
Supertypes
class Object
trait Matchable
class Any

BooleanFormatter companion object, used for formatter creation.

BooleanFormatter companion object, used for formatter creation.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
trait FormattedStringParser[+A, B] extends StringParser[A]

Parser from String to desired type with support for different formats.

Parser from String to desired type with support for different formats.

This parser defines behavior to be implemented by concrete, given parser instances for various types, used by [[StringParser.parseA* parse]] function from StringParser object.

Parsing fails on an empty input if a simple type is provided. To accept empty input Option[?] should be provided as type parameter.

Type parameters

A

target type for parsing

B

type of formatter

Attributes

Supertypes
trait StringParser[A]
class Object
trait Matchable
class Any
Known subtypes
object bigDecimalParserFmt.type
object booleanParserFmt.type
object doubleParserFmt.type
object localDateParserFmt.type
object localTimeParserFmt.type
object longParserFmt.type
Show all
trait FormattedStringRenderer[-A, B] extends StringRenderer[A]

Renderer from provided type to String with support for different formats.

Renderer from provided type to String with support for different formats.

This renderer defines behavior to be implemented by concrete, given renderer instances for various types, used by render function from StringRenderer object.

Renderer's contravariance allows limiting givens to parent types if subclasses are formatted in the same way, using the same formatter type.

If the input is null, all provided given implementations return empty string as rendering result. If the input is a scala.Option, provided given instances render its content if or return empty string.

Type parameters

A

source type for rendering

B

type of formatter

Attributes

Supertypes
trait StringRenderer[A]
class Object
trait Matchable
class Any
Known subtypes
object booleanRendererFmt.type
object doubleRendererFmt.type
object longRendererFmt.type
object numberRendererFmt.type
object temporalRendererFmt.type
final class ParseError(val content: String, val dataType: Option[String], cause: Option[Throwable]) extends Exception

Exception for string parsing errors.

Exception for string parsing errors.

Value parameters

cause

the root exception, if available

content

the content which has been parsed

dataType

the target data type description

Attributes

Constructor

Creates new ParseError

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
trait StringParser[+A]

Parser from String to desired type.

Parser from String to desired type.

This parser defines behavior to be implemented by concrete, given parser instances for various types, used by [[StringParser.parseA* parse]] function from StringParser object.

Parsing fails on an empty input if a simple type is provided. To accept empty input Option[?] should be provided as type parameter.

Type parameters

A

target type for parsing

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait FormattedStringParser[A, B]
object bigDecimalParserFmt.type
object booleanParserFmt.type
object doubleParserFmt.type
object localDateParserFmt.type
object localTimeParserFmt.type
object longParserFmt.type
object intParser.type
object stringParser.type
Show all
object StringParser

Parsing methods from String to various simple types.

Parsing methods from String to various simple types.

Contains parsers for common types, like numbers, dates and times.

Additional parsers may be provided by implementing StringParser or FormattedStringParser traits and putting given instances in scope. StringParser may be implemented if there are no different formatting options for given type, e.g. for integers (although one may argue if this is a good example). For all cases when different formatting options exist, FormattedStringParser should be implemented.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait StringRenderer[-A]

Renderer from provided type to String. It is similar to toString, although it should handle nulls and unwrap Option content.

Renderer from provided type to String. It is similar to toString, although it should handle nulls and unwrap Option content.

This renderer defines behavior to be implemented by concrete, given renderer instances for various types, used by render function from StringRenderer object.

Renderer's contravariance allows limiting givens to parent types if subclasses are formatted in the same way.

If the input is null, all provided given implementations return empty string as rendering result. If the input is a scala.Option, provided given instances render its content if or return empty string.

Type parameters

A

source type for rendering

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object booleanRendererFmt.type
object doubleRendererFmt.type
object longRendererFmt.type
object numberRendererFmt.type
object temporalRendererFmt.type
object intRenderer.type
object stringRenderer.type
Show all

Rendering methods from various simple types to String.

Rendering methods from various simple types to String.

Contains renderers for common types, like numbers, dates and times.

Additional renderers may be provided by implementing StringRenderer or FormattedStringRenderer traits and putting given instances in scope. StringRenderer may be implemented if there are no different formatting options for given type, e.g. for integers. For all cases when different formatting options exist, FormattedStringRenderer should be implemented.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Types

type ParseResult[A] = Either[ParseError, A]

Convenience type.

Convenience type.

Attributes