Commit 14f4b7c3 authored by Remi Forax's avatar Remi Forax

Merge branch 'improve-documentation-of-module-visitor' into 'master'

improve the doc comment of ModuleVisitor

See merge request !7
parents b496aa7b 22b609f1
......@@ -27,14 +27,18 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.objectweb.asm;
/**
* A visitor to visit a Java module. The methods of this class must be called in
* the following order: <tt>visitVersion</tt> | <tt>visitMainClass</tt> |
* <tt>visitTargetPlatform</tt> | ( <tt>visitConcealedPackage</tt> | <tt>visitRequire</tt> |
* <tt>visitExport</tt> | <tt>visitUse</tt> | <tt>visitProvide</tt> )* <tt>visitEnd</tt>.
* the following order: <tt>visitMainClass</tt> | ( <tt>visitPackage</tt> |
* <tt>visitRequire</tt> | <tt>visitExport</tt> | <tt>visitOpen</tt> |
* <tt>visitUse</tt> | <tt>visitProvide</tt> )* <tt>visitEnd</tt>.
*
* The methods {@link #visitRequire(String, int, String)}, {@link #visitExport(String, int, String...)},
* {@link #visitOpen(String, int, String...)} and {@link #visitPackage(String)}
* take as parameter a package name or a module name. Unlike the other names which are internal names
* (names separated by slash), module and package names are qualified names (names separated by dot).
*
* @author Remi Forax
*/
......@@ -51,18 +55,23 @@ public abstract class ModuleVisitor {
*/
protected ModuleVisitor mv;
/**
* Constructs a new {@link ModuleVisitor}.
*
* @param api
* the ASM API version implemented by this visitor. Must be {@link Opcodes#ASM6}.
*/
public ModuleVisitor(final int api) {
this(api, null);
}
/**
* Constructs a new {@link MethodVisitor}.
* Constructs a new {@link ModuleVisitor}.
*
* @param api
* the ASM API version implemented by this visitor. Must be {@link Opcodes#ASM6}.
* @param mv
* the method visitor to which this visitor must delegate method
* the module visitor to which this visitor must delegate method
* calls. May be null.
*/
public ModuleVisitor(final int api, final ModuleVisitor mv) {
......@@ -76,7 +85,7 @@ public abstract class ModuleVisitor {
/**
* Visit the main class of the current module.
*
* @param mainClass the main class of the current module.
* @param mainClass the internal name of the main class of the current module.
*/
public void visitMainClass(String mainClass) {
if (mv != null) {
......@@ -85,9 +94,9 @@ public abstract class ModuleVisitor {
}
/**
* Visit a concealed package of the current module.
* Visit a package of the current module.
*
* @param packaze name of a concealed package
* @param packaze the qualified name of a package.
*/
public void visitPackage(String packaze) {
if (mv != null) {
......@@ -98,7 +107,7 @@ public abstract class ModuleVisitor {
/**
* Visits a dependence of the current module.
*
* @param module the module name of the dependence
* @param module the qualified name of the dependence.
* @param access the access flag of the dependence among
* ACC_TRANSITIVE, ACC_STATIC_PHASE, ACC_SYNTHETIC
* and ACC_MANDATED.
......@@ -113,11 +122,11 @@ public abstract class ModuleVisitor {
/**
* Visit an exported package of the current module.
*
* @param packaze the name of the exported package.
* @param packaze the qualified name of the exported package.
* @param access the access flag of the exported package,
* valid values are among {@code ACC_SYNTHETIC} and
* {@code ACC_MANDATED}.
* @param modules names of the modules that can access to
* @param modules the qualified names of the modules that can access to
* the public classes of the exported package or
* <tt>null</tt>.
*/
......@@ -130,11 +139,11 @@ public abstract class ModuleVisitor {
/**
* Visit an open package of the current module.
*
* @param packaze the name of the opened package.
* @param packaze the qualified name of the opened package.
* @param access the access flag of the opened package,
* valid values are among {@code ACC_SYNTHETIC} and
* {@code ACC_MANDATED}.
* @param modules names of the modules that can use deep
* @param modules the qualified names of the modules that can use deep
* reflection to the classes of the open package or
* <tt>null</tt>.
*/
......@@ -146,8 +155,7 @@ public abstract class ModuleVisitor {
/**
* Visit a service used by the current module.
* The name must be the name of an interface or an
* abstract class.
* The name must be the internal name of an interface or a class.
*
* @param service the internal name of the service.
*/
......@@ -170,6 +178,10 @@ public abstract class ModuleVisitor {
}
}
/**
* Visits the end of the module. This method, which is the last one to be
* called, is used to inform the visitor that everything have been visited.
*/
public void visitEnd() {
if (mv != null) {
mv.visitEnd();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment