How does package-info.java work?

When I create Java files from an XML schema using JAXB, the package-info.java file is created.

What is this file for? and how does it work?

In particular, this file contains an annotation as shown below.

@javax.xml.bind.annotation.XmlSchema(namespace = "http://searchrequest")

What does it mean? I doubt this is doing something with javadoc or Eclipse Juno.

It must be something specific with JAXB, right?

+3
source share
1 answer

package-info.javais 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 may contain package declaration, package annotations, package commentsand Javadoc tags. This file is usually preferred 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/

+8

All Articles