Class

com.github.jeremyrsmith.reactivesax.fsm

XmlFsm

Related Doc: package fsm

Permalink

class XmlFsm extends AnyRef

Deterministic Finite State Automaton that implements some XML-like grammar. The only state it keeps is: * A buffer of characters that have yet to be consumed * Two namespace stacks (a default namespace stack and a stack of namespace prefix to URI mappings)

Other than that, it processes input one character at a time, and emits SAX events to the given receiver.

It does no validation.

It knows nothing about DTDs or external entities.

It does nothing with processing instructions (other than emit them to the ContentHandler)

It does not handle errors (nor emit them) except for a few catastrophic parse errors (in which case it will throw an exception)

It won't issue an endDocument event until close() is called (at which point it will emit one immediately)

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. XmlFsm
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new XmlFsm(receiver: ContentHandler, bufferSize: Int = 8192)

    Permalink

    receiver

    The ContentHandler which should receive SAX events

    bufferSize

    The maximum size of the buffer. The buffer is emptied whenever possible. If the buffer is filled while processing a text node, the ContentHandler will receive multiple split text nodes. If it is filled in the middle of an element tag, or CDATA section, I don't konw what will happen. Probably an exception. In general, I would avoid CDATA input. Elements should never be longer than a few hundred characters anyway.

Type Members

  1. case class AttributeNamed(tag: OpenTag, prefix: Option[String], name: String) extends State with Product with Serializable

    Permalink
  2. case class AttributeNeedsValue(tag: OpenTag, prefix: Option[String], name: String) extends State with Product with Serializable

    Permalink
  3. case class AttributeOpen(tag: OpenTag) extends State with Product with Serializable

    Permalink
  4. case class AttributePrefixed(tag: OpenTag, prefix: String) extends State with Product with Serializable

    Permalink
  5. case class CDATASectionMaybeClosing(secondBracket: Boolean) extends State with Product with Serializable

    Permalink
  6. case class ClosingTagPrefixed(prefix: String) extends State with Product with Serializable

    Permalink
  7. case class CommentMaybeClosing(secondDash: Boolean = false) extends State with Product with Serializable

    Permalink
  8. case class DirectiveClosing(target: String, data: Option[String]) extends State with Product with Serializable

    Permalink
  9. case class DirectiveNamed(target: String) extends State with Product with Serializable

    Permalink
  10. case class EncapsedAttributeValue(tag: OpenTag, prefix: Option[String], name: String) extends State with Product with Serializable

    Permalink
  11. case class OpenTag(prefix: Option[String], name: String, attributes: Set[Attribute]) extends State with Product with Serializable

    Permalink
  12. case class OpenTagPrefixed(prefix: String) extends State with Product with Serializable

    Permalink
  13. case class TagSelfCloseStarted(tag: OpenTag) extends State with Product with Serializable

    Permalink

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. object CDATAExpected extends State with Product with Serializable

    Permalink
  5. object CDATASection extends State with Product with Serializable

    Permalink
  6. object CharacterData extends State with Product with Serializable

    Permalink
  7. object CharacterDataEntityOpen extends State with Product with Serializable

    Permalink
  8. object ClosingTagOpen extends State with Product with Serializable

    Permalink
  9. object ClosingTagStarted extends State with Product with Serializable

    Permalink
  10. object Comment extends State with Product with Serializable

    Permalink
  11. object CommentExpected extends State with Product with Serializable

    Permalink
  12. object Declaration extends State with Product with Serializable

    Permalink
  13. object DirectiveOpen extends State with Product with Serializable

    Permalink
  14. object HexNumericEntityOpen extends State with Product with Serializable

    Permalink
  15. object InstructionOpen extends State with Product with Serializable

    Permalink
  16. object NamedEntityOpen extends State with Product with Serializable

    Permalink
  17. object NumericEntityOpen extends State with Product with Serializable

    Permalink
  18. object OpenTagStarted extends State with Product with Serializable

    Permalink
  19. object Root extends State with Product with Serializable

    Permalink
  20. object TagOpen extends State with Product with Serializable

    Permalink
  21. object WhiteSpace extends State with Product with Serializable

    Permalink
  22. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  23. val buffer: CharBuffer

    Permalink
  24. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. def close(): Unit

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. final def getClass(): Class[_]

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

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

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

    Permalink
    Definition Classes
    AnyRef
  33. def next(char: Char): Any

    Permalink
  34. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  36. def open(): Unit

    Permalink
  37. var state: State

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

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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped