| java.lang.Object net.sourceforge.groboutils.autodoc.v1.AutoDoc
All known Subclasses: net.sourceforge.groboutils.autodoc.v1.MockAutoDoc,
AutoDoc | public class AutoDoc (Code) | | Entry class for loading the AutoDoc pieces for a particular class. As
this class is always instantiated, it does not need an interface. This
acts as a central factory for generating all the AutoDoc instances.
This default implementation uses a static factory to load each instance's
data. That factory may be set by a using class. Since initialization of
the inner data is lazy-loaded (only loaded when needed, but when needed it
is all loaded), the factory may be set at any time after construction, and
before a data access member function is called. If no factory is ever
specified, it will load the factory from the fully-qualified class name
in the value of the System property specified by the key given by
FACTORY_PROPERTY_NAME.
This class follows a combination of the Abstract Factory and Proxy patterns.
AutoDoc acts as a Proxy for an Abstract Factory, allowing the particular
implemented factory to be hidden from the user. However, a "hole" is open
to each instance with the method setFactory(), allowing the owner
to setup the factory to their needs.
NOTE: need to update the documentation. I've since replaced the single
factory with an SPI fleet. The proxied objects are delegators to collections
of sub-proxies, which are loaded as late as possible.
author: Matt Albrecht groboclown@users.sourceforge.net version: $Date: 2003/02/10 22:52:11 $ since: March 16, 2002 |
Constructor Summary | |
public | AutoDoc(Class c) Base constructor. |
AutoDoc | public AutoDoc(Class c)(Code) | | Base constructor. Pass in the Class instance which will AutoDoc itself.
Parameters: c - the class which will be AutoDoced. exception: IllegalArgumentException - if the passed-in class isnull. |
addFactory | protected void addFactory(AutoDocFactory adf)(Code) | | Sets the AutoDoc factory instance. If this method is never invoked, then
the default static store will be used instead.
The standard factory/singleton pattern used in this framework normally
does not allow direct setting of the framework for an instance, but
rather for the classloader's class. Since AutoDoc (or a subclass)
is directly instantiated as a central processing point, opening a
"hole" into the class allows for an easier method to setup a particular
AutoDoc style. However, this is not the "recommended" usage, since,
in general, AutoDoc instances are instantiated independently throughout
many different classes, causing independent factory setting to be
more difficult.
Parameters: adf - the new factory to assign. exception: IllegalArgumentException - if adf is null. exception: IllegalStateException - if the inner factory has already beenassigned. This usually indicates that all the objects have alreadybeen loaded. |
checkLoad | final protected void checkLoad()(Code) | | Check if the data instances have been loaded. If they have not, then
load the instances, and ensure initialization is not performed again.
This lazy-loading is thread-safe.
|
cleanUpFactories | protected void cleanUpFactories()(Code) | | After loading the instances, we have no need to keep the memory
of the original factories around - they may pollute our loaded
proxied objects anyway. But since we've loaded, we don't want
to allow another load. So keep the vector, but clean it out.
|
getFactories | protected AutoDocFactory[] getFactories()(Code) | | Returns the factory this implementation knows. By default, this is the
static factory instance. This is only called at AutoDoc creation time.
This is not static, because subclasses may need to re-implement this
method. The factory may be changed through invocation of
setFactory( AutoDocFactory ).
the inner factory, or the static singleton if it was neverassigned. |
getFactoryStore | public static SPISingletonStore getFactoryStore()(Code) | | Retrieve the AutoDocFactory singleton store for setting up the factory
to be used for all uninitialized or uncreated AutoDoc instances.
|
getIT | public AutoDocIT getIT()(Code) | | Get the Issue Tracker implementation. Each call will return the
same object.
the Issue Tracker for the owning class. |
getLog | public AutoDocLog getLog()(Code) | | Get the log implementation. Each call will return the same object.
the log for the owning class. |
getOwner | final protected Class getOwner()(Code) | | Retrieves the owning class. Will never return null.
the class which is being AutoDoced. |
getTP | public AutoDocTP getTP()(Code) | | Get the Test Procedure Marker implementation. Each call will return
the same object.
|
loadFromFactory | protected void loadFromFactory(AutoDocFactory adf)(Code) | | Adds to all inner instances from the given factory.
|
loadInstances | protected void loadInstances()(Code) | | Loads all class
|
|
|