Improve Jaxb2Decoder

- Introcuces XmlEventDecoder which decodes from DataBuffer to
  javax.xml.stream.events.XMLEvent. It uses the Aalto async XML API if
  available, but falls back to a blocking default if not.

- Refacors Jaxb2Decoder to use said XmlEventDecoder, and split the
  stream of events into separate substreams by using the JAXB annotation
  value, one stream for each part of the tree that can be unmarshaled to
  the given type.

- Various improvements in the JAXB code.
This commit is contained in:
Arjen Poutsma
2016-03-21 14:02:52 +01:00
parent a8f27af5fb
commit 75399814cd
18 changed files with 1105 additions and 128 deletions

View File

@@ -105,6 +105,7 @@ dependencies {
optional "org.eclipse.jetty:jetty-server:${jettyVersion}"
optional "org.eclipse.jetty:jetty-servlet:${jettyVersion}"
optional("org.freemarker:freemarker:2.3.23")
optional("com.fasterxml:aalto-xml:1.0.0")
provided "javax.servlet:javax.servlet-api:3.1.0"
@@ -118,6 +119,7 @@ dependencies {
}
testCompile "org.hamcrest:hamcrest-all:1.3"
testCompile "com.squareup.okhttp3:mockwebserver:3.0.1"
testCompile("xmlunit:xmlunit:1.6")
// Needed to run Javadoc without error
optional "org.apache.httpcomponents:httpclient:4.5.1"