Package org.apache.bcel.verifier
Class Verifier
- java.lang.Object
-
- org.apache.bcel.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. Verifier instances are usually generated by the VerifierFactory.- See Also:
VerifierFactory
,PassVerifier
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
BANNER
private java.lang.String
className
The name of the class this verifier operates on.(package private) static Verifier[]
EMPTY_ARRAY
(package private) static java.lang.String
NAME
private Pass1Verifier
p1v
A Pass1Verifier for this Verifier instance.private Pass2Verifier
p2v
A Pass2Verifier for this Verifier instance.private java.util.Map<java.lang.String,Pass3aVerifier>
p3avs
The Pass3aVerifiers for this Verifier instance.private java.util.Map<java.lang.String,Pass3bVerifier>
p3bvs
The Pass3bVerifiers for this Verifier instance.
-
Constructor Summary
Constructors Constructor Description Verifier(java.lang.String fullyQualifiedClassName)
Instantiation is done by the VerifierFactory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VerificationResult
doPass1()
Returns the VerificationResult for the given pass.VerificationResult
doPass2()
Returns the VerificationResult for the given pass.VerificationResult
doPass3a(int methodNo)
Returns the VerificationResult for the given pass.VerificationResult
doPass3b(int methodNo)
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.(package private) static void
verifyType(java.lang.String fullyQualifiedClassName)
-
-
-
Field Detail
-
NAME
static final java.lang.String NAME
- See Also:
- Constant Field Values
-
BANNER
static final java.lang.String BANNER
- See Also:
- Constant Field Values
-
EMPTY_ARRAY
static final Verifier[] EMPTY_ARRAY
-
className
private final java.lang.String className
The name of the class this verifier operates on.
-
p1v
private Pass1Verifier p1v
A Pass1Verifier for this Verifier instance.
-
p2v
private Pass2Verifier p2v
A Pass2Verifier for this Verifier instance.
-
p3avs
private final java.util.Map<java.lang.String,Pass3aVerifier> p3avs
The Pass3aVerifiers for this Verifier instance. Key: Interned string specifying the method number.
-
p3bvs
private final java.util.Map<java.lang.String,Pass3bVerifier> p3bvs
The Pass3bVerifiers for this Verifier instance. Key: Interned string specifying the method number.
-
-
Constructor Detail
-
Verifier
Verifier(java.lang.String fullyQualifiedClassName)
Instantiation is done by the VerifierFactory.- See Also:
VerifierFactory
-
-
Method Detail
-
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)').
-
verifyType
static void verifyType(java.lang.String fullyQualifiedClassName) throws java.lang.ClassNotFoundException
- Throws:
java.lang.ClassNotFoundException
-
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 methodNo)
Returns the VerificationResult for the given pass.- Parameters:
methodNo
- The method to verify- Returns:
- the VerificationResult
-
doPass3b
public VerificationResult doPass3b(int methodNo)
Returns the VerificationResult for the given pass.- Parameters:
methodNo
- The method to verify- Returns:
- the VerificationResult
-
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.
-
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
-
getMessages
public java.lang.String[] getMessages() throws java.lang.ClassNotFoundException
This returns all the (warning) messages collected during verification. A prefix shows from which verifying pass a message originates.- Throws:
java.lang.ClassNotFoundException
- if this class can't be found.
-
-