java.lang.Object | |
↳ | com.google.gwt.requestfactory.server.RequestFactoryInterfaceValidator |
Encapsulates validation logic to determine if a RequestFactory
interface, its RequestContext
, and associated EntityProxy
interfaces match their domain counterparts. This implementation examines the
classfiles directly in order to avoid the need to load the types into the
JVM.
This class is amenable to being used as a unit test:
public void testRequestFactory() { Logger logger = Logger.getLogger(""); RequestFactoryInterfaceValidator v = new RequestFactoryInterfaceValidator( logger, new ClassLoaderLoader(MyRequestContext.class.getClassLoader())); v.validateRequestContext(MyRequestContext.class.getName()); assertFalse(v.isPoisoned()); }This class also has a
main
method and can be used as a build-time
tool:
java -cp gwt-servlet.jar:your-code.jar \ com.google.gwt.requestfactory.server.RequestFactoryInterfaceValidator \ com.example.MyRequestFactory
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RequestFactoryInterfaceValidator.ClassLoaderLoader | An implementation of RequestFactoryInterfaceValidator.ClassLoaderLoader that uses a ClassLoader to
retrieve the class files. |
||||||||||
RequestFactoryInterfaceValidator.Loader | Abstracts the mechanism by which class files are loaded. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Reset the poisoned status of the validator so that it may be reused without
destroying cached state.
| |||||||||||
Returns true if validation failed.
| |||||||||||
This method checks an EntityProxy interface against its peer domain object
to determine if the server code would be able to process a request using
the methods defined in the EntityProxy interface.
| |||||||||||
Determine if the specified type implements a proxy interface and apply the
appropriate validations.
| |||||||||||
This method checks a RequestContext interface against its peer domain
domain object to determine if the server code would be able to process a
request using the the methods defined in the RequestContext interface.
| |||||||||||
This method checks a RequestFactory interface.
| |||||||||||
This method checks a ValueProxy interface against its peer domain object to
determine if the server code would be able to process a request using the
methods defined in the ValueProxy interface.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Reset the poisoned status of the validator so that it may be reused without destroying cached state.
Returns true if validation failed.
This method checks an EntityProxy interface against its peer domain object to determine if the server code would be able to process a request using the methods defined in the EntityProxy interface. It does not perform any checks as to whether or not the EntityProxy could actually be generated by the Generator.
This method may be called repeatedly on a single instance of the validator. Doing so will amortize type calculation costs.
Checks implemented:
binaryName
implements EntityProxybinaryName
has a ProxyFor
or ProxyForName
annotationbinaryName | the binary name (e.g. getName() ) of the
EntityProxy subtype
|
---|
Determine if the specified type implements a proxy interface and apply the appropriate validations. This can be used as a general-purpose entry method when writing unit tests.
binaryName | the binary name (e.g. getName() ) of the
EntityProxy or ValueProxy subtype
|
---|
This method checks a RequestContext interface against its peer domain domain object to determine if the server code would be able to process a request using the the methods defined in the RequestContext interface. It does not perform any checks as to whether or not the RequestContext could actually be generated by the Generator.
This method may be called repeatedly on a single instance of the validator. Doing so will amortize type calculation costs.
Checks implemented:
binaryName
implements RequestContextbinaryName
has a Service
or ServiceName
annotationbinaryName | the binary name (e.g. getName() ) of the
RequestContext subtype |
---|
This method checks a RequestFactory interface.
This method may be called repeatedly on a single instance of the validator. Doing so will amortize type calculation costs. It does not perform any checks as to whether or not the RequestContext could actually be generated by the Generator.
Checks implemented:
binaryName
implements RequestFactorybinaryName | the binary name (e.g. getName() ) of the
RequestContext subtype |
---|
This method checks a ValueProxy interface against its peer domain object to determine if the server code would be able to process a request using the methods defined in the ValueProxy interface. It does not perform any checks as to whether or not the ValueProxy could actually be generated by the Generator.
This method may be called repeatedly on a single instance of the validator. Doing so will amortize type calculation costs.
Checks implemented:
binaryName
implements ValueProxybinaryName
has a ProxyFor
or ProxyForName
annotationbinaryName | the binary name (e.g. getName() ) of the
EntityProxy subtype
|
---|