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

public abstract Class PassVerifier

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.bcel.verifier.statics.Pass1Verifier, org.apache.bcel.verifier.statics.Pass2Verifier, org.apache.bcel.verifier.statics.Pass3aVerifier, org.apache.bcel.verifier.structurals.Pass3bVerifier
Imports
java.util.ArrayList, .List, org.apache.commons.lang3.ArrayUtils

A PassVerifier actually verifies a class file; it is instantiated by a Verifier. The verification should conform with a certain pass as described in The Java Virtual Machine Specification, 2nd edition. This book describes four passes. Pass one means loading the class and verifying a few static constraints. Pass two actually verifies some other constraints that could enforce loading in referenced class files. Pass three is the first pass that actually checks constraints in the code array of a method in the class file; it has two parts with the first verifying static constraints and the second part verifying structural constraints (where a data flow analysis is used for). The fourth pass, finally, performs checks that can only be done at run-time. JustIce does not have a run-time pass, but certain constraints that are usually delayed until run-time for performance reasons are also checked during the second part of pass three. PassVerifier instances perform caching. That means, if you really want a new verification run of a certain pass you must use a new instance of a given PassVerifier.
See Also
Verifier, verify()

Field Summary

Modifier and TypeField and Description
private final List<String>
messages

The (warning) messages.

private VerificationResult
verificationResult

The VerificationResult cache.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addMessage(final String
message to be appended to the message list.
message
)

This method adds a (warning) message to the message pool of this PassVerifier.

public abstract VerificationResult

Returns:

The VerificationResult
do_verify
()

Verifies, not cached.

public String[]

Returns:

the (warning) messages.
getMessages
()

Returns the (warning) messages that this PassVerifier accumulated during its do_verify()ing work.

public List<String>
getMessagesList()

Returns the (warning) messages that this PassVerifier accumulated during its do_verify()ing work.

public VerificationResult

Returns:

a VerificationResult.
verify
()

This method runs a verification pass conforming to the Java Virtual Machine Specification, 2nd edition, on a class file.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

messagesback to summary
private final List<String> messages

The (warning) messages.

verificationResultback to summary
private VerificationResult verificationResult

The VerificationResult cache.

Constructor Detail

PassVerifierback to summary
public PassVerifier()

Method Detail

addMessageback to summary
public void addMessage(final String message)

This method adds a (warning) message to the message pool of this PassVerifier. This method is normally only internally used by BCEL's class file verifier "JustIce" and should not be used from the outside.

Parameters
message:String

message to be appended to the message list.

See Also
getMessages()
do_verifyback to summary
public abstract VerificationResult do_verify()

Verifies, not cached.

Returns:VerificationResult

The VerificationResult

getMessagesback to summary
public String[] getMessages()

Returns the (warning) messages that this PassVerifier accumulated during its do_verify()ing work.

Returns:String[]

the (warning) messages.

See Also
addMessage(String), do_verify()
getMessagesListback to summary
public List<String> getMessagesList()

Returns the (warning) messages that this PassVerifier accumulated during its do_verify()ing work.

See Also
addMessage(String), do_verify()
verifyback to summary
public VerificationResult verify()

This method runs a verification pass conforming to the Java Virtual Machine Specification, 2nd edition, on a class file. PassVerifier instances perform caching; i.e. if the verify() method once determined a VerificationResult, then this result may be returned after every invocation of this method instead of running the verification pass anew; likewise with the result of getMessages().

Returns:VerificationResult

a VerificationResult.

See Also
getMessages(), addMessage(String)