net.sourceforge.groboutils.autodoc.v1
Test Self-Documentation aid classes.
Overview
This package contains a bootstrap class (AutoDoc), and the interfaces that it
delivers.
Other classes use this package by creating an instance of the AutoDoc class on
a per-class basis. This AutoDoc instance then returns to the using
class-specific instances for the owning class' Self-Documentation needs.
Generating Implementations of the AutoDoc Framework
This framework makes it easy to create your own implementation for each
part. Here's how the framework loads in the classes.
The AutoDoc class
The AutoDoc class loads an instance of the AutoDocFactory interface.
It first checks the system property
"net.sourceforge.groboutils.autodoc.AutoDocFactory.implementation".
The value which this is set to will be the fully-qualified class name to create
as the factory (an instance of AutoDocFactory). If that is not set,
then it defaults to
net.sourceforge.groboutils.autodoc.defimpl.DefaultAutoDocFactory.
Then, AutoDoc requests for a new instance of each entry-point interface
from the loaded factory.
As an implementation creator, you could create your own AutoDocFactory
instance, and set the system property to point to your own. Or, you could leave
the DefaultAutoDocFactory, and depend upon it to load your specific
entry-point factory.
The DefaultAutoDocFactory loads entry-point factories in a similar
fashion to how AutoDoc loads its factory: through the system
properties. It uses for the implementation class name the fully-qualified
class name specified in the system property of the form "factory interface
fully-qualified class name.implementation ". If the property
isn't set, it uses the default implementation.
ToDo
-
Right now, there can be only one factory for each section system-wide.
This should be modified to allow for a hierarchy much like log4j allows,
where the owning class can have its own factory set, or its package,
or each package component, or finally it defaults to the system-wide
setting (and if that isn't defined, then the default framework setting).
Alternatively, it could load a property file from each of these
namespaces. I'll leave that as a AutoDoc factory specific type to be
created in the future.
|