org.apache.tapestry.services
Interface DataSqueezer

All Known Implementing Classes:
DataSqueezerImpl

public interface DataSqueezer

Lightweight serialization used to encode values into strings that are stored in query parameters and hidden fields.

Since:
4.0
Author:
Howard Lewis Ship

Method Summary
 org.apache.hivemind.ClassResolver getResolver()
           
 void register(java.lang.String prefix, java.lang.Class dataClass, ISqueezeAdaptor adaptor)
          Deprecated. as DataSqueezer evolves into a service.
 java.lang.String squeeze(java.lang.Object data)
          Squeezes the data object into a String by locating an appropriate adaptor that can perform the conversion.
 java.lang.String[] squeeze(java.lang.Object[] data)
          A convenience; invokes squeeze(Object)for each element in the data array.
 java.lang.Object unsqueeze(java.lang.String string)
          Unsqueezes the string.
 java.lang.Object[] unsqueeze(java.lang.String[] strings)
          Convenience method for unsqueezing many strings (back into objects).
 

Method Detail

squeeze

public java.lang.String squeeze(java.lang.Object data)
                         throws java.io.IOException
Squeezes the data object into a String by locating an appropriate adaptor that can perform the conversion. data may be null.

Throws:
java.io.IOException

squeeze

public java.lang.String[] squeeze(java.lang.Object[] data)
                           throws java.io.IOException
A convenience; invokes squeeze(Object)for each element in the data array. If data is null, returns null.

Throws:
java.io.IOException

unsqueeze

public java.lang.Object unsqueeze(java.lang.String string)
                           throws java.io.IOException
Unsqueezes the string. Note that in a special case, where the first character of the string is not a recognized prefix, it is assumed that the string is simply a string, and returned with no change.

Throws:
java.io.IOException

unsqueeze

public java.lang.Object[] unsqueeze(java.lang.String[] strings)
                             throws java.io.IOException
Convenience method for unsqueezing many strings (back into objects).

If strings is null, returns null.

Throws:
java.io.IOException

register

public void register(java.lang.String prefix,
                     java.lang.Class dataClass,
                     ISqueezeAdaptor adaptor)
Deprecated. as DataSqueezer evolves into a service.


getResolver

public org.apache.hivemind.ClassResolver getResolver()