Package org.apache.ws.jaxme.js.pattern

The pattern package

See:
          Description

Interface Summary
Reflector The Reflector obtains informations on a certain class by converting it into an instance of 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 ChainGenerator.
Ant.AntProxyGenerator The AntProxyGenerator is an Ant task providing access to the ProxyGenerator.
Ant.AntTypesafeEnumerationGenerator Ant task for generating typesafe enumerations.
Ant.AntVersionGenerator Ant task for the VersionGenerator
Ant.BasicAntTask  
Ant.ReallyBasicAntTask  
Ant.XmlRpcGenerator An ant task for the 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 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: If the interface being implemented is a compiled class, then Java reflection is used. Otherwise, if the interface being implemented is present as a Java source file, then the JavaParser is used.
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.
 

Package org.apache.ws.jaxme.js.pattern Description

The pattern package

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)ClassAnt taskDescription
Proxy objects
Multiple inheritance
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 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 MultipleInheritanceTest, where a subclass of Observable is created, that is also an instance of List by inheriting from ArrayList.
Typesafe enumerations 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 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.