org.apache.tapestry.record
Class PersistentPropertyDataEncoderImpl

java.lang.Object
  extended by org.apache.tapestry.record.PersistentPropertyDataEncoderImpl
All Implemented Interfaces:
PersistentPropertyDataEncoder

public class PersistentPropertyDataEncoderImpl
extends Object
implements PersistentPropertyDataEncoder

Responsible for converting lists of PropertyChanges back and forth to a URL safe encoded string.

A possible improvement would be to encode the binary data with encryption both on and off, and select the shortest (prefixing with a character that identifies whether encryption should be used to decode).


Field Summary
protected  org.apache.hivemind.ClassResolver _classResolver
           
static String BYTESTREAM_PREFIX
          Prefix on the MIME encoding that indicates that the encoded data is not encoded.
static String GZIP_BYTESTREAM_PREFIX
          Prefix on the MIME encoding that indicates that the encoded data is encoded with GZIP.
 
Constructor Summary
PersistentPropertyDataEncoderImpl()
           
 
Method Summary
 List decodePageChanges(String encoded)
          Takes a string with an encoded set of page changes, and converts it back into a list of PropertyChanges.
 String encodePageChanges(List changes)
          Encodes a (possibly empty) list of PropertyChanges into a string representation that can later be decoded.
protected  List readChangesFromStream(ObjectInputStream ois)
           
 void setClassResolver(org.apache.hivemind.ClassResolver resolver)
           
protected  void writeChangesToStream(List changes, ObjectOutputStream oos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTESTREAM_PREFIX

public static final String BYTESTREAM_PREFIX
Prefix on the MIME encoding that indicates that the encoded data is not encoded.

See Also:
Constant Field Values

GZIP_BYTESTREAM_PREFIX

public static final String GZIP_BYTESTREAM_PREFIX
Prefix on the MIME encoding that indicates that the encoded data is encoded with GZIP.

See Also:
Constant Field Values

_classResolver

protected org.apache.hivemind.ClassResolver _classResolver
Constructor Detail

PersistentPropertyDataEncoderImpl

public PersistentPropertyDataEncoderImpl()
Method Detail

encodePageChanges

public String encodePageChanges(List changes)
Description copied from interface: PersistentPropertyDataEncoder
Encodes a (possibly empty) list of PropertyChanges into a string representation that can later be decoded.

Specified by:
encodePageChanges in interface PersistentPropertyDataEncoder
Parameters:
changes - List of changes to encode into a persistable form.
Returns:
encoded string (possibly empty, but not null)

decodePageChanges

public List decodePageChanges(String encoded)
Description copied from interface: PersistentPropertyDataEncoder
Takes a string with an encoded set of page changes, and converts it back into a list of PropertyChanges.

Specified by:
decodePageChanges in interface PersistentPropertyDataEncoder
Parameters:
encoded - The data to un-encode, which should be equivalent to the same that was passed in to PersistentPropertyDataEncoder.encodePageChanges(java.util.List).
Returns:
The decoded page data.

writeChangesToStream

protected void writeChangesToStream(List changes,
                                    ObjectOutputStream oos)
                             throws IOException
Throws:
IOException

readChangesFromStream

protected List readChangesFromStream(ObjectInputStream ois)
                              throws IOException,
                                     ClassNotFoundException
Throws:
IOException
ClassNotFoundException

setClassResolver

public void setClassResolver(org.apache.hivemind.ClassResolver resolver)


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