Can you plea开发者_开发问答se recommend a fast XML Builder in Java that doesn't use annotations? Thanks.
JAXB 2. You can use it without annotations, defining mappings in XML resources.
Betwixt, from apache is pretty good for simple stuff. http://commons.apache.org/betwixt/
Xstream is a better and faster framework. Its easier to learn as well.
XMLEncoder. It is a standard Java class, simple, feature-poor way of serializing objects to XML.
How about StaxMate -- very light-weight, faster than object-mapper solutions (XStream or JAXB), still reasonably easy to use for many use cases.
Of course it really depends on whether by fast you mean time to write code (if so, XStream is probably the thing), or time to run it (in which case simple Stax/SAX wrapping writers, like StaxMate or XMLBuilder are the things); XStream is not particular fast, although it's not the slowest thing around.
精彩评论