Object

io.circe.config

parser

Related Doc: package config

Permalink

object parser extends Parser

Utilities for parsing com.typesafe.config.Config sources to io.circe.Json as well as decoding to a specific type.

Source
parser.scala
Example:
  1. scala> import com.typesafe.config.ConfigFactory
    scala> import io.circe.config.parser
    scala> val config = ConfigFactory.parseString("server { host = localhost, port = 8080 }")
    scala> val json: Either[io.circe.ParsingFailure, io.circe.Json] = parser.parse(config)
    scala> json.right.get.noSpaces
    res0: String = {"server":{"port":8080,"host":"localhost"}}
    scala> import io.circe.generic.auto._
    scala> case class ServerSettings(host: String, port: Int)
    scala> parser.decode[ServerSettings](config.getConfig("server"))
    res1: Either[io.circe.Error, ServerSettings] = Right(ServerSettings(localhost,8080))
See also

syntax.configDecoder for how to map io.circe.Json to com.typesafe.config.Config

Linear Supertypes
Parser, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. parser
  2. Parser
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def decode[A](config: Config)(implicit arg0: Decoder[A]): Either[Error, A]

    Permalink
  7. final def decode[A](input: String)(implicit arg0: Decoder[A]): Either[Error, A]

    Permalink
    Definition Classes
    Parser
  8. final def decodeAccumulating[A](config: Config)(implicit arg0: Decoder[A]): ValidatedNel[Error, A]

    Permalink
  9. final def decodeAccumulating[A](input: String)(implicit arg0: Decoder[A]): ValidatedNel[Error, A]

    Permalink
    Definition Classes
    Parser
  10. final def decodeFile[A](file: File)(implicit arg0: Decoder[A]): Either[Error, A]

    Permalink
  11. final def decodeFileAccumulating[A](file: File)(implicit arg0: Decoder[A]): ValidatedNel[Error, A]

    Permalink
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def finishDecode[A](input: Either[ParsingFailure, Json])(implicit decoder: Decoder[A]): Either[Error, A]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Parser
  16. final def finishDecodeAccumulating[A](input: Either[ParsingFailure, Json])(implicit decoder: Decoder[A]): ValidatedNel[Error, A]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Parser
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def parse(input: String): Either[ParsingFailure, Json]

    Permalink
    Definition Classes
    parser → Parser
  24. final def parse(config: Config): Either[ParsingFailure, Json]

    Permalink
  25. final def parseFile(file: File): Either[ParsingFailure, Json]

    Permalink
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Parser

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped