Trait/Object

com.lucidchart.open.xtract

XmlReader

Related Docs: object XmlReader | package xtract

Permalink

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]

    Permalink

    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

    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. def andThen[B](other: XmlReader[B])(implicit witness: <:<[A, NodeSeq]): XmlReader[B]

    Permalink

    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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def collect[B](f: PartialFunction[A, B]): XmlReader[B]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

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

  11. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. def filter(error: ⇒ ParseError)(p: (A) ⇒ Boolean): XmlReader[A]

    Permalink

    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]

    Permalink

    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 finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def flatMap[B](f: (A) ⇒ XmlReader[B]): XmlReader[B]

    Permalink

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

  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. def map[B](f: (A) ⇒ B): XmlReader[B]

    Permalink

    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.

  21. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  24. def optional: XmlReader[Option[A]]

    Permalink

    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

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    Recover from a failed parse, keeping any errors.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  30. def tryMap[B](fe: (A) ⇒ ParseError)(f: (A) ⇒ B): XmlReader[B]

    Permalink

    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.

  31. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. def |[B >: A](other: XmlReader[B]): XmlReader[B]

    Permalink

    Alias for or

Inherited from AnyRef

Inherited from Any

Ungrouped