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.


Method Summary
 String squeeze(Object data)
          Squeezes the data object into a String by locating an appropriate adaptor that can perform the conversion.
 String[] squeeze(Object[] data)
          A convenience; invokes squeeze(Object) for each element in the data array.
 Object unsqueeze(String string)
          Unsqueezes the string.
 Object[] unsqueeze(String[] strings)
          Convenience method for unsqueezing many strings (back into objects).
 

Method Detail

squeeze

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

Parameters:
data - The object to squeeze.
Returns:
The string equivalent of the data in "squeezed" form.

squeeze

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

Parameters:
data - Array of objects to squeeze.
Returns:
Squeezed string array.

unsqueeze

Object unsqueeze(String string)
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.

Parameters:
string - The data to unsqueeze.
Returns:
The object representation of the data - theoretically matching the object passed in via squeeze(Object).

unsqueeze

Object[] unsqueeze(String[] strings)
Convenience method for unsqueezing many strings (back into objects).

If strings is null, returns null.

Parameters:
strings - The string data array to unsqueeze.
Returns:
The data in its object form, as was passed in to squeeze(Object[]).


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.