public String getQualifiedSourceName() { return getPackageNome() + "." + getSimpleSourceName(); }
public String getQualifiedSourceName() { return getPackageNome() + "." + getSimpleSourceName(); }
private void writeAutoBean(AutoBeanType type) throws UnableToCompleteException { PrintWriter pw = context.tryCreate(logger, type.getPackageNome(), type.getSimpleSourceName()); if (pw == null) { new ClassSourceFileComposerFactory(type.getPackageNome(), type.getSimpleSourceName()); factory.setSuperclass(AbstractAutoBean.class.getCanonicalName() + "<" + type.getPeerType().getQualifiedSourceName() + ">"); sw.println("public %s(%s factory) {super(factory);}", type.getSimpleSourceName(), AutoBeanFactory.class.getCanonicalName()); sw.println("public %s(%s factory, %s wrapped) {", type.getSimpleSourceName(), AutoBeanFactory.class.getCanonicalName(), type.getPeerType().getQualifiedSourceName()); sw.indentln("super(wrapped, factory);");
private void writeAutoBean(AutoBeanType type) throws UnableToCompleteException { PrintWriter pw = context.tryCreate(logger, type.getPackageNome(), type.getSimpleSourceName()); if (pw == null) { new ClassSourceFileComposerFactory(type.getPackageNome(), type.getSimpleSourceName()); factory.setSuperclass(AbstractAutoBean.class.getCanonicalName() + "<" + type.getPeerType().getQualifiedSourceName() + ">"); sw.println("public %s(%s factory) {super(factory);}", type.getSimpleSourceName(), AutoBeanFactory.class.getCanonicalName()); sw.println("public %s(%s factory, %s wrapped) {", type.getSimpleSourceName(), AutoBeanFactory.class.getCanonicalName(), type.getPeerType().getQualifiedSourceName()); sw.indentln("super(wrapped, factory);");
.getQualifiedBaseSourceName(jmethod.getReturnType()), type.getSimpleSourceName(), methodName); case SET_BUILDER: sw.println("%s.this.getWrapped().%s(%s);", type.getSimpleSourceName(), methodName, parameters[0].getName()); sw.println("%s.this.set(\"%s\", %s);", type.getSimpleSourceName(), methodName, parameters[0].getName()); if (JBeanMethod.SET_BUILDER.equals(method.getAction())) { sw.println("%s.this.getWrapped().%s(%s);", type.getSimpleSourceName(), methodName, arguments); sw.println("%s.this.call(\"%s\", null%s %s);", type.getSimpleSourceName(), methodName, arguments.length() > 0 ? "," : "", arguments); } else { jmethod.getReturnType()).getQualifiedSourceName(), type.getSimpleSourceName(), methodName, arguments); sw.println("%s.this.call(\"%s\", toReturn%s %s);", type.getSimpleSourceName(), methodName, arguments.length() > 0 ? "," : "", arguments); sw.println("return toReturn;");
.getQualifiedBaseSourceName(jmethod.getReturnType()), type.getSimpleSourceName(), methodName); case SET_BUILDER: sw.println("%s.this.getWrapped().%s(%s);", type.getSimpleSourceName(), methodName, parameters[0].getName()); sw.println("%s.this.set(\"%s\", %s);", type.getSimpleSourceName(), methodName, parameters[0].getName()); if (JBeanMethod.SET_BUILDER.equals(method.getAction())) { sw.println("%s.this.getWrapped().%s(%s);", type.getSimpleSourceName(), methodName, arguments); sw.println("%s.this.call(\"%s\", null%s %s);", type.getSimpleSourceName(), methodName, arguments.length() > 0 ? "," : "", arguments); } else { jmethod.getReturnType()).getQualifiedSourceName(), type.getSimpleSourceName(), methodName, arguments); sw.println("%s.this.call(\"%s\", toReturn%s %s);", type.getSimpleSourceName(), methodName, arguments.length() > 0 ? "," : "", arguments); sw.println("return toReturn;");
private void writeReturnWrapper(SourceWriter sw, AutoBeanType type, AutoBeanMethod method) throws UnableToCompleteException { if (!method.isValueType() && !method.isNoWrap()) { JMethod jmethod = method.getMethod(); JClassType returnClass = jmethod.getReturnType().isClassOrInterface(); AutoBeanType peer = model.getPeer(returnClass); sw.println("if (toReturn != null) {"); sw.indent(); sw.println("if (%s.this.isWrapped(toReturn)) {", type.getSimpleSourceName()); sw.indentln("toReturn = %s.this.getFromWrapper(toReturn);", type.getSimpleSourceName()); sw.println("} else {"); sw.indent(); if (peer != null) { // toReturn = new FooAutoBean(getFactory(), toReturn).as(); sw.println("toReturn = new %s(getFactory(), toReturn).as();", peer.getQualifiedSourceName()); } sw.outdent(); sw.println("}"); sw.outdent(); sw.println("}"); } // Allow return values to be intercepted JMethod interceptor = type.getInterceptor(); if (interceptor != null) { // toReturn = FooCategory.__intercept(FooAutoBean.this, toReturn); sw.println("toReturn = %s.%s(%s.this, toReturn);", interceptor.getEnclosingType() .getQualifiedSourceName(), interceptor.getName(), type.getSimpleSourceName()); } }
private void writeReturnWrapper(SourceWriter sw, AutoBeanType type, AutoBeanMethod method) throws UnableToCompleteException { if (!method.isValueType() && !method.isNoWrap()) { JMethod jmethod = method.getMethod(); JClassType returnClass = jmethod.getReturnType().isClassOrInterface(); AutoBeanType peer = model.getPeer(returnClass); sw.println("if (toReturn != null) {"); sw.indent(); sw.println("if (%s.this.isWrapped(toReturn)) {", type.getSimpleSourceName()); sw.indentln("toReturn = %s.this.getFromWrapper(toReturn);", type.getSimpleSourceName()); sw.println("} else {"); sw.indent(); if (peer != null) { // toReturn = new FooAutoBean(getFactory(), toReturn).as(); sw.println("toReturn = new %s(getFactory(), toReturn).as();", peer.getQualifiedSourceName()); } sw.outdent(); sw.println("}"); sw.outdent(); sw.println("}"); } // Allow return values to be intercepted JMethod interceptor = type.getInterceptor(); if (interceptor != null) { // toReturn = FooCategory.__intercept(FooAutoBean.this, toReturn); sw.println("toReturn = %s.%s(%s.this, toReturn);", interceptor.getEnclosingType() .getQualifiedSourceName(), interceptor.getName(), type.getSimpleSourceName()); } }
.getSimpleSourceName(), method.getPropertyName()); .getSimpleSourceName(), method.getPropertyName()); JParameter param = jmethod.getParameters()[0]; sw.println("%s.this.setProperty(\"%s\", %s);", type.getSimpleSourceName(), method .getPropertyName(), param.getName()); if (JBeanMethod.SET_BUILDER.equals(method.getAction())) { staticImpl.getName(), type.getSimpleSourceName()); for (JParameter param : jmethod.getParameters()) { sw.print(", %s", param.getName());
.getSimpleSourceName(), method.getPropertyName()); .getSimpleSourceName(), method.getPropertyName()); JParameter param = jmethod.getParameters()[0]; sw.println("%s.this.setProperty(\"%s\", %s);", type.getSimpleSourceName(), method .getPropertyName(), param.getName()); if (JBeanMethod.SET_BUILDER.equals(method.getAction())) { staticImpl.getName(), type.getSimpleSourceName()); for (JParameter param : jmethod.getParameters()) { sw.print(", %s", param.getName());
.getCanonicalName(), type.getSimpleSourceName(), method.getPropertyName());
.getCanonicalName(), type.getSimpleSourceName(), method.getPropertyName());