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

public Class VerifierFactory

extends Object
Class Inheritance
Imports
java.util.HashMap, .List, .Map, .Vector

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.
See Also
Verifier

Field Summary

Modifier and TypeField and Description
private static final Map<String, Verifier>
MAP

The HashMap that holds the data about the already-constructed Verifier instances.

private static final List<VerifierFactoryObserver>
OBSVERVERS

The VerifierFactoryObserver instances that observe the VerifierFactory.

Constructor Summary

AccessConstructor and Description
private
VerifierFactory()

The VerifierFactory is not instantiable.

Method Summary

Modifier and TypeMethod and Description
public static void
attach(final VerifierFactoryObserver o)

Adds the VerifierFactoryObserver o to the list of observers.

public static void
clear()

Clears the factory.

public static void
detach(final VerifierFactoryObserver o)

Removes the VerifierFactoryObserver o from the list of observers.

public static Verifier

Returns:

the (only) verifier responsible for the class with the given name.
getVerifier
(final String fullyQualifiedClassName)

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

public static Verifier[]
getVerifiers()

Returns all Verifier instances created so far.

private static void
notify(final String fullyQualifiedClassName)

Notifies the observers of a newly generated Verifier.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MAPback to summary
private static final Map<String, Verifier> MAP

The HashMap that holds the data about the already-constructed Verifier instances.

OBSVERVERSback to summary
private static final List<VerifierFactoryObserver> OBSVERVERS

The VerifierFactoryObserver instances that observe the VerifierFactory.

Constructor Detail

VerifierFactoryback to summary
private VerifierFactory()

The VerifierFactory is not instantiable.

Method Detail

attachback to summary
public static void attach(final VerifierFactoryObserver o)

Adds the VerifierFactoryObserver o to the list of observers.

clearback to summary
public static void clear()

Clears the factory.

Since
6.6.2
detachback to summary
public static void detach(final VerifierFactoryObserver o)

Removes the VerifierFactoryObserver o from the list of observers.

getVerifierback to summary
public static Verifier getVerifier(final String fullyQualifiedClassName)

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

Returns:Verifier

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

getVerifiersback to summary
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.

notifyback to summary
private static void notify(final String fullyQualifiedClassName)

Notifies the observers of a newly generated Verifier.