Implementing classes deal with the details of parsing XML strings/streams into yaidom Documents.
The yaidom package itself is agnostic of those details.
Typical implementations use DOM, StAX or SAX, but make them easier to use in the tradition of the "template" classes
of the Spring framework. That is, resource management is done as much as possible by the DocumentParser,
typical usage is easy, and complex scenarios are still possible. The idea is that the parser is configured once, and
that it should be re-usable multiple times.
One of the parse methods takes an InputStream instead of Source object, because that works better with a DOM implementation.
Although DocumentParser instances should be re-usable multiple times, implementing classes are encouraged to indicate
to what extent re-use of a parser instance is indeed supported (single-threaded, or even multi-threaded).
Document parser. This trait is purely abstract.
Implementing classes deal with the details of parsing XML strings/streams into yaidom
Document
s. The yaidom package itself is agnostic of those details.Typical implementations use DOM, StAX or SAX, but make them easier to use in the tradition of the "template" classes of the Spring framework. That is, resource management is done as much as possible by the DocumentParser, typical usage is easy, and complex scenarios are still possible. The idea is that the parser is configured once, and that it should be re-usable multiple times.
One of the
parse
methods takes anInputStream
instead ofSource
object, because that works better with a DOM implementation.Although
DocumentParser
instances should be re-usable multiple times, implementing classes are encouraged to indicate to what extent re-use of a parser instance is indeed supported (single-threaded, or even multi-threaded).