XML Binding Framework Beta-1 Released
Still without a proper name, X2J Beta 1 has been released today.
I implore you all to download either the Jar or the Tar.gz files and try them out, and perhaps send some issues and bugs to the issue tracker.
Beta 1's features:
- Name of POJO and XML element Names of your POJOs can be generally Anything. To make X2J realise which class it should instanciate for which XML element, you can annotate the class with
@Name("myName"). - Elements and Attributes Your XML elements must have inner elements and attributes. Otherwise, what's the point? Annotate
gettermethods with@Attributeor@Elementto tell X2J how to treat those elements and attributes, but don't forget to providesettersas well! - Java Arrays Have an array in your class? Have no fear. Annotate the array with
@FixedSequence(size)and even with@Nameto generate and read the array to and from XML documents as a sequence of XML elements of the array's type. - Primitives Primitives are supported completely and magically, even though they're not annotated by any X2J annotations.
- Converters Got a class from the Java framework or a third party software provider? Want to use it in your parsing or serializing? Just annotate it with
@Converter(converter.class). An example converting theCalendarclass is available asCalendarConverter.
- Collections As of now, only Java arrays are supported, so Collection inherited classes can't be used (yet!).
- Primary Keys Discussed it thoroughly here, and generally they provide for a way to reuse serialized items, thus making an XML document substantially smaller, and re-creating the parsed object tree to be exactly as it was before serialization.
- Factories Provide a means of using interfaces in the X2J classes, and use a
@Factoryannotation to determine which class type to annotate. Note that it will also allow for different classes to be instanciated according to the element's attributes, so this would be a really cool feature.
Comments (4)