org.apache.tapestry.util.io
Class StringAdaptor

java.lang.Object
  extended byorg.apache.tapestry.util.io.StringAdaptor
All Implemented Interfaces:
SqueezeAdaptor

public class StringAdaptor
extends java.lang.Object
implements SqueezeAdaptor

Squeezes a String (which is pretty simple, most of the time).

Author:
Howard Lewis Ship

Constructor Summary
StringAdaptor()
           
 
Method Summary
 java.lang.Class getDataClass()
          Returns the class (or interface) which can be encoded by this adaptor.
 java.lang.String getPrefix()
          Returns one or more characters, each of which will be a prefix for this adaptor.
 java.lang.String squeeze(DataSqueezer squeezer, java.lang.Object data)
          Converts the data object into a String.
 java.lang.Object unsqueeze(DataSqueezer squeezer, java.lang.String string)
          Strips the prefix from the string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringAdaptor

public StringAdaptor()
Method Detail

getPrefix

public java.lang.String getPrefix()
Description copied from interface: SqueezeAdaptor
Returns one or more characters, each of which will be a prefix for this adaptor.

Specified by:
getPrefix in interface SqueezeAdaptor

getDataClass

public java.lang.Class getDataClass()
Description copied from interface: SqueezeAdaptor
Returns the class (or interface) which can be encoded by this adaptor.

Specified by:
getDataClass in interface SqueezeAdaptor

squeeze

public java.lang.String squeeze(DataSqueezer squeezer,
                                java.lang.Object data)
Description copied from interface: SqueezeAdaptor
Converts the data object into a String.

Specified by:
squeeze in interface SqueezeAdaptor

unsqueeze

public java.lang.Object unsqueeze(DataSqueezer squeezer,
                                  java.lang.String string)
Strips the prefix from the string. This method is only invoked by the DataSqueezerImpl if the string leads with its normal prefix (an 'S').

Specified by:
unsqueeze in interface SqueezeAdaptor