What is JAXB generated package-info.java

E-rich picture E-rich · Sep 21, 2011 · Viewed 32.4k times · Source

I'm trying to find some information on what the package-info.java file generated by the JAXB xjc commandline app actually does. All that is in the file is

@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.example.com", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package the.generated.package.path;

What is this package-info.java file used for?

Answer

piepera picture piepera · Sep 21, 2011

package-info.java is a way to apply java annotations at the package level. In this case Jaxb is using package-level annotations to indicate the namespace, and to specify namespace qualification for attributes (source).