com.sencha.gxt.data.client.loader
Class StorageWriteProxy<K,V>

java.lang.Object
  extended by com.sencha.gxt.data.client.loader.StorageWriteProxy<K,V>
All Implemented Interfaces:
DataProxy<StorageWriteProxy.Entry<K,V>,java.lang.Void>

public class StorageWriteProxy<K,V>
extends java.lang.Object
implements DataProxy<StorageWriteProxy.Entry<K,V>,java.lang.Void>

Proxy to push key/value string pairs into local html5 browser storage. Both key and value must be populated prior to


Nested Class Summary
static class StorageWriteProxy.Entry<K,V>
          Defines a key / value pair.
 
Constructor Summary
StorageWriteProxy(boolean session)
          Creates a storage write proxy that saves a key and value to HTML5 browser based storage.
StorageWriteProxy(Storage storage)
          Creates a storage write proxy that saves a key and value to the given HTML5 browser based storage.
 
Method Summary
 DataWriter<K,java.lang.String> getKeyWriter()
          Returns the current DataWriter used for converting key instances into Strings
 DataWriter<V,java.lang.String> getValueWriter()
          Returns the current DataWriter used for converting value instances into Strings
 void load(StorageWriteProxy.Entry<K,V> data, Callback<java.lang.Void,java.lang.Throwable> callback)
          Data should be retrieved using the specified load config.
 void setKeyWriter(DataWriter<K,java.lang.String> keyWriter)
          Sets a writer to use for converting key objects into a string to use when storing values.
 void setValueWriter(DataWriter<V,java.lang.String> valueWriter)
          Sets a writer to use for converting value objects into a string to be stored.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StorageWriteProxy

public StorageWriteProxy(boolean session)
Creates a storage write proxy that saves a key and value to HTML5 browser based storage.

Parameters:
session - true to use session storage, false to use local storage

StorageWriteProxy

public StorageWriteProxy(Storage storage)
Creates a storage write proxy that saves a key and value to the given HTML5 browser based storage.

Parameters:
storage - the browser based storage
Method Detail

getKeyWriter

public DataWriter<K,java.lang.String> getKeyWriter()
Returns the current DataWriter used for converting key instances into Strings

Returns:
the current data writer that converts key instances into strings

getValueWriter

public DataWriter<V,java.lang.String> getValueWriter()
Returns the current DataWriter used for converting value instances into Strings

Returns:
the current data writer that converts value instances into strings

load

public void load(StorageWriteProxy.Entry<K,V> data,
                 Callback<java.lang.Void,java.lang.Throwable> callback)
Description copied from interface: DataProxy
Data should be retrieved using the specified load config. When specified, the DataReader can be used to "process" the raw data.

Specified by:
load in interface DataProxy<StorageWriteProxy.Entry<K,V>,java.lang.Void>
Parameters:
data - the load config object to be passed to server
callback - the data callback

setKeyWriter

public void setKeyWriter(DataWriter<K,java.lang.String> keyWriter)
Sets a writer to use for converting key objects into a string to use when storing values.

Parameters:
keyWriter -

setValueWriter

public void setValueWriter(DataWriter<V,java.lang.String> valueWriter)
Sets a writer to use for converting value objects into a string to be stored.

Parameters:
valueWriter -


Copyright © 2012. All Rights Reserved.