@Target(value=TYPE) @Retention(value=SOURCE) @Inherited public @interface GenProxy
EntityProxy
and ValueProxy
classes.
Simply annotate your entity with GenProxy
and gwt-platform will
generate you a ProxyFor
interface. The generated interface equals the given examples on DevGuideRequestFactory.
Generate
Fields as proxy:
You can declare fields as proxy using UseProxy
or @UseProxyName
.
If you type:
@GenProxy
public class Person {
@UseProxyName("com.gwtplatform.dispatch.annotation.AddressProxy")
Address address;
@UseProxy(DetailProxy.class)
Detail detail;
}
gwt-platform will generate the following EntityProxy.
@ProxyFor(com.gwtplatform.dispatch.annotation.Person.class)
public interface PersonProxy extends EntityProxy {
EntityProxyId<PersonProxy> stableId();
com.gwtplatform.dispatch.annotation.AddressProxy getAddress();
com.gwtplatform.dispatch.annotation.DetailProxy getDetail();
void setAddress(com.gwtplatform.dispatch.annotation.AddressProxy address);
void setDetail(com.gwtplatform.dispatch.annotation.DetailProxy detail);
}
Using Value Proxies: Set isEmbeddedType()
to true.
Note: If your package name contains ".server", the processor
automatically replaces this with ".shared". To avoid this behaviour, set the
target package manual using targetPackage()
.
Modifier and Type | Optional Element and Description |
---|---|
String[] |
filterGetter
Add a property name to avoid the generation of a getter for this property.
|
String[] |
filterSetter
Add a property name to avoid the generation of a setter for this property.
|
boolean |
isEmbeddedType
An embedded type results in a ValueProxy instead of an EntityProxy.
|
Class<? extends Locator> |
locator |
String |
targetPackage
Defines the output package.
|
public abstract String targetPackage
By default the output is generated to the same source folder.
If you are not using a custom target package, the processor will automatically replace ".server" in your package name with ".shared".
@GenProxy
(targetPackage = "com.example.package.server")
public abstract String[] filterGetter
@GenProxy
(filterGetter = {"id", "customer"})
public abstract String[] filterSetter
@GenProxy
(filterSetter = {"id", "customer"})
public abstract boolean isEmbeddedType
Copyright © 2010–2014 Arcbees. All rights reserved.