net.sourceforge.esw.collection
Class URLQueryTransducer

java.lang.Object
  |
  +--net.sourceforge.esw.collection.ATransducer
        |
        +--net.sourceforge.esw.collection.URLQueryTransducer
All Implemented Interfaces:
ITransducer, java.io.Serializable

public class URLQueryTransducer
extends ATransducer
implements ITransducer

Performs Transduction between a URL Query data source and an IMetaCollection instance.

This transduction occurs both ways; put() takes data from the IMetaCollection instance to which this ITransducer instance is attached and places it into the data source represented by this ITransducer instance. The get() method takes data from the data source represented by this ITransducer instance and places it into the IMetaCollection instance to which this ITransducer instance is attached.

URL Query strings are in the form of ?name=value&name1=value1.... The name/value pairs are transduced from the URL into an IMetaCollection instance on a get method invocation, and are transduced from the IMetaCollection instance into a string starting with the '?' on a put method invocation.

Currently only get is implemented. We plan to have put implemented in a future release.

See Also:
IMetaCollection, Serialized Form

Field Summary
protected  java.lang.String query
          The URL to decant the name/value pairs from/to.
 
Fields inherited from class net.sourceforge.esw.collection.ATransducer
contextFactory
 
Constructor Summary
URLQueryTransducer()
           
 
Method Summary
 void get(IMetaCollection aCollection)
          Gets the data source's data represented by this ITransducer instance into the referenced IMetaCollection instance.
 java.lang.String getQuery()
          Returns the query String on which put was performed.
 void put(IMetaCollection aCollection)
          Puts the referenced IMetaCollection instance's data into the data source represented by this ITransducer instance.
 void setQuery(java.lang.String aQuery)
          Sets the query String on which to perform the get.
 
Methods inherited from class net.sourceforge.esw.collection.ATransducer
getContextFactory, setContextFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.esw.collection.ITransducer
getContextFactory, setContextFactory
 

Field Detail

query

protected java.lang.String query
The URL to decant the name/value pairs from/to.
Constructor Detail

URLQueryTransducer

public URLQueryTransducer()
Method Detail

put

public void put(IMetaCollection aCollection)
         throws TransducerException
Puts the referenced IMetaCollection instance's data into the data source represented by this ITransducer instance.

In this release, put is not implemented. It will throw a TransducerException if called.

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 )

get

public 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 )

setQuery

public void setQuery(java.lang.String aQuery)
Sets the query String on which to perform the get.
Parameters:
aQuery - the query to get.

getQuery

public java.lang.String getQuery()
Returns the query String on which put was performed.


Copyright 2002 Free Software Foundation. All Rights Reserved.