When I generate Java files from XML Schema using JAXB, package-info.java file is generated.
What is this file for? and how does it work?
Especially, this file contains annotation like below.
@javax.xml.bind.annotation.XmlSchema(namespace = "http://searchrequest")
What does this mean? I doubt this does something with javadoc or Eclipse Juno.
This should be something specific with JAXB, isn't it?
The package-info. java is a Java file that can be added to any Java source package. Its purpose is to provide a home for package level documentation and package level annotations.
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).
The package-info.java
is a Java file that can be added to any Java source package. Its purpose is to provide a home for package level documentation and package level annotations.
It Can contain a package declaration
, package annotations
, package comments
and Javadoc tags
. This file is generally preferred over package.html
.
For more information visit:
http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/javadoc.html#packagecomment
http://www.intertech.com/Blog/whats-package-info-java-for/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With