Object

io.dylemma.spac.Parser

ForText

Related Doc: package Parser

Permalink

object ForText extends AbstractHandlerFactory[XMLEvent, String, Try, [-in, +out]Parser[out]] with Parser[String]

Source
Parser.scala
Linear Supertypes
Parser[String], AbstractHandlerFactory[XMLEvent, String, Try, [-in, +out]Parser[out]], HandlerFactory[XMLEvent, Try[String]], (Any) ⇒ HandlerFactory[XMLEvent, Try[String]], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ForText
  2. Parser
  3. AbstractHandlerFactory
  4. HandlerFactory
  5. Function1
  6. AnyRef
  7. 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. def and[O2](p2: Parser[O2]): Combined2[String, O2]

    Permalink
    Definition Classes
    Parser
  5. def andThen[A](g: (HandlerFactory[XMLEvent, Try[String]]) ⇒ A): (Any) ⇒ A

    Permalink
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  6. def apply(v1: Any): HandlerFactory[XMLEvent, Try[String]]

    Permalink

    Always returns this, so that this can be passed to Splitter#through

    Always returns this, so that this can be passed to Splitter#through

    Definition Classes
    HandlerFactory → Function1
  7. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def compose[A](g: (A) ⇒ Any): (A) ⇒ HandlerFactory[XMLEvent, Try[String]]

    Permalink
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  10. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. object followedBy extends FollowedBy[Parser, Out]

    Permalink

    An intermediate object with an apply and flatMap that both create a sequenced Parser which combines this Parser with a function to create the next one.

    An intermediate object with an apply and flatMap that both create a sequenced Parser which combines this Parser with a function to create the next one.

    Examples:

    val p1: Parser[A] = /* ... */
    def getP2(p1Result: A): Parser[B] = /* ... */
    val combined: Parser[B] = p1.followedBy(getP2)
    
    // alternative `flatMap` syntax
    val combined: Parser[B] = for {
      p1Result <- p1.followedBy
      p2Result <- getP2(p1Result)
    } yield p2Result

    An example of where this is useful is when a parser for XML element depends on values parsed from one of its previous siblings, but where you don't want to wait until the end of their parent element before they can be combined.

    returns

    An intermediate object which has an apply and flatMap that can be used to combine this Parser and another in a sequence.

    Definition Classes
    Parser
  14. object followedByStream extends FollowedBy[[+T2]Transformer[XMLEvent, T2], Out]

    Permalink

    An intermediate object that can be used to create a Transformer from result of this Parser.

    An intermediate object that can be used to create a Transformer from result of this Parser.

    Examples:

    val p1: Parser[A] = /* ... */
    def getP2Stream(p1Result: A): Transformer[XMLEvent, B] = /* ... */
    val combined: Transformer[XMLEvent, B] = p1.andThenStream(getP2Stream)
    
    // alternative `flatMap` syntax
    val combined: Transformer[XMLEvent, B] = for {
      p1Result <- p1.andThenStream
      p2Result <- getP2Stream(p1Result)
    } yield p2Result

    An example of where this is useful is when an XML element contains some "dictionary" object at the beginning, followed by a sequence of "data" objects which reference the dictionary. For large sequences, combining them to a List (to use with Parser's and combiners) is undesireable; we can use this approach to avoid doing so.

    returns

    An intermediate object which has an apply and flatMap that can be used to combine this Parser and a Transformer in a sequence.

    Definition Classes
    Parser
  15. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  18. def makeHandler(): TextCollectorHandler

    Permalink
    Definition Classes
    ForTextHandlerFactory
  19. def map[B](f: (String) ⇒ B): Parser[B]

    Permalink

    Create a new handler factory whose results are transformed by the given function f.

    Create a new handler factory whose results are transformed by the given function f.

    B

    The mapped result type

    f

    The function to apply to each result

    returns

    A new handler factory which derives its results by applying f to the results generated by this handler factory

    Definition Classes
    AbstractHandlerFactory
    See also

    syntax.FunctorSyntax.NestedFunctorOps#mapF for when Out is a container e.g. Option or List

  20. def mapResult[B](f: (Try[String]) ⇒ Try[B]): Parser[B]

    Permalink

    Create a new parser whose result containers are transformed by the given function f.

    Create a new parser whose result containers are transformed by the given function f. For Consumers, which use Id as the result container type, mapResult is equivalent to map.

    B

    The mapped result type

    f

    The function applied to each result container

    returns

    a new Parser which derives its results by applying f to the result containers generated by this parser

    Definition Classes
    ParserAbstractHandlerFactory
  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 parse[XML](xml: XML)(implicit consumeXML: ConsumableLike[XML, XMLEvent]): Try[String]

    Permalink
    Definition Classes
    Parser
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def toConsumer: Consumer[XMLEvent, Try[String]]

    Permalink

    If a Parser is context-independent, it can be treated to a Consumer.

    If a Parser is context-independent, it can be treated to a Consumer.

    returns

    A representation of this parser as a Consumer

    Definition Classes
    Parser
  27. def toString(): String

    Permalink
    Definition Classes
    ForText → Function1 → 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( ... )
  31. def ~[O2](p2: Parser[O2]): Combined2[String, O2]

    Permalink
    Definition Classes
    Parser

Inherited from Parser[String]

Inherited from AbstractHandlerFactory[XMLEvent, String, Try, [-in, +out]Parser[out]]

Inherited from HandlerFactory[XMLEvent, Try[String]]

Inherited from (Any) ⇒ HandlerFactory[XMLEvent, Try[String]]

Inherited from AnyRef

Inherited from Any

Ungrouped