List<BeanResolver> introspectables = this.getIntrospectableTypes(logger, context.getTypeOracle());
MethodWrapper[] methods = this.findMethods(logger, introspectables);
ClassSourceFileComposerFactory mcf = new ClassSourceFileComposerFactory(this.packageName,
this.methodsImplementationName);
mcf.addImport(com.totsp.gwittir.client.beans.Method.class.getCanonicalName());
PrintWriter methodsPrintWriter = context.tryCreate(logger, this.packageName, this.methodsImplementationName);
if (methodsPrintWriter != null) {
SourceWriter methodsWriter = mcf.createSourceWriter(context, methodsPrintWriter);
this.writeMethods(logger, methods, methodsWriter);
methodsWriter.println("}");
context.commit(logger, methodsPrintWriter);
}
ClassSourceFileComposerFactory cfcf = new ClassSourceFileComposerFactory(this.packageName,
this.implementationName);
cfcf.addImplementedInterface(typeName);
cfcf.addImport("java.util.HashMap");
cfcf.addImport(com.totsp.gwittir.client.beans.Method.class.getCanonicalName());
cfcf.addImport(com.totsp.gwittir.client.beans.Property.class.getCanonicalName());
cfcf.addImport(com.totsp.gwittir.client.beans.BeanDescriptor.class.getCanonicalName());
PrintWriter printWriter = context.tryCreate(logger, packageName, implementationName);
if (printWriter == null) {
//.println( "Introspector Generate skipped.");
return packageName + "." + implementationName;
}
SourceWriter writer = cfcf.createSourceWriter(context, printWriter);
this.writeIntrospectables(logger, introspectables, methods, writer);
this.writeResolver(introspectables, writer);
writer.println(
"private HashMap<Class,BeanDescriptor> beanDescriptorLookup = new HashMap<Class,BeanDescriptor>();");