given_Parser_Boolean

io.eezo.core.Parser.given_Parser_Boolean
object given_Parser_Boolean extends Parser[Boolean]

Strict, because outside a browser there is no wire convention to honour. A typo such as ture in a configuration value has to be refused rather than read as one of the two, and only the spellings people write on purpose are accepted. A checkbox's on is a browser's convention, and the form side keeps its own lenient reading for it.

Absent is false, so a flag nobody set is off rather than required.

Attributes

Source
Parser.scala
Graph
Supertypes
trait Parser[Boolean]
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

override def absent: Option[Boolean]

The value to use when there is no text at all, if there is one.

The value to use when there is no text at all, if there is one.

A separate answer from reading the empty text, because a missing key and an empty one differ for some sources: a browser omits an unchecked checkbox entirely, and an unset variable is not one set to nothing. Only a type that has a sensible default says so, which leaves every other one able to report itself as required.

Attributes

Definition Classes
Source
Parser.scala
def read(text: String): Either[String, Boolean]

Reads the text, or says why it will not read.

Reads the text, or says why it will not read.

Attributes

Source
Parser.scala