What is JAXBContext newInstance (String contextPath)?

I see the use of the method below in my project

JAXBContext jc = JAXBContext.newInstance("org.test.customer");

where org.test.customeris the package name

Does this mean that we can marshal / unmarshal classes that lie in org.test.customer?

My understanding is based on http://docs.oracle.com/javaee/5/api/javax/xml/bind/JAXBContext.html#newInstance(java.lang.String)

+4
source share
1 answer

Explanation in JAXBContext class javadoc

A JAXBContext instance is initialized from a colon-separated list of package names. Each java package contains JAXB mapping classes, schema-derived classes, and / or annotated user classes.

Example:

JAXBContext jc = JAXBContext.newInstance( "com.acme.foo:com.acme.bar" );
+4
source