org.apache.bcel.verifier

Class VerifierFactory

public class VerifierFactory extends Object

This class produces instances of the Verifier class. Its purpose is to make sure that they are singleton instances with respect to the class name they operate on. That means, for every class (represented by a unique fully qualified class name) there is exactly one Verifier.

Version: $Id: VerifierFactory.java 386056 2006-03-15 11:31:56Z tcurdt $

Author: Enver Haase

See Also: Verifier

Field Summary
static MaphashMap
The HashMap that holds the data about the already-constructed Verifier instances.
static Listobservers
The VerifierFactoryObserver instances that observe the VerifierFactory.
Constructor Summary
VerifierFactory()
The VerifierFactory is not instantiable.
Method Summary
static voidattach(VerifierFactoryObserver o)
Adds the VerifierFactoryObserver o to the list of observers.
static voiddetach(VerifierFactoryObserver o)
Removes the VerifierFactoryObserver o from the list of observers.
static VerifiergetVerifier(String fully_qualified_classname)
Returns the (only) verifier responsible for the class with the given name.
static Verifier[]getVerifiers()
Returns all Verifier instances created so far.
static voidnotify(String fully_qualified_classname)
Notifies the observers of a newly generated Verifier.

Field Detail

hashMap

private static Map hashMap
The HashMap that holds the data about the already-constructed Verifier instances.

observers

private static List observers
The VerifierFactoryObserver instances that observe the VerifierFactory.

Constructor Detail

VerifierFactory

private VerifierFactory()
The VerifierFactory is not instantiable.

Method Detail

attach

public static void attach(VerifierFactoryObserver o)
Adds the VerifierFactoryObserver o to the list of observers.

detach

public static void detach(VerifierFactoryObserver o)
Removes the VerifierFactoryObserver o from the list of observers.

getVerifier

public static Verifier getVerifier(String fully_qualified_classname)
Returns the (only) verifier responsible for the class with the given name. Possibly a new Verifier object is transparently created.

Returns: the (only) verifier responsible for the class with the given name.

getVerifiers

public static Verifier[] getVerifiers()
Returns all Verifier instances created so far. This is useful when a Verifier recursively lets the VerifierFactory create other Verifier instances and if you want to verify the transitive hull of referenced class files.

notify

private static void notify(String fully_qualified_classname)
Notifies the observers of a newly generated Verifier.