Class Resolver
- java.lang.Object
-
- com.google.web.bindery.requestfactory.server.Resolver
-
class Resolver extends java.lang.Object
Responsible for converting between domain and client entities. This class has a small amount of temporary state used to handle graph cycles and assignment of synthetic ids.- See Also:
RequestState.getResolver()
-
-
Constructor Summary
Constructors Constructor Description Resolver(RequestState state)
Should only be called fromRequestState
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static int
index(java.lang.String path)
Returns the trailing[n]
index value from a path.(package private) static boolean
matchesPropertyRef(java.util.Set<java.lang.String> propertyRefs, java.lang.String newPrefix)
Returnstrue
if the given prefix is one of the requested property references.java.lang.Object
resolveClientValue(java.lang.Object domainValue, java.lang.reflect.Type assignableTo, java.util.Set<java.lang.String> propertyRefs)
Given a domain object, return a value that can be encoded by the client.java.lang.Object
resolveDomainValue(java.lang.Object maybeEntityProxy, boolean detectDeadEntities)
Convert a client-side value into a domain value.(package private) static java.lang.String
snipIndex(java.lang.String path)
Removes the trailing[n]
from a path.
-
-
-
Constructor Detail
-
Resolver
Resolver(RequestState state)
Should only be called fromRequestState
.
-
-
Method Detail
-
index
static int index(java.lang.String path)
Returns the trailing[n]
index value from a path.
-
matchesPropertyRef
static boolean matchesPropertyRef(java.util.Set<java.lang.String> propertyRefs, java.lang.String newPrefix)
Returnstrue
if the given prefix is one of the requested property references.
-
snipIndex
static java.lang.String snipIndex(java.lang.String path)
Removes the trailing[n]
from a path.
-
resolveClientValue
public java.lang.Object resolveClientValue(java.lang.Object domainValue, java.lang.reflect.Type assignableTo, java.util.Set<java.lang.String> propertyRefs)
Given a domain object, return a value that can be encoded by the client.- Parameters:
domainValue
- the domain object to be converted into a client-side valueassignableTo
- the type in the client to which the resolved value should be assignable. A value ofnull
indicates that any resolution will suffice.propertyRefs
- the property references requested by the client
-
resolveDomainValue
public java.lang.Object resolveDomainValue(java.lang.Object maybeEntityProxy, boolean detectDeadEntities)
Convert a client-side value into a domain value.- Parameters:
maybeEntityProxy
- the client object to resolvedetectDeadEntities
- iftrue
this method will throw a ReportableException containing aDeadEntityException
if an EntityProxy cannot be resolved
-
-