|
AeroGear Android Library 1.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.aerogear.android.impl.pipeline.SupportLoaderAdapter<T>
public class SupportLoaderAdapter<T>
This class wraps a Pipe in an asynchronous Loader.
This classes uses Loaders from android.support. If you do not need to support
Android devices < version 3.0, consider using LoaderAdapter
| Field Summary |
|---|
| Fields inherited from interface org.jboss.aerogear.android.pipeline.LoaderPipe |
|---|
CALLBACK, FILTER, ITEM, METHOD, REMOVE_ID |
| Constructor Summary | |
|---|---|
SupportLoaderAdapter(android.support.v4.app.FragmentActivity activity,
Pipe<T> pipe,
com.google.gson.Gson gson,
String name)
Deprecated. |
|
SupportLoaderAdapter(android.support.v4.app.FragmentActivity activity,
Pipe<T> pipe,
String name)
|
|
SupportLoaderAdapter(android.support.v4.app.Fragment fragment,
android.content.Context applicationContext,
Pipe<T> pipe,
com.google.gson.Gson gson,
String name)
Deprecated. |
|
SupportLoaderAdapter(android.support.v4.app.Fragment fragment,
android.content.Context applicationContext,
Pipe<T> pipe,
String name)
|
|
| Method Summary | |
|---|---|
com.google.gson.Gson |
getGson()
Returns the GSON serializer used to serialized instances of objects. |
PipeHandler<T> |
getHandler()
Returns the instance which is responsible for handling read, save, and remove. |
Class<T> |
getKlass()
|
RequestBuilder<T> |
getRequestBuilder()
The RequestBuilder is responsible for turning objects in bodies of requests. |
ResponseParser<T> |
getResponseParser()
The ResponseParser is responsible for turning responses from a SAVE into an object |
PipeType |
getType()
Returns the connection type of this Pipe object (e.g. |
URL |
getUrl()
Returns the URL to which this Pipe object points. |
android.support.v4.content.Loader<T> |
onCreateLoader(int id,
android.os.Bundle bundle)
|
void |
onLoaderReset(android.support.v4.content.Loader<T> loader)
|
void |
onLoadFinished(android.support.v4.content.Loader<T> loader,
T data)
|
void |
read(Callback<List<T>> callback)
Sends a signal to the Pipe to read its data and return it via the callback. |
void |
read(ReadFilter filter,
Callback<List<T>> callback)
Reads all the data from the underlying server connection. |
void |
readWithFilter(ReadFilter filter,
Callback<List<T>> callback)
Reads all the data from the underlying server connection. |
void |
remove(String toRemoveId,
Callback<Void> callback)
Removes an object from the underlying server connection. |
void |
reset()
Calls reset on all loaders associated with this pipe. |
void |
save(T item,
Callback<T> callback)
Saves or updates a given object on the server. |
void |
setLoaderIds(com.google.common.collect.Multimap<String,Integer> idsForNamedPipes)
Passes in a multimap of ids for the named pipe. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Deprecated
public SupportLoaderAdapter(android.support.v4.app.FragmentActivity activity,
Pipe<T> pipe,
com.google.gson.Gson gson,
String name)
@Deprecated
public SupportLoaderAdapter(android.support.v4.app.Fragment fragment,
android.content.Context applicationContext,
Pipe<T> pipe,
com.google.gson.Gson gson,
String name)
public SupportLoaderAdapter(android.support.v4.app.Fragment fragment,
android.content.Context applicationContext,
Pipe<T> pipe,
String name)
public SupportLoaderAdapter(android.support.v4.app.FragmentActivity activity,
Pipe<T> pipe,
String name)
| Method Detail |
|---|
public PipeType getType()
PipePipe object (e.g. REST).
getType in interface Pipe<T>public URL getUrl()
PipeURL to which this Pipe object points.
getUrl in interface Pipe<T>public void read(Callback<List<T>> callback)
Pipe
read in interface Pipe<T>callback - The callback for consuming the result from the Pipe invocation.
public void readWithFilter(ReadFilter filter,
Callback<List<T>> callback)
Pipe
readWithFilter in interface Pipe<T>filter - a ReadFilter for performing pagination and querying.callback - The callback for consuming the result from the Pipe invocation.
public void read(ReadFilter filter,
Callback<List<T>> callback)
Pipe
read in interface Pipe<T>filter - a ReadFilter for performing pagination and querying.callback - The callback for consuming the result from the Pipe invocation.
public void save(T item,
Callback<T> callback)
Pipe
save in interface Pipe<T>item - the item to save or updatecallback - The callback for consuming the result from the Pipe invocation.
public void remove(String toRemoveId,
Callback<Void> callback)
Pipe
remove in interface Pipe<T>toRemoveId - representing the ‘id’ of the object to be removedcallback - The callback for consuming the result from the Pipe invocation.public PipeHandler<T> getHandler()
Pipe
getHandler in interface Pipe<T>
public android.support.v4.content.Loader<T> onCreateLoader(int id,
android.os.Bundle bundle)
onCreateLoader in interface android.support.v4.app.LoaderManager.LoaderCallbacks<T>public com.google.gson.Gson getGson()
Pipe
getGson in interface Pipe<T>public RequestBuilder<T> getRequestBuilder()
PipeRequestBuilder is responsible for turning objects in bodies of requests.
getRequestBuilder in interface Pipe<T>public ResponseParser<T> getResponseParser()
PipeResponseParser is responsible for turning responses from a SAVE into an object
getResponseParser in interface Pipe<T>public Class<T> getKlass()
getKlass in interface Pipe<T>
public void onLoadFinished(android.support.v4.content.Loader<T> loader,
T data)
onLoadFinished in interface android.support.v4.app.LoaderManager.LoaderCallbacks<T>public void onLoaderReset(android.support.v4.content.Loader<T> loader)
onLoaderReset in interface android.support.v4.app.LoaderManager.LoaderCallbacks<T>public void reset()
LoaderPipe
reset in interface LoaderPipe<T>public void setLoaderIds(com.google.common.collect.Multimap<String,Integer> idsForNamedPipes)
LoaderPipe
setLoaderIds in interface LoaderPipe<T>
|
AeroGear Android Library 1.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||