Class VerifierFactory


  • public class VerifierFactory
    extends java.lang.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.
    See Also:
    Verifier
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Map<java.lang.String,​Verifier> hashMap
      The HashMap that holds the data about the already-constructed Verifier instances.
      private static java.util.List<VerifierFactoryObserver> observers
      The VerifierFactoryObserver instances that observe the VerifierFactory.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private VerifierFactory()
      The VerifierFactory is not instantiable.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void attach​(VerifierFactoryObserver o)
      Adds the VerifierFactoryObserver o to the list of observers.
      static void detach​(VerifierFactoryObserver o)
      Removes the VerifierFactoryObserver o from the list of observers.
      static Verifier getVerifier​(java.lang.String fullyQualifiedClassName)
      Returns the (only) verifier responsible for the class with the given name.
      static Verifier[] getVerifiers()
      Returns all Verifier instances created so far.
      private static void notify​(java.lang.String fullyQualifiedClassName)
      Notifies the observers of a newly generated Verifier.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • hashMap

        private static final java.util.Map<java.lang.String,​Verifier> hashMap
        The HashMap that holds the data about the already-constructed Verifier instances.
      • observers

        private static final java.util.List<VerifierFactoryObserver> observers
        The VerifierFactoryObserver instances that observe the VerifierFactory.
    • Constructor Detail

      • VerifierFactory

        private VerifierFactory()
        The VerifierFactory is not instantiable.
    • Method Detail

      • getVerifier

        public static Verifier getVerifier​(java.lang.String fullyQualifiedClassName)
        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.
      • notify

        private static void notify​(java.lang.String fullyQualifiedClassName)
        Notifies the observers of a newly generated Verifier.
      • 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.
      • 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.