Top Description Inners Fields Constructors Methods
org.objectweb.asm.util

public Class CheckModuleAdapter

extends ModuleVisitor
Class Inheritance
Imports
java.util.HashSet, org.objectweb.asm.ModuleVisitor, .Opcodes

A ModuleVisitor that checks that its methods are properly used.
Author
Remi Forax

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv int
classVersion

The class version number.

private final CheckModuleAdapter.NameSet
exportedPackages

The internal names of the packages exported by the visited module.

private final boolean
isOpen

Whether the visited module is open.

private final CheckModuleAdapter.NameSet
openedPackages

The internal names of the packages opened by the visited module.

private final CheckModuleAdapter.NameSet
providedServices

The internal names of the services provided by the visited module.

private final CheckModuleAdapter.NameSet
requiredModules

The fully qualified names of the dependencies of the visited module.

private final CheckModuleAdapter.NameSet
usedServices

The internal names of the services used by the visited module.

private boolean
visitEndCalled

Whether the visitEnd method has been called.

Inherited from org.objectweb.asm.ModuleVisitor:
apimv

Constructor Summary

AccessConstructor and Description
public
CheckModuleAdapter(final ModuleVisitor
the module visitor to which this adapter must delegate calls.
moduleVisitor
,
final boolean
whether the visited module is open. Open modules have their Opcodes#ACC_OPEN access flag set in org.objectweb.asm.ClassVisitor#visitModule.
isOpen
)

Constructs a new CheckModuleAdapter.

protected
CheckModuleAdapter(final int
the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.
api
,
final ModuleVisitor
the module visitor to which this adapter must delegate calls.
moduleVisitor
,
final boolean
whether the visited module is open. Open modules have their Opcodes#ACC_OPEN access flag set in org.objectweb.asm.ClassVisitor#visitModule.
isOpen
)

Constructs a new CheckModuleAdapter.

Method Summary

Modifier and TypeMethod and Description
private void
public void
visitEnd()

Overrides org.objectweb.asm.ModuleVisitor.visitEnd.

Visits the end of the module.
public void
visitExport(final String
the internal name of the exported package (see Type#getInternalName()).
packaze
,
final int
the access flag of the exported package, valid values are among ACC_SYNTHETIC and ACC_MANDATED.
access
,
final String...
the fully qualified names (using dots) of the modules that can access the public classes of the exported package, or null.
modules
)

Overrides org.objectweb.asm.ModuleVisitor.visitExport.

Visit an exported package of the current module.
public void
visitMainClass(final String
the internal name of the main class of the current module (see Type#getInternalName()).
mainClass
)

Overrides org.objectweb.asm.ModuleVisitor.visitMainClass.

Visit the main class of the current module.
public void
visitOpen(final String
the internal name of the opened package (see Type#getInternalName()).
packaze
,
final int
the access flag of the opened package, valid values are among ACC_SYNTHETIC and ACC_MANDATED.
access
,
final String...
the fully qualified names (using dots) of the modules that can use deep reflection to the classes of the open package, or null.
modules
)

Overrides org.objectweb.asm.ModuleVisitor.visitOpen.

Visit an open package of the current module.
public void
visitPackage(final String
the internal name of a package (see Type#getInternalName()).
packaze
)

Overrides org.objectweb.asm.ModuleVisitor.visitPackage.

Visit a package of the current module.
public void
visitProvide(final String
the internal name of the service (see Type#getInternalName()).
service
,
final String...
the internal names (see Type#getInternalName()) of the implementations of the service (there is at least one provider).
providers
)

Overrides org.objectweb.asm.ModuleVisitor.visitProvide.

Visit an implementation of a service.
public void
visitRequire(final String
the fully qualified name (using dots) of the dependence.
module
,
final int
the access flag of the dependence among ACC_TRANSITIVE, ACC_STATIC_PHASE, ACC_SYNTHETIC and ACC_MANDATED.
access
,
final String
the module version at compile time, or null.
version
)

Overrides org.objectweb.asm.ModuleVisitor.visitRequire.

Visits a dependence of the current module.
public void
visitUse(final String
the internal name of the service (see Type#getInternalName()).
service
)

Overrides org.objectweb.asm.ModuleVisitor.visitUse.

Visit a service used by the current module.
Inherited from org.objectweb.asm.ModuleVisitor:
getDelegate

Field Detail

classVersionback to summary
pack-priv int classVersion

The class version number.

exportedPackagesback to summary
private final CheckModuleAdapter.NameSet exportedPackages

The internal names of the packages exported by the visited module.

isOpenback to summary
private final boolean isOpen

Whether the visited module is open.

openedPackagesback to summary
private final CheckModuleAdapter.NameSet openedPackages

The internal names of the packages opened by the visited module.

providedServicesback to summary
private final CheckModuleAdapter.NameSet providedServices

The internal names of the services provided by the visited module.

requiredModulesback to summary
private final CheckModuleAdapter.NameSet requiredModules

The fully qualified names of the dependencies of the visited module.

usedServicesback to summary
private final CheckModuleAdapter.NameSet usedServices

The internal names of the services used by the visited module.

visitEndCalledback to summary
private boolean visitEndCalled

Whether the visitEnd method has been called.

Constructor Detail

CheckModuleAdapterback to summary
public CheckModuleAdapter(final ModuleVisitor moduleVisitor, final boolean isOpen)

Constructs a new CheckModuleAdapter. Subclasses must not use this constructor. Instead, they must use the CheckModuleAdapter(int, ModuleVisitor, boolean) version.

Parameters
moduleVisitor:ModuleVisitor

the module visitor to which this adapter must delegate calls.

isOpen:boolean

whether the visited module is open. Open modules have their Opcodes#ACC_OPEN access flag set in org.objectweb.asm.ClassVisitor#visitModule.

Exceptions
IllegalStateException:
If a subclass calls this constructor.
CheckModuleAdapterback to summary
protected CheckModuleAdapter(final int api, final ModuleVisitor moduleVisitor, final boolean isOpen)

Constructs a new CheckModuleAdapter.

Parameters
api:int

the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.

moduleVisitor:ModuleVisitor

the module visitor to which this adapter must delegate calls.

isOpen:boolean

whether the visited module is open. Open modules have their Opcodes#ACC_OPEN access flag set in org.objectweb.asm.ClassVisitor#visitModule.

Method Detail

checkVisitEndNotCalledback to summary
private void checkVisitEndNotCalled()
visitEndback to summary
public void visitEnd()

Overrides org.objectweb.asm.ModuleVisitor.visitEnd.

Doc from org.objectweb.asm.ModuleVisitor.visitEnd.

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.

Annotations
@Override
visitExportback to summary
public void visitExport(final String packaze, final int access, final String... modules)

Overrides org.objectweb.asm.ModuleVisitor.visitExport.

Doc from org.objectweb.asm.ModuleVisitor.visitExport.

Visit an exported package of the current module.

Parameters
packaze:String

the internal name of the exported package (see Type#getInternalName()).

access:int

the access flag of the exported package, valid values are among ACC_SYNTHETIC and ACC_MANDATED.

modules:String[]

the fully qualified names (using dots) of the modules that can access the public classes of the exported package, or null.

Annotations
@Override
visitMainClassback to summary
public void visitMainClass(final String mainClass)

Overrides org.objectweb.asm.ModuleVisitor.visitMainClass.

Doc from org.objectweb.asm.ModuleVisitor.visitMainClass.

Visit the main class of the current module.

Parameters
mainClass:String

the internal name of the main class of the current module (see Type#getInternalName()).

Annotations
@Override
visitOpenback to summary
public void visitOpen(final String packaze, final int access, final String... modules)

Overrides org.objectweb.asm.ModuleVisitor.visitOpen.

Doc from org.objectweb.asm.ModuleVisitor.visitOpen.

Visit an open package of the current module.

Parameters
packaze:String

the internal name of the opened package (see Type#getInternalName()).

access:int

the access flag of the opened package, valid values are among ACC_SYNTHETIC and ACC_MANDATED.

modules:String[]

the fully qualified names (using dots) of the modules that can use deep reflection to the classes of the open package, or null.

Annotations
@Override
visitPackageback to summary
public void visitPackage(final String packaze)

Overrides org.objectweb.asm.ModuleVisitor.visitPackage.

Doc from org.objectweb.asm.ModuleVisitor.visitPackage.

Visit a package of the current module.

Parameters
packaze:String

the internal name of a package (see Type#getInternalName()).

Annotations
@Override
visitProvideback to summary
public void visitProvide(final String service, final String... providers)

Overrides org.objectweb.asm.ModuleVisitor.visitProvide.

Doc from org.objectweb.asm.ModuleVisitor.visitProvide.

Visit an implementation of a service.

Parameters
service:String

the internal name of the service (see Type#getInternalName()).

providers:String[]

the internal names (see Type#getInternalName()) of the implementations of the service (there is at least one provider).

Annotations
@Override
visitRequireback to summary
public void visitRequire(final String module, final int access, final String version)

Overrides org.objectweb.asm.ModuleVisitor.visitRequire.

Doc from org.objectweb.asm.ModuleVisitor.visitRequire.

Visits a dependence of the current module.

Parameters
module:String

the fully qualified name (using dots) of the dependence.

access:int

the access flag of the dependence among ACC_TRANSITIVE, ACC_STATIC_PHASE, ACC_SYNTHETIC and ACC_MANDATED.

version:String

the module version at compile time, or null.

Annotations
@Override
visitUseback to summary
public void visitUse(final String service)

Overrides org.objectweb.asm.ModuleVisitor.visitUse.

Doc from org.objectweb.asm.ModuleVisitor.visitUse.

Visit a service used by the current module. The name must be the internal name of an interface or a class.

Parameters
service:String

the internal name of the service (see Type#getInternalName()).

Annotations
@Override
org.objectweb.asm.util back to summary

private Class CheckModuleAdapter.NameSet

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final HashSet<String>
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
NameSet(final String type)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

namesback to summary
private final HashSet<String> names
typeback to summary
private final String type

Constructor Detail

NameSetback to summary
pack-priv NameSet(final String type)

Method Detail

checkNameNotAlreadyDeclaredback to summary
pack-priv void checkNameNotAlreadyDeclared(final String name)