| JAXB 2.0 If you are on Java 5, you might want to consider using the JAXB 2.0 support in XFire. It also allows you to customize your classes via annotations, but it also supports a march larger set of XML schema than these annotations. |
Working in Java 5
Everything mentioned above will still work in Java 5.0 but you will get several additional features:
- Support for Generics and Collections
- Enum Support
- Ability to use Attributes to control naming
- Nice integration with XFire's JSR 181 support
Of the above generics and enums should work out of the box. Just declare and use.
Aegis Annotations
Lets say we would like to control the naming of our elements again. Via annotations it would look like so:
Notice, annotations are declared on the read method of a property.
Voila, this should serialize as:
You could of course use the XmlAttribute type as well:
This would serialize as:
You can also prevent a property from appearing in the WSDL by using the IgnoreProperty:
