What is the default rule for jaxb unmarshall xml data?

Want to know, having a class without any annotation, like jaxb unmarshall xml data for a class.

I found that he can take the following

If I have a node "label in xml

I have the "_label" field in the class and the getLabel and setLabel method.

jaxb can unmarshall this is sucsessully. I just want to know my default rule.

+6
java jaxb
Mar 05 '11 at 11:30
source share
1 answer

The following is the JAXB 2 specification ( JSR-222 ):

8.12 Default Mapping

This section describes the default display of program elements. default mapping is specified in terms of default annotations, which are considered applicable to the program element even in their absence.

8.12.1 Java ID in XML Name

The following shows the default mapping for different identifiers:

  • class name: the class name is mapped to the XML name by capitalization using java.beans.Introspector.decapitalize (class name).
  • enumtype name: enumtype name maps to XML name using capitalization java.beans.Introspector.decapitalize (enumtype name).
  • The property name (e.g. address) is derived from the JavaBean access method (e.g. getAddress) from JavaBean de capitalization of JavaBean Property name java.beans.Introspector.decapitalize (JavaBeanAcc essMethod)
+10
Mar 05 2018-11-11T00:
source share



All Articles