public JavaMethod getInterfaceMethod(JavaSource pSource,
ProxyGenerator.InterfaceDescription pDescription,
java.lang.reflect.Method pMethod) {
JavaMethod jm = pSource.newJavaMethod(pMethod);
Parameter[] parameters = jm.getParams();
JavaQName controllerInterfaceQName = JavaQNameImpl.getInstance(getControllerInterface());
jm.clearParams();
jm.addParam(controllerInterfaceQName, "pController");
for (int i = 0; i < parameters.length; i++) {
jm.addParam(parameters[i]);
}
return jm;
}
public JavaSource generate(JavaSourceFactory pInterfaceFactory,
JavaQName pTargetClass,
ProxyGenerator.InterfaceDescription[] pDescription) {
JavaSource result = super.generate(pInterfaceFactory, pTargetClass,
pDescription);
result.clearImplements();
return result;
}
};
JavaSource proxyInterface = proxyInterfaceGenerator.generate(pFactory, getChainInterface(), interfaces);
proxyInterface.setType(JavaSource.INTERFACE);
ProxyGenerator proxyImplementationGenerator = new ProxyGenerator(){
protected JavaField getBackingObjectField(JavaSource pJs, InterfaceDescription[] pInterfaces) {
return pJs.newJavaField("backingObject", getChainInterface(), JavaSource.PRIVATE);
}
protected JavaConstructor getConstructor(JavaSource pJs,
InterfaceDescription[] pInterfaces) {
JavaConstructor jcon = pJs.newJavaConstructor(JavaSource.PROTECTED);
jcon.addParam(getChainInterface(), "o");
jcon.addIf("o == null");
jcon.addThrowNew(NullPointerException.class,
JavaSource.getQuoted("The supplied object must not be null."));
jcon.addEndIf();
jcon.addLine("backingObject = o;");
return jcon;
}
public JavaMethod getInterfaceMethod(JavaSource pSource,
ProxyGenerator.InterfaceDescription pDescription,
java.lang.reflect.Method pMethod) {
JavaMethod jm = pSource.newJavaMethod(pMethod);
Parameter[] parameters = jm.getParams();
JavaQName controllerInterfaceQName = JavaQNameImpl.getInstance(getControllerInterface());
jm.clearParams();
jm.addParam(controllerInterfaceQName, "pController");
for (int i = 0; i < parameters.length; i++) {
jm.addParam(parameters[i]);
}