trait XmlReader[+A] extends AnyRef

An abstraction for a function that takes a NodeSeq and returns a ParseResult.

It is used to parse XML to arbitrary scala objects, and supports combinatorial syntax to easily compose XmlReaders into new XmlReaders.

Self Type
XmlReader[A]
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. XmlReader
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def read(xml: NodeSeq): ParseResult[A]

    The core operation of an XmlReader, it converts an xml NodeSeq into a ParseResult of the desired type.

    The core operation of an XmlReader, it converts an xml NodeSeq into a ParseResult of the desired type.

    xml

    The xml to read from.

    returns

    The ParseResult resulting from reading the xml.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def andThen[B](other: XmlReader[B])(implicit witness: <:<[A, NodeSeq]): XmlReader[B]

    Similar to compose but with the operands reversed.

    Similar to compose but with the operands reversed.

    other

    The XmlReader to compose this with.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  7. def collect[B](f: PartialFunction[A, B]): XmlReader[B]

    Map a partial function over the XmlReader.

    Map a partial function over the XmlReader. If the partial function isn't defined for the input, returns a ParseFailure.

  8. def collect[B](otherwise: ⇒ ParseError)(f: PartialFunction[A, B]): XmlReader[B]

    Map a partial function over the XmlReader.

    Map a partial function over the XmlReader. If the partial function isn't defined for the input, returns a ParseFailure containing otherwise as its error.

  9. def compose[B <: NodeSeq](r: XmlReader[B]): XmlReader[A]

    Compose this XmlReader with another.

    Compose this XmlReader with another.

    r

    An XmlReader that returns a NodeSeq result.

    returns

    New XmlReader that uses this XmlReader to read the result of r.

  10. def default[B >: A](v: B): XmlReader[B]

    Use a default value if unable to parse, always successful, drops any errors

  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. def filter(error: ⇒ ParseError)(p: (A) ⇒ Boolean): XmlReader[A]

    Similar to filter(p:A=>Boolean):*, but allows you to supply the ParseError to use if the filter test fails.

    Similar to filter(p:A=>Boolean):*, but allows you to supply the ParseError to use if the filter test fails.

    error

    The error to use if the filter fails.

    p

    The predicate to filter with

  14. def filter(p: (A) ⇒ Boolean): XmlReader[A]

    Filter the result of the XmlReader.

    Filter the result of the XmlReader. It filters the resulting ParseResult after reading.

    p

    The predicate to filter with

  15. def flatMap[B](f: (A) ⇒ XmlReader[B]): XmlReader[B]

    Similar to map but does a flatMap on the ParseResult rather than a map.

  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def map[B](f: (A) ⇒ B): XmlReader[B]

    Map the XmlReader.

    Map the XmlReader. This converts one XmlReader into another (usually of a different type).

    f

    The mapping function.

    returns

    A new XmlReader that succeeds with result of calling f on the result of this if this succeeds.

  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  23. def optional: XmlReader[Option[A]]

    Convert to a reader that always succeeds with an option (None if it would have failed).

    Convert to a reader that always succeeds with an option (None if it would have failed). Any errors are dropped

  24. def or[B >: A](other: XmlReader[B]): XmlReader[B]

    returns

    New XmlReader that succeeds if either this or v succeeds on the input. This has preference. If both fail the ParseFailure contains the errors from both.

  25. def orElse[B >: A](v: ⇒ XmlReader[B]): XmlReader[B]

    Like or but takes a by-name parameter and doesn't combine errors.

    Like or but takes a by-name parameter and doesn't combine errors.

    returns

    New XmlReader that succeeds if either this or v succeeds on the input. this has preference.

  26. def recover[B >: A](otherwise: B): XmlReader[B]

    Recover from a failed parse, keeping any errors.

  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. def tryMap[B](fe: (A) ⇒ ParseError)(f: (A) ⇒ B): XmlReader[B]

    Try to map, and if there is an exception, return a failure with the supplied error

    Try to map, and if there is an exception, return a failure with the supplied error

    B

    The type to map into.

    fe

    A function that returns the appropriate ParseError if mapping failed.

    f

    The mapping function.

  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. def |[B >: A](other: XmlReader[B]): XmlReader[B]

    Alias for or

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped