net.sourceforge.esw.collection
Class ATransducerAdapter

java.lang.Object
  |
  +--net.sourceforge.esw.collection.ATransducerAdapter
All Implemented Interfaces:
ITransducer, java.io.Serializable
Direct Known Subclasses:
FileTransducerAdapter, StringTransducerAdapter, URLTransducerAdapter

public abstract class ATransducerAdapter
extends java.lang.Object
implements ITransducer

Provides abstract base class abilities for Transducer Adapters.

ATransducerAdapter extenders should focus on the implementation of the specific element they are adapting. This base class encapsulates all the required methods and attributes.

All ATransducerAdapter instances delelate their get and put methods to a previously set IIOTransducer instance. They also delegate the setContextFactory and getContextFactory method invocations to the contained IIOTransducer instance.

See Also:
Serialized Form

Field Summary
protected  IIOTransducer ioTransducer
          The IIOTransducer instance to which ITransducer implemented method invocations are delegated.
 
Constructor Summary
ATransducerAdapter()
          Creates a new ATransducerAdapter instance.
ATransducerAdapter(IIOTransducer aIIOTransducer)
          Creates a new ATransducerAdapter instance, delegating ITransducer implemented method invocations to the specified IIOTransducer instance.
 
Method Summary
abstract  void get(IMetaCollection aCollection)
          Gets the data source's data represented by this ITransducer instance into the referenced IMetaCollection instance.
 INodeContextFactory getContextFactory()
          Returns the INodeContextFactory instance used by this ITransducer instance during get operations.
 IIOTransducer getIOTranducer()
          Returns the IIOTransducer instance for this ATransducerAdapter instance.
abstract  void put(IMetaCollection aCollection)
          Puts the referenced IMetaCollection instance's data into the data source represented by this ITransducer instance.
 void setContextFactory(INodeContextFactory aContextFactory)
          Sets the INodeContextFactory instance to be used by this ITransducer instance during get operations.
 void setIOTransducer(IIOTransducer aIIOTransducer)
          Sets the IIOTransducer instance to which ITransducer implemented method invocations are delegated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ioTransducer

protected IIOTransducer ioTransducer
The IIOTransducer instance to which ITransducer implemented method invocations are delegated.
Constructor Detail

ATransducerAdapter

public ATransducerAdapter()
Creates a new ATransducerAdapter instance.

ATransducerAdapter

public ATransducerAdapter(IIOTransducer aIIOTransducer)
Creates a new ATransducerAdapter instance, delegating ITransducer implemented method invocations to the specified IIOTransducer instance.
Parameters:
aIIOTransducer - the IIOTransducer instance to which to delegate.
Method Detail

setIOTransducer

public void setIOTransducer(IIOTransducer aIIOTransducer)
Sets the IIOTransducer instance to which ITransducer implemented method invocations are delegated.
Parameters:
aIIOTransducer - the IIOTransducer instance to which to delegate.

getIOTranducer

public IIOTransducer getIOTranducer()
Returns the IIOTransducer instance for this ATransducerAdapter instance.

setContextFactory

public void setContextFactory(INodeContextFactory aContextFactory)
Sets the INodeContextFactory instance to be used by this ITransducer instance during get operations. Before this method is invoked, an IIOTransducer instance must be set on this ATransducerAdapter instance via the setIOTransducer method.
Specified by:
setContextFactory in interface ITransducer
Parameters:
aContextFactory - the INodeContextFactory instance from which to take data.
Throws:
java.lang.RuntimeException - if the IIOTransducer instance has not been set on this ATransducerAdapter instance.
See Also:
getContextFactory()

getContextFactory

public INodeContextFactory getContextFactory()
Returns the INodeContextFactory instance used by this ITransducer instance during get operations.
Specified by:
getContextFactory in interface ITransducer
Returns:
the INodeContextFactory instance utilitied by this ITransducer instance.
See Also:
setContextFactory( INodeContextFactory )

get

public abstract void get(IMetaCollection aCollection)
                  throws TransducerException
Gets the data source's data represented by this ITransducer instance into the referenced IMetaCollection instance.
Specified by:
get in interface ITransducer
Parameters:
aCollection - the IMetaCollection instance into which to read.
Throws:
TransducerException - if an error occurs during transduction.
See Also:
put( IMetaCollection )

put

public abstract void put(IMetaCollection aCollection)
                  throws TransducerException
Puts the referenced IMetaCollection instance's data into the data source represented by this ITransducer instance.
Specified by:
put in interface ITransducer
Parameters:
aCollection - the IMetaCollection instance from which to take data.
Throws:
TransducerException - if an error occurs during transduction.
See Also:
get( IMetaCollection )


Copyright 2002 Free Software Foundation. All Rights Reserved.