28 October 2010

Jersey – Some issues with XMLElement / XMLWrapperElement in JAVA

using JAXB, Jetty and Jersey.
Any XMLElement that has a get function could not use the XMLElement or XMLElementWrapper. They can only use the get method if the variable name is not the string following the get in get method exactly. Or the variable should be set to public so that there is no get and set method is needed for it.
If you have private variable, do not use set and get methods and only use @XMLElement, it will be outputted. If you define it as public variable, then no need to use @XMLElement either.

xmlElement

old note: Static Method (Function)
If a method’s outcome is not really related to the object and is more of a general issue in the class or in your project, it might be a wise idea to define that as a Static method. Not defining it, do not create any harms but it is better to create as a Static method so that when you take a glance at your class, easily distinguish which methods are really related to an object.
tool_validation

No comments:

Post a Comment