Methods Summary |
---|
public static void | attach(VerifierFactoryObserver o)Adds the VerifierFactoryObserver o to the list of observers.
observers.addElement(o);
|
public static void | detach(VerifierFactoryObserver o)Removes the VerifierFactoryObserver o from the list of observers.
observers.removeElement(o);
|
public static Verifier | getVerifier(java.lang.String fully_qualified_classname)Returns the (only) verifier responsible for the class with the given name.
Possibly a new Verifier object is transparently created.
fully_qualified_classname = fully_qualified_classname;
Verifier v = (Verifier) (hashMap.get(fully_qualified_classname));
if (v==null){
v = new Verifier(fully_qualified_classname);
hashMap.put(fully_qualified_classname, v);
notify(fully_qualified_classname);
}
return v;
|
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.
Verifier[] vs = new Verifier[hashMap.values().size()];
return (Verifier[]) (hashMap.values().toArray(vs)); // Because vs is big enough, vs is used to store the values into and returned!
|
private static void | notify(java.lang.String fully_qualified_classname)Notifies the observers of a newly generated Verifier.
// notify the observers
Iterator i = observers.iterator();
while (i.hasNext()){
VerifierFactoryObserver vfo = (VerifierFactoryObserver) i.next();
vfo.update(fully_qualified_classname);
}
|