Top Description Fields Constructors Methods
org.apache.bcel.verifier

public Class Verifier

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .List, .Map, org.apache.bcel.classfile.JavaClass, .Utility, org.apache.bcel.verifier.statics.Pass1Verifier, .Pass2Verifier, .Pass3aVerifier, org.apache.bcel.verifier.structurals.Pass3bVerifier, org.apache.commons.lang3.ArrayUtils

A Verifier instance is there to verify a class file according to The Java Virtual Machine Specification, 2nd Edition. Pass-3b-verification includes pass-3a-verification; pass-3a-verification includes pass-2-verification; pass-2-verification includes pass-1-verification. A Verifier creates PassVerifier instances to perform the actual verification. Verifier instances are usually generated by the VerifierFactory.
See Also
VerifierFactory, PassVerifier

Field Summary

Modifier and TypeField and Description
pack-priv static final String
private final String
className

The name of the class this verifier operates on.

pack-priv static final Verifier[]
pack-priv static final String
private Pass1Verifier
p1v

A Pass1Verifier for this Verifier instance.

private Pass2Verifier
p2v

A Pass2Verifier for this Verifier instance.

private final Map<String, Pass3aVerifier>
p3avs

The Pass3aVerifiers for this Verifier instance.

private final Map<String, Pass3bVerifier>
p3bvs

The Pass3bVerifiers for this Verifier instance.

Constructor Summary

AccessConstructor and Description
pack-priv
Verifier(final String fullyQualifiedClassName)

Instantiation is done by the VerifierFactory.

Method Summary

Modifier and TypeMethod and Description
public VerificationResult
doPass1()

Returns the VerificationResult for the given pass.

public VerificationResult
doPass2()

Returns the VerificationResult for the given pass.

public VerificationResult

Returns:

the VerificationResult
doPass3a
(final int
The method to verify
methodNo
)

Returns the VerificationResult for the given pass.

public VerificationResult

Returns:

the VerificationResult
doPass3b
(final int
The method to verify
methodNo
)

Returns the VerificationResult for the given pass.

public void
flush()

Forget everything known about the class file; that means, really start a new verification of a possibly different class file from BCEL's repository.

public final String
getClassName()

Returns the name of the class this verifier operates on.

public String[]
getMessages()

This returns all the (warning) messages collected during verification.

public static void
main(final String[] args)

Verifies class files.

pack-priv static void
verifyType(final String fullyQualifiedClassName)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classNameback to summary
private final String className

The name of the class this verifier operates on.

EMPTY_ARRAYback to summary
pack-priv static final Verifier[] EMPTY_ARRAY
NAMEback to summary
pack-priv static final String NAME
p1vback to summary
private Pass1Verifier p1v

A Pass1Verifier for this Verifier instance.

p2vback to summary
private Pass2Verifier p2v

Deprecated

as a consequence of Pass2Verifier being deprecated. See corresponding docs for further information.

A Pass2Verifier for this Verifier instance.

p3avsback to summary
private final Map<String, Pass3aVerifier> p3avs

The Pass3aVerifiers for this Verifier instance. Key: Interned string specifying the method number.

p3bvsback to summary
private final Map<String, Pass3bVerifier> p3bvs

The Pass3bVerifiers for this Verifier instance. Key: Interned string specifying the method number.

Constructor Detail

Verifierback to summary
pack-priv Verifier(final String fullyQualifiedClassName)

Instantiation is done by the VerifierFactory.

See Also
VerifierFactory

Method Detail

doPass1back to summary
public VerificationResult doPass1()

Returns the VerificationResult for the given pass.

doPass2back to summary
public VerificationResult doPass2()

Returns the VerificationResult for the given pass.

doPass3aback to summary
public VerificationResult doPass3a(final int methodNo)

Returns the VerificationResult for the given pass.

Parameters
methodNo:int

The method to verify

Returns:VerificationResult

the VerificationResult

doPass3bback to summary
public VerificationResult doPass3b(final int methodNo)

Returns the VerificationResult for the given pass.

Parameters
methodNo:int

The method to verify

Returns:VerificationResult

the VerificationResult

flushback to summary
public void flush()

Forget everything known about the class file; that means, really start a new verification of a possibly different class file from BCEL's repository.

getClassNameback to summary
public final String getClassName()

Returns the name of the class this verifier operates on. This is particularly interesting when this verifier was created recursively by another Verifier and you got a reference to this Verifier by the getVerifiers() method of the VerifierFactory.

See Also
VerifierFactory
getMessagesback to summary
public String[] getMessages() throws ClassNotFoundException

This returns all the (warning) messages collected during verification. A prefix shows from which verifying pass a message originates.

Exceptions
ClassNotFoundException:
if this class can't be found.
mainback to summary
public static void main(final String[] args)

Verifies class files. This is a simple demonstration of how the API of BCEL's class file verifier "JustIce" may be used. You should supply command-line arguments which are fully qualified namea of the classes to verify. These class files must be somewhere in your CLASSPATH (refer to Sun's documentation for questions about this) or you must have put the classes into the BCEL Repository yourself (via 'addClass(JavaClass)').

verifyTypeback to summary
pack-priv static void verifyType(final String fullyQualifiedClassName) throws ClassNotFoundException