Mixin for HandlerFactory that adds mapping operations
Mixin for HandlerFactory that adds mapping operations
The generated handler's input type
The generated handler's output type
A container type for output values, e.g. Try
or types.Id
Type constructor for mapped versions of this factory
An immutable object that can be used to create Handler
s.
Implicitly adds followedBy
and followedByStream
to Consumers with Stackable input types.
Implicitly adds followedBy
and followedByStream
to Consumers with Stackable input types.
(Due to type variance conflicts between Consumer's In
type and Stackable's type, these
methods can't be defined directly on Consumer.)
The consumer's input type, which must be a member of the Stackable
typeclass
The consumer's output type
An object responsible for inspecting a stack of StartElement
events and determining if they correspond
to some "context" value of type A
.
An object responsible for inspecting a stack of StartElement
events and determining if they correspond
to some "context" value of type A
.
ContextMatcher
s play a primary role in splitting an XML event stream into "substreams", i.e. each
substream is defined as the series of consecutive events during which the XML tag stack matches a context.
ContextMatcher
s are intended to be transformed and combined with each other in order to build up
more complex matching functionality. See also: SingleElementContextMatcher
, which contains additional
combination methods and some specialized transformation methods.
The type of the matched context.
An intermediate object for creating sequence-based combination methods for a Parser or Consumer.
An intermediate object for creating sequence-based combination methods for a Parser or Consumer.
Type constructor for the parser/consumer of a given output type
Output type for the "first" parser/consumer; using the combination methods in this trait will result in an instance of T1 being used to create a "second" parser/consumer/transformer to be run sequentially after the first.
The base processing unit for dealing with streams of data.
The base processing unit for dealing with streams of data.
A handler accepts inputs of type In
, eventually yielding
a value of type Out
. If the handleInput
or handleError
methods for a handler ever return a Some
, it implies that
the handler has reached a result, and should no longer be called.
Similarly, if the isFinished
method returns true
, the
handleX
methods should no longer be called.
Handlers are mutable by nature. Handler instances should not be shared across threads. Several traits in this library act as "blueprints" which create handler instances. These blueprint classes are immutable, and may be safely shared across threads.
The input type
The output type
Base trait for Consumers and Parsers.
Base trait for Consumers and Parsers.
HandlerFactories must be able to create new Handler instances with no input provided.
For convenience, every HandlerFactory is also a function that returns itself.
This is because Splitter
's through
method expects a Context => HandlerFactory
,
but sometimes the actual context value does not matter. This allows you to call
someSplitter.through(parser)
instead of someSplitter.through(_ => parser)
The generated handler's input type
The generated handler's output type
Adds convenience mapping functions to "containers of containers"; notably, Parser[Option[A]]
Adds convenience mapping functions to "containers of containers"; notably, Parser[Option[A]]
The outer container type
The inner container type
The item type
A HandlerFactory specialized for XMLEvents, which produces results wrapped in a Try
.
A HandlerFactory specialized for XMLEvents, which produces results wrapped in a Try
.
Parsers can be combined and run to process complex XML structures.
Result type
Specialization of ContextMatcher which only checks the first element in the stack for matching operations.
Specialization of ContextMatcher which only checks the first element in the stack for matching operations. Transformation operations on single-element matchers will yield other single-element matchers (rather than the base ContextMatcher type). Combination operations involving other single-element matchers will also yield single-element matchers. SingleElementContextMatchers form the building blocks of more complex matchers.
The type of the matched context.
An immutable object that can be used to create a handler which wraps an existing handler, possibly transforming inputs before passing them along to the downstream handler.
Context matcher that matches any single element at the head of the tag stack.
Context matcher that matches any single element at the head of the tag stack.
Context matcher that always matches without consuming any of the tag stack.
Context matcher that always matches without consuming any of the tag stack.
Context matcher that extracts the given attribute from the element at the head of the stack.
Context matcher that extracts the given attribute from the element at the head of the stack.
The local name of the attribute to extract
Context matcher that extracts the given attribute from the element at the head of the stack.
Context matcher that extracts the given attribute from the element at the head of the stack.
The qualified name of the attribute to extract
Context matcher that matches the element at the head of the stack
as long as its name (local part only) is equal to the given name
Context matcher that matches the element at the head of the stack
as long as its name (local part only) is equal to the given name
The required (local) name for the element at the head of the stack
Context matcher that matches the element at the head of the stack
as long as its name is equal to the given qname
.
Context matcher that matches the element at the head of the stack
as long as its name is equal to the given qname
.
The required name (QName) for the element at the head of the stack
Context matcher that extracts the (local) name of the element at the head of the stack.
Context matcher that extracts the (local) name of the element at the head of the stack.
Context matcher that extracts the (qualified) name of the element at the head of the stack.
Context matcher that extracts the (qualified) name of the element at the head of the stack.
Implicitly convert a QName
to an elem
matcher
Implicitly convert a QName
to an elem
matcher
Implicitly convert a String
to an elem
matcher
Implicitly convert a String
to an elem
matcher