BCEL's class file verifier "JustIce"

de.fub.bytecode.verifier
Class Verifier

java.lang.Object
  |
  +--de.fub.bytecode.verifier.Verifier

public class Verifier
extends java.lang.Object

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.

Version:
$Id: Verifier.java,v 1.48 2001/09/12 15:04:32 ehaase Exp $
Author:
Enver Haase
See Also:
PassVerifier

Method Summary
 VerificationResult doPass1()
          Returns the VerificationResult for the given pass.
 VerificationResult doPass2()
          Returns the VerificationResult for the given pass.
 VerificationResult doPass3a(int method_no)
          Returns the VerificationResult for the given pass.
 VerificationResult doPass3b(int method_no)
          Returns the VerificationResult for the given pass.
 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.
 java.lang.String getClassName()
          Returns the name of the class this verifier operates on.
 java.lang.String[] getMessages()
          This returns all the (warning) messages collected during verification.
static void main(java.lang.String[] args)
          Verifies class files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doPass1

public VerificationResult doPass1()
Returns the VerificationResult for the given pass.

doPass2

public VerificationResult doPass2()
Returns the VerificationResult for the given pass.

doPass3a

public VerificationResult doPass3a(int method_no)
Returns the VerificationResult for the given pass.

doPass3b

public VerificationResult doPass3b(int method_no)
Returns the VerificationResult for the given pass.

getClassName

public final java.lang.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

flush

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.

getMessages

public java.lang.String[] getMessages()
This returns all the (warning) messages collected during verification. A prefix shows from which verifying pass a message originates.

main

public static void main(java.lang.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)').

(c) Enver Haase 2001, released under the FSF's "GPL version 2" license.