This package contains a set of design patterns implemented with the JaxMe JavaSource generator framework.
See: Description
Interface Summary | |
---|---|
Reflector | The Reflector obtains informations on a certain
class by converting it into an instance of {@link JavaSource}. |
VersionGenerator.ColumnUpdater | The ColumnUpdater is able to update one or more columns in a table. |
Class Summary | |
---|---|
Ant | A set of Ant tasks for running the generators in the pattern package. |
Ant.AntChainGenerator | Ant task for the {@link org.apache.ws.jaxme.js.pattern.ChainGenerator}. |
Ant.AntProxyGenerator | The AntProxyGenerator is an Ant task
providing access to the {@link ProxyGenerator}. |
Ant.AntTypesafeEnumerationGenerator | Ant task for generating typesafe enumerations. |
Ant.AntVersionGenerator | Ant task for the {@link org.apache.ws.jaxme.js.pattern.VersionGenerator} |
Ant.BasicAntTask | |
Ant.ReallyBasicAntTask | |
Ant.XmlRpcGenerator | An ant task for the {@link org.apache.ws.jaxme.js.apps.XmlRpcClientGenerator}. |
Ant.XmlRpcGenerator.Dispatcher | The nested child element "dispatcher". |
ChainGenerator | This class generates so-called event chains. |
CompiledClassReflector | Reflector for gathering information on a compiled class. |
InterfaceDescription | The InterfaceDescription is used by the
{@link ProxyGenerator} as information storage about
the interfaces being implemented.The main purporse of an intermediate class is to encapsulate the way, how information about these classes is gathered:
|
MethodKey | This class is a key for generated methods. |
ProxyGenerator | This class is a generator for the proxy object pattern. |
SourceReflector | Reflector for gathering information about a Java source file. |
TypesafeEnumerationGenerator | This class is a generator for the typesafe enumeration pattern. |
TypesafeEnumerationGenerator.Item | |
VersionGenerator | The VersionGenerator is able to clone a version of a row in a database. |
VersionGenerator.TableInfo | This class is used internally to maintain the informations on the tables being cloned. |
This package contains a set of design patterns implemented with the JaxMe JavaSource generator framework. It is provided both for demonstration and actual use. Each pattern is accompanied with a corresponding Ant task that allows to invoke the respective generator from within an Ant build script. The patterns are:
Design pattern(s) | Class | Ant task | Description |
---|---|---|---|
Proxy objects Multiple inheritance |
{@link org.apache.ws.jaxme.js.pattern.ProxyGenerator} | proxyGenerator | Proxy are instances that delegate most or all method calls to another
object. Proxy objects in Java are typically created by the class
{@link java.lang.reflect.Proxy}. Compared to this class, the generator
has the advantage, that it is much easier to adapt the proxy object
to your own needs: In our case you simple subclass the generated
Proxy class. Proxy objects can also be used to implement something like multiple inheritance. This is demonstrated in the Unit test {@link org.apache.ws.jaxme.js.junit.MultipleInheritanceTest}, where a subclass of {@link java.util.Observable} is created, that is also an instance of {@link java.util.List} by inheriting from {@link java.util.ArrayList}. |
Typesafe enumerations | {@link org.apache.ws.jaxme.js.pattern.TypesafeEnumerationGenerator} | enumGenerator | A typesafe enumeration is a Java class that guarantees that only a specified set of instances can exist. These instances are part of the class and accessible through public, static, final fields. |
Proxy chains | {@link org.apache.ws.jaxme.js.pattern.ChainGenerator} | chainGenerator | A proxy chain can be viewed as a set of event handlers implementing a common interface. The interface methods are the events being processed. Each element in the chain can decide to process an event alone (by returning immediately), to delegate the event to the next element in the chain (by calling the interface method in its superclass) or to post process the result of the delegated event. |