|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.google.web.bindery.requestfactory.shared.Locator<T,I>
T - the type of domain object the Locator will operate onI - the type of object the Locator expects to use as an id for the
domain objectpublic abstract class Locator<T,I>
A Locator allows entity types that do not conform to the RequestFactory
entity protocol to be used. Instead of attempting to use a findFoo(),
getId(), and getVersion() declared in the domain entity type,
an instance of a Locator will be created to provide implementations of these
methods.
Locator subtypes must be default instantiable (i.e. public static types with a no-arg constructor). Instances of Locators may be retained and reused by the RequestFactory service layer.
ProxyFor.locator()| Constructor Summary | |
|---|---|
Locator()
|
|
| Method Summary | |
|---|---|
abstract T |
create(java.lang.Class<? extends T> clazz)
Create a new instance of the requested type. |
abstract T |
find(java.lang.Class<? extends T> clazz,
I id)
Retrieve an object. |
abstract java.lang.Class<T> |
getDomainType()
Returns the T type. |
abstract I |
getId(T domainObject)
Returns a domain object to be used as the id for the given object. |
abstract java.lang.Class<I> |
getIdType()
Returns the I type. |
abstract java.lang.Object |
getVersion(T domainObject)
Returns a domain object to be used as the version for the given object. |
boolean |
isLive(T domainObject)
Returns a value indicating if the domain object should no longer be considered accessible. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Locator()
| Method Detail |
|---|
public abstract T create(java.lang.Class<? extends T> clazz)
clazz - the type of object to create
public abstract T find(java.lang.Class<? extends T> clazz,
I id)
null to indicate that the requested
object could not be found.
clazz - the type of object to retrieveid - an id previously returned from getId(Object)
null if it could not be foundpublic abstract java.lang.Class<T> getDomainType()
T type.
public abstract I getId(T domainObject)
null if the object has not been persisted or
should be treated as irretrievable.
domainObject - the object to obtain an id for
nullpublic abstract java.lang.Class<I> getIdType()
I type.
public abstract java.lang.Object getVersion(T domainObject)
null if the object has not been persisted or
should be treated as irretrievable.
domainObject - the object to obtain an id for
nullpublic boolean isLive(T domainObject)
The default implementation of this method uses getId(Object) and
find(Class, Object) to determine if an object can be retrieved.
|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||