PK ; META-INF/PK ;Z!ffMETA-INF/MANIFEST.MFManifest-Version: 1.0 Ant-Version: Apache Ant 1.7.1 Created-By: 14.3-b01 (Sun Microsystems Inc.) PK ;com/PK ; com/aquait/PK ;com/aquait/utils/PK ;com/aquait/utils/gwt/PK ;#com/aquait/utils/gwt/introspection/PK ;com/aquait/utils/gwt/rebind/PK ; com/aquait/utils/gwt/reflection/PK ;&ݸ*com/aquait/utils/gwt/Introspection.gwt.xml PK ;'com/aquait/utils/gwt/Reflection.gwt.xml PK ;D7com/aquait/utils/gwt/introspection/Introspectable.class1 SourceFileIntrospectable.java1com/aquait/utils/gwt/introspection/Introspectablejava/lang/ObjectPK ; &16com/aquait/utils/gwt/introspection/Introspectable.java/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.aquait.utils.gwt.introspection; /** * * @author quique */ public interface Introspectable { } PK ;x.}6com/aquait/utils/gwt/introspection/Introspection.class1 getPropertyY(Lcom/aquait/utils/gwt/introspection/Introspectable;Ljava/lang/String;)Ljava/lang/Object; Signature0(TI;Ljava/lang/String;)TT; setPropertyZ(Lcom/aquait/utils/gwt/introspection/Introspectable;Ljava/lang/String;Ljava/lang/Object;)V*(TI;Ljava/lang/String;Ljava/lang/Object;)VgetPropertyNames()Ljava/util/Collection;,()Ljava/util/Collection;JLjava/lang/Object; SourceFileIntrospection.java0com/aquait/utils/gwt/introspection/Introspectionjava/lang/Object    PK ;R 5com/aquait/utils/gwt/introspection/Introspection.java/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.aquait.utils.gwt.introspection; import java.util.Collection; /** * * @author quique */ public interface Introspection { T getProperty(I bean, String propName); void setProperty(I bean, String propName, Object value); Collection getPropertyNames(); } PK ;7:com/aquait/utils/gwt/rebind/IntrospectionGenerator$1.class1   SourceFileIntrospectionGenerator.javaEnclosingMethod 4com/aquait/utils/gwt/rebind/IntrospectionGenerator$1 InnerClassesjava/lang/Object2com/aquait/utils/gwt/rebind/IntrospectionGenerator  PK ;Y)EEKcom/aquait/utils/gwt/rebind/IntrospectionGenerator$PropertyDescriptor.class1'    "#nameLjava/lang/String;getter*Lcom/google/gwt/core/ext/typeinfo/JMethod;setterthis$04Lcom/aquait/utils/gwt/rebind/IntrospectionGenerator;7(Lcom/aquait/utils/gwt/rebind/IntrospectionGenerator;)VCodeLineNumberTableLocalVariableTablethisPropertyDescriptor InnerClassesGLcom/aquait/utils/gwt/rebind/IntrospectionGenerator$PropertyDescriptor;$m(Lcom/aquait/utils/gwt/rebind/IntrospectionGenerator;Lcom/aquait/utils/gwt/rebind/IntrospectionGenerator$1;)Vx0x16Lcom/aquait/utils/gwt/rebind/IntrospectionGenerator$1; SourceFileIntrospectionGenerator.java  %&Ecom/aquait/utils/gwt/rebind/IntrospectionGenerator$PropertyDescriptorjava/lang/Object4com/aquait/utils/gwt/rebind/IntrospectionGenerator$1()V2com/aquait/utils/gwt/rebind/IntrospectionGenerator    4 *+*   D*+  !!PK ; 8com/aquait/utils/gwt/rebind/IntrospectionGenerator.class1S [       Z  ! ! I   ! I     D F Z  I  !      InnerClassesPropertyDescriptor()VCodeLineNumberTableLocalVariableTablethis4Lcom/aquait/utils/gwt/rebind/IntrospectionGenerator;generatet(Lcom/google/gwt/core/ext/TreeLogger;Lcom/google/gwt/core/ext/GeneratorContext;Ljava/lang/String;)Ljava/lang/String;propertyDescriptorGLcom/aquait/utils/gwt/rebind/IntrospectionGenerator$PropertyDescriptor;i$Ljava/util/Iterator;jType(Lcom/google/gwt/core/ext/typeinfo/JType;jPrimitiveType1Lcom/google/gwt/core/ext/typeinfo/JPrimitiveType; getterSettersource)Lcom/google/gwt/user/rebind/SourceWriter;propertyDescriptorsLjava/util/List; classType-Lcom/google/gwt/core/ext/typeinfo/JClassType; packageNameLjava/lang/String; simpleNamesimpleNameIntospectioncomposer;Lcom/google/gwt/user/rebind/ClassSourceFileComposerFactory; printWriterLjava/io/PrintWriter;e4Lcom/google/gwt/core/ext/typeinfo/NotFoundException;logger$Lcom/google/gwt/core/ext/TreeLogger;context*Lcom/google/gwt/core/ext/GeneratorContext;typeNameLocalVariableTypeTableYLjava/util/List; ExceptionsfindProperties?(Lcom/google/gwt/core/ext/typeinfo/JClassType;)Ljava/util/List;pd setterMethod*Lcom/google/gwt/core/ext/typeinfo/JMethod; getterNamenIproperty getterMethodmethods; Signature(Lcom/google/gwt/core/ext/typeinfo/JClassType;)Ljava/util/List; getAllMethods@(Ljava/util/List;Lcom/google/gwt/core/ext/typeinfo/JClassType;)Vmarr$+[Lcom/google/gwt/core/ext/typeinfo/JMethod;len$mssuperClassTypel(Ljava/util/List;Lcom/google/gwt/core/ext/typeinfo/JClassType;)V SourceFileIntrospectionGenerator.java `a        java/lang/StringBuilder  Introspection 9com/google/gwt/user/rebind/ClassSourceFileComposerFactory `java.util.Collection java.util.ArrayList0com.aquait.utils.gwt.introspection.Introspection1com.aquait.utils.gwt.introspection.IntrospectableIntrospection<.>    ! "a public Object getProperty(# introspectable, String property) { #$ %&' () *+Ecom/aquait/utils/gwt/rebind/IntrospectionGenerator$PropertyDescriptorif (property.equals(" ,y")) {return introspectable. -(); #a .a} else /{-throw new IllegalArgumentException(property);}public void setProperty(1 introspectable, String property, Object value) { 0 123  45 67introspectable.((8 9)value); :0private Collection propertyNames = null;.public Collection getPropertyNames() {if (propertyNames == null) {(propertyNames = new ArrayList();propertyNames.add("");return propertyNames; ;< =2com/google/gwt/core/ext/typeinfo/NotFoundException >ajava/util/ArrayList (com/google/gwt/core/ext/typeinfo/JMethodget? @Ais B4 CpD EF GHset `I JK L GM NF OP QR2com/aquait/utils/gwt/rebind/IntrospectionGenerator!com/google/gwt/core/ext/Generator4com/aquait/utils/gwt/rebind/IntrospectionGenerator$11com/google/gwt/core/ext/UnableToCompleteException(com/google/gwt/core/ext/GeneratorContext getTypeOracle/()Lcom/google/gwt/core/ext/typeinfo/TypeOracle;+com/google/gwt/core/ext/typeinfo/TypeOraclegetTypeA(Ljava/lang/String;)Lcom/google/gwt/core/ext/typeinfo/JClassType;+com/google/gwt/core/ext/typeinfo/JClassType getPackage-()Lcom/google/gwt/core/ext/typeinfo/JPackage;)com/google/gwt/core/ext/typeinfo/JPackagegetName()Ljava/lang/String;getSimpleSourceNameappend-(Ljava/lang/String;)Ljava/lang/StringBuilder;toString'(Ljava/lang/String;Ljava/lang/String;)V addImport(Ljava/lang/String;)VaddImplementedInterface tryCreate_(Lcom/google/gwt/core/ext/TreeLogger;Ljava/lang/String;Ljava/lang/String;)Ljava/io/PrintWriter;createSourceWriterj(Lcom/google/gwt/core/ext/GeneratorContext;Ljava/io/PrintWriter;)Lcom/google/gwt/user/rebind/SourceWriter;'com/google/gwt/user/rebind/SourceWriterindentprintlnjava/util/Listiterator()Ljava/util/Iterator;java/util/IteratorhasNext()Znext()Ljava/lang/Object;namegetteroutdentprintsetter getParameters0()[Lcom/google/gwt/core/ext/typeinfo/JParameter;+com/google/gwt/core/ext/typeinfo/JParameter*()Lcom/google/gwt/core/ext/typeinfo/JType;&com/google/gwt/core/ext/typeinfo/JType isPrimitive3()Lcom/google/gwt/core/ext/typeinfo/JPrimitiveType;/com/google/gwt/core/ext/typeinfo/JPrimitiveTypegetQualifiedBoxedSourceNamegetQualifiedSourceNamecommit'(Lcom/google/gwt/core/ext/TreeLogger;)V#getParameterizedQualifiedSourceNameprintStackTracejava/lang/String startsWith(Ljava/lang/String;)Z getReturnTypeBOOLEANjava/lang/Objectequals(Ljava/lang/Object;)Z substring(I)Ljava/lang/String;m(Lcom/aquait/utils/gwt/rebind/IntrospectionGenerator;Lcom/aquait/utils/gwt/rebind/IntrospectionGenerator$1;)Vlength()I toLowerCase(II)Ljava/lang/String;add getMethods-()[Lcom/google/gwt/core/ext/typeinfo/JMethod; getSuperclass/()Lcom/google/gwt/core/ext/typeinfo/JClassType;!Z[`ab3*c d efghb,-:::Y  : Y :Y     ,+:  !, :  *:  Y       :  y !:  Y"  # $   Y%  &' (  ) * +, -  . * / * / ) Y0    1   :   !:  Y"  # $   2324:5:9 Y6  2' 7 8 9 A Y6  2' 7  2324: 9  * +,! -  . * / * / ) ; <  =  > :  5 !:  Y?  # @  / * A * / ) +BYC  :EDc"H' )*+6-C/J0Q1X2_4689:IJKLM%N,ORPYQ`RlTuU|VWXYZ[\]^_`&a5b<cAdwfhijklmnopqrstu!v*w1x:yYz|}~dgij kl 5mn<opqj kl Y#qj C<kl rs tu vwxyzy6{yC|};~ efy t b: :FYGMFYGN*-+H-: I:'JK*'LKM5NO3':'LK6P:-:   I:  'QK~ 'PRm 3c!Y*S: T U#( YVU P # &  2, WWb,cR4ho&/58dz Uj kl oyy4kl:ef:vw2tu*u2t*b@,XN-:662:+WW,Y: *+Hc"'-38?d\  % k@ef@u@vw;3 w @^\Z!Z_PK ;bi"i"7com/aquait/utils/gwt/rebind/IntrospectionGenerator.java/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.aquait.utils.gwt.rebind; import com.google.gwt.core.ext.Generator; import com.google.gwt.core.ext.UnableToCompleteException; import java.io.PrintWriter; import com.google.gwt.core.ext.GeneratorContext; import com.google.gwt.core.ext.TreeLogger; import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.JMethod; import com.google.gwt.core.ext.typeinfo.JPrimitiveType; import com.google.gwt.core.ext.typeinfo.JType; import com.google.gwt.core.ext.typeinfo.NotFoundException; import com.google.gwt.user.rebind.ClassSourceFileComposerFactory; import com.google.gwt.user.rebind.SourceWriter; import java.util.ArrayList; import java.util.List; /** * * @author quique */ public class IntrospectionGenerator extends Generator { private class PropertyDescriptor { String name; JMethod getter; JMethod setter; } @Override public String generate(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException { try { JClassType classType = context.getTypeOracle().getType(typeName); String packageName = classType.getPackage().getName(); String simpleName = classType.getSimpleSourceName(); String simpleNameIntospection = classType.getSimpleSourceName() + "Introspection"; ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(packageName, simpleNameIntospection); composer.addImport("java.util.Collection"); composer.addImport("java.util.ArrayList"); composer.addImport("com.aquait.utils.gwt.introspection.Introspection"); composer.addImport("com.aquait.utils.gwt.introspection.Introspectable"); composer.addImplementedInterface("Introspection<" + packageName + "." + simpleName + ">"); PrintWriter printWriter = context.tryCreate(logger, packageName, simpleNameIntospection); if (printWriter != null) { SourceWriter source = composer.createSourceWriter(context, printWriter); source.indent(); // source.println("private " + packageName + "." + simpleName + " introspectable;"); // source.println(); // source.println("public void setIntrospectable(" + packageName + "." + simpleName + " introspectable) {"); // source.indent(); // source.println("this.introspectable = introspectable;"); // source.outdent(); // source.println("}"); // source.println(); // source.println("public " + packageName + "." + simpleName + " getIntrospectable() {"); // source.indent(); // source.println("return introspectable;"); // source.outdent(); // source.println("}"); // source.println(); List propertyDescriptors = findProperties(classType); source.println("public Object getProperty(" + packageName + "." + simpleName + " introspectable, String property) {"); source.indent(); for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { source.println("if (property.equals(\"" + propertyDescriptor.name + "\")) {"); source.indent(); source.println("return introspectable." + propertyDescriptor.getter.getName() + "();"); source.println(); source.outdent(); source.print("} else "); } source.println("{"); source.indent(); source.println("throw new IllegalArgumentException(property);"); source.outdent(); source.println("}"); source.outdent(); source.println("}"); source.println(); source.println("public void setProperty(" + packageName + "." + simpleName + " introspectable, String property, Object value) {"); source.indent(); for (PropertyDescriptor getterSetter : propertyDescriptors) { source.println("if (property.equals(\"" + getterSetter.name + "\")) {"); source.indent(); JType jType = getterSetter.setter.getParameters()[0].getType(); JPrimitiveType jPrimitiveType = jType.isPrimitive(); if (jPrimitiveType != null) { source.println("introspectable." + getterSetter.setter.getName() + "((" + jPrimitiveType.getQualifiedBoxedSourceName() + ")value);"); } else { source.println("introspectable." + getterSetter.setter.getName() + "((" + getterSetter.setter.getParameters()[0].getType().getQualifiedSourceName() + ")value);"); } source.outdent(); source.print("} else "); } source.println("{"); source.indent(); source.println("throw new IllegalArgumentException(property);"); source.outdent(); source.println("}"); source.outdent(); source.println("}"); source.println(); source.println("private Collection propertyNames = null;"); source.println("public Collection getPropertyNames() {"); source.indent(); source.println("if (propertyNames == null) {"); source.indent(); source.println("propertyNames = new ArrayList();"); for (PropertyDescriptor getterSetter : propertyDescriptors) { source.println("propertyNames.add(\"" + getterSetter.name + "\");"); } source.println("}"); source.outdent(); source.println("return propertyNames;"); source.outdent(); source.println("}"); source.println(); source.commit(logger); } return classType.getParameterizedQualifiedSourceName() + "Introspection"; } catch (NotFoundException e) { e.printStackTrace(); return null; } } private List findProperties(JClassType classType) { List propertyDescriptors = new ArrayList(); List methods = new ArrayList(); getAllMethods(methods, classType); // busco entre todos los métodos los que sean getXxx() o isXxx() for (JMethod getterMethod : methods) { if (getterMethod.getName().startsWith("get") || (getterMethod.getName().startsWith("is") && getterMethod.getReturnType().isPrimitive().equals(JPrimitiveType.BOOLEAN)) && getterMethod.getParameters().length == 0) { String getterName = getterMethod.getName(); int n = getterMethod.getName().startsWith("is") ? 2 : 3; String property = getterName.substring(n); for (JMethod setterMethod : methods) { if (setterMethod.getName().startsWith("set") && property.equals(setterMethod.getName().substring(3)) && setterMethod.getParameters().length == 1) { // encontré getXxx() (o isXxx()) y setXxx(val) => agrego xxx a la lista properties PropertyDescriptor pd = new PropertyDescriptor(); if (property.length() == 1) { pd.name = property.toLowerCase(); } else { // (property.length() > 1) pd.name = property.substring(0, 1).toLowerCase() + property.substring(1); } pd.getter = getterMethod; pd.setter = setterMethod; propertyDescriptors.add(pd); break; } } } } return propertyDescriptors; } private void getAllMethods(List methods, JClassType classType) { JMethod[] ms = classType.getMethods(); for (JMethod m : ms) { methods.add(m); } JClassType superClassType = classType.getSuperclass(); if (superClassType != null) { getAllMethods(methods, superClassType); } } } PK ;C5com/aquait/utils/gwt/rebind/ReflectionGenerator.class1 L        K  " "     "   B D K " ()VCodeLineNumberTableLocalVariableTablethis1Lcom/aquait/utils/gwt/rebind/ReflectionGenerator;generatet(Lcom/google/gwt/core/ext/TreeLogger;Lcom/google/gwt/core/ext/GeneratorContext;Ljava/lang/String;)Ljava/lang/String;iIpLjava/lang/String; jParameters.[Lcom/google/gwt/core/ext/typeinfo/JParameter;method*Lcom/google/gwt/core/ext/typeinfo/JMethod;i$Ljava/util/Iterator;source)Lcom/google/gwt/user/rebind/SourceWriter;methodsLjava/util/List; classType-Lcom/google/gwt/core/ext/typeinfo/JClassType; packageName simpleNamesimpleNameReflectioncomposer;Lcom/google/gwt/user/rebind/ClassSourceFileComposerFactory; printWriterLjava/io/PrintWriter;e4Lcom/google/gwt/core/ext/typeinfo/NotFoundException;logger$Lcom/google/gwt/core/ext/TreeLogger;context*Lcom/google/gwt/core/ext/GeneratorContext;typeNameLocalVariableTypeTable; Exceptions findMethods?(Lcom/google/gwt/core/ext/typeinfo/JClassType;)Ljava/util/List; Signaturek(Lcom/google/gwt/core/ext/typeinfo/JClassType;)Ljava/util/List;getAllPublicMethods@(Ljava/util/List;Lcom/google/gwt/core/ext/typeinfo/JClassType;)Vmarr$+[Lcom/google/gwt/core/ext/typeinfo/JMethod;len$mssuperClassTypel(Ljava/util/List;Lcom/google/gwt/core/ext/typeinfo/JClassType;)V SourceFileReflectionGenerator.java MN    java/lang/StringBuilder  Reflection 9com/google/gwt/user/rebind/ClassSourceFileComposerFactory Mjava.util.Collection java.util.ArrayList*com.aquait.utils.gwt.reflection.Reflection+com.aquait.utils.gwt.reflection.Reflectable3com.aquait.utils.gwt.reflection.InvocationException Reflection<.> public Object invoke(E target, String method, Object[] params) throws InvocationException { N xy  (com/google/gwt/core/ext/typeinfo/JMethodif ("".equals(method)) {if (  != params.length) {9throw new InvocationException("incompatible parameters"); N} N, (  )params[]try { void  target.); return null;return target.} catch(Exception ex) {3throw new InvocationException(ex.getMessage(), ex);=throw new InvocationException("method not found: " + method);    2com/google/gwt/core/ext/typeinfo/NotFoundException  Njava/util/ArrayList |}    /com/aquait/utils/gwt/rebind/ReflectionGenerator!com/google/gwt/core/ext/Generator1com/google/gwt/core/ext/UnableToCompleteException(com/google/gwt/core/ext/GeneratorContext getTypeOracle/()Lcom/google/gwt/core/ext/typeinfo/TypeOracle;+com/google/gwt/core/ext/typeinfo/TypeOraclegetTypeA(Ljava/lang/String;)Lcom/google/gwt/core/ext/typeinfo/JClassType;+com/google/gwt/core/ext/typeinfo/JClassType getPackage-()Lcom/google/gwt/core/ext/typeinfo/JPackage;)com/google/gwt/core/ext/typeinfo/JPackagegetName()Ljava/lang/String;getSimpleSourceNameappend-(Ljava/lang/String;)Ljava/lang/StringBuilder;toString'(Ljava/lang/String;Ljava/lang/String;)V addImport(Ljava/lang/String;)VaddImplementedInterface tryCreate_(Lcom/google/gwt/core/ext/TreeLogger;Ljava/lang/String;Ljava/lang/String;)Ljava/io/PrintWriter;createSourceWriterj(Lcom/google/gwt/core/ext/GeneratorContext;Ljava/io/PrintWriter;)Lcom/google/gwt/user/rebind/SourceWriter;'com/google/gwt/user/rebind/SourceWriterprintlnindentjava/util/Listiterator()Ljava/util/Iterator;java/util/IteratorhasNext()Znext()Ljava/lang/Object; getParameters0()[Lcom/google/gwt/core/ext/typeinfo/JParameter;(I)Ljava/lang/StringBuilder;outdent+com/google/gwt/core/ext/typeinfo/JParameter*()Lcom/google/gwt/core/ext/typeinfo/JType;&com/google/gwt/core/ext/typeinfo/JTypegetQualifiedSourceName getReturnTypejava/lang/Stringequals(Ljava/lang/Object;)Zcommit'(Lcom/google/gwt/core/ext/TreeLogger;)V#getParameterizedQualifiedSourceNameprintStackTrace getMethods-()[Lcom/google/gwt/core/ext/typeinfo/JMethod;isPublicadd getSuperclass/()Lcom/google/gwt/core/ext/typeinfo/JClassType;!KLMNO/*PQ RSTUO,-:::Y  : Y :Y     ,+:  5, :  Y      *:  :   !":  Y#  $ %   Y&  '()   * + , -.: ':6WY / :Y 0 212 3 (4 : 5  6278< Y9  $ 0  :  ;0 Y<  $ 0  :  + =  > + , + ,E ? + , - +@YA  :CBP9 !"#6%C'J(Q)X*_+f-/1234567%8,9P:W;`<g=p>w?{@ABCEAGHIJ.K:NgPnQwR~STUVWXYZ[\^acdeQ\VW{,XY%Z[\] ^_ (`a bc defYgY6hYCijOkl mnRSopqrsYt bu vwxyOhDYEM*,+F,PjklQ RSdebct buz{|}OH,GN-:66!2:H +IW,J: *+FP& pqr&s/q5w;x@yG{Q\ ~]- (W%^WHRSHbcHdeC; et HbuzPK ;Q#pss4com/aquait/utils/gwt/rebind/ReflectionGenerator.java/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.aquait.utils.gwt.rebind; import com.google.gwt.core.ext.Generator; import com.google.gwt.core.ext.GeneratorContext; import com.google.gwt.core.ext.TreeLogger; import com.google.gwt.core.ext.UnableToCompleteException; import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.JMethod; import com.google.gwt.core.ext.typeinfo.JParameter; import com.google.gwt.core.ext.typeinfo.NotFoundException; import com.google.gwt.user.rebind.ClassSourceFileComposerFactory; import com.google.gwt.user.rebind.SourceWriter; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; /** * * @author quique */ public class ReflectionGenerator extends Generator { @Override public String generate(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException { try { JClassType classType = context.getTypeOracle().getType(typeName); String packageName = classType.getPackage().getName(); String simpleName = classType.getSimpleSourceName(); String simpleNameReflection = classType.getSimpleSourceName() + "Reflection"; ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(packageName, simpleNameReflection); composer.addImport("java.util.Collection"); composer.addImport("java.util.ArrayList"); composer.addImport("com.aquait.utils.gwt.reflection.Reflection"); composer.addImport("com.aquait.utils.gwt.reflection.Reflectable"); composer.addImport("com.aquait.utils.gwt.reflection.InvocationException"); composer.addImplementedInterface("Reflection<" + packageName + "." + simpleName + ">"); PrintWriter printWriter = context.tryCreate(logger, packageName, simpleNameReflection); if (printWriter != null) { SourceWriter source = composer.createSourceWriter(context, printWriter); source.println("public Object invoke(" + packageName + "." + simpleName + " target, String method, Object[] params) throws InvocationException {"); source.indent(); List methods = findMethods(classType); for (JMethod method : methods) { source.println("if (\"" + method.getName() + "\".equals(method)) {"); source.indent(); source.println("if (" + method.getParameters().length + " != params.length) {"); source.indent(); source.println("throw new InvocationException(\"incompatible parameters\");"); source.outdent(); source.println("}"); source.println(); String p = ""; JParameter[] jParameters = method.getParameters(); for (int i = 0; i < jParameters.length; i++) { if (i > 0) { p += ", "; } p += "(" + jParameters[i].getType().getQualifiedSourceName() + ")params[" + i + "]"; } source.println("try {"); source.indent(); if (method.getReturnType().getQualifiedSourceName().equals("void")) { source.println("target." + method.getName() + "(" + p + ");"); source.println("return null;"); } else { source.println("return target." + method.getName() + "(" + p + ");"); } source.outdent(); source.println("} catch(Exception ex) {"); source.indent(); source.println("throw new InvocationException(ex.getMessage(), ex);"); source.outdent(); source.println("}"); source.outdent(); source.println("}"); } source.println("throw new InvocationException(\"method not found: \" + method);"); source.outdent(); source.println("}"); source.println(); source.commit(logger); } return classType.getParameterizedQualifiedSourceName() + "Reflection"; } catch (NotFoundException e) { e.printStackTrace(); return null; } } private List findMethods(JClassType classType) { List methods = new ArrayList(); getAllPublicMethods(methods, classType); return methods; } private void getAllPublicMethods(List methods, JClassType classType) { JMethod[] ms = classType.getMethods(); for (JMethod m : ms) { if (m.isPublic()) { methods.add(m); } } JClassType superClassType = classType.getSuperclass(); if (superClassType != null) { getAllPublicMethods(methods, superClassType); } } } PK ;  9com/aquait/utils/gwt/reflection/InvocationException.class1    (Ljava/lang/Throwable;)VCodeLineNumberTableLocalVariableTablethis5Lcom/aquait/utils/gwt/reflection/InvocationException;causeLjava/lang/Throwable;*(Ljava/lang/String;Ljava/lang/Throwable;)VmessageLjava/lang/String;(Ljava/lang/String;)V()V SourceFileInvocationException.java    3com/aquait/utils/gwt/reflection/InvocationExceptionjava/lang/Exception! >*+    I*+,    >*+    3*   PK ;N&İ8com/aquait/utils/gwt/reflection/InvocationException.java/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.aquait.utils.gwt.reflection; /** * * @author quique */ public class InvocationException extends Exception { public InvocationException(Throwable cause) { super(cause); } public InvocationException(String message, Throwable cause) { super(message, cause); } public InvocationException(String message) { super(message); } public InvocationException() { } } PK ;]p1com/aquait/utils/gwt/reflection/Reflectable.class1 SourceFileReflectable.java+com/aquait/utils/gwt/reflection/Reflectablejava/lang/ObjectPK ;V0com/aquait/utils/gwt/reflection/Reflectable.java/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.aquait.utils.gwt.reflection; /** * * @author quique */ public interface Reflectable { } PK ;+Ƣ0com/aquait/utils/gwt/reflection/Reflection.class1  invokef(Lcom/aquait/utils/gwt/reflection/Reflectable;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object; Exceptions Signature<(TI;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;DLjava/lang/Object; SourceFileReflection.java*com/aquait/utils/gwt/reflection/Reflectionjava/lang/Object3com/aquait/utils/gwt/reflection/InvocationException  PK ;ef2@@/com/aquait/utils/gwt/reflection/Reflection.java/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.aquait.utils.gwt.reflection; /** * * @author quique */ public interface Reflection { Object invoke(I target, String methodName, Object... params) throws InvocationException; } PK ; AMETA-INF/PK ;Z!ff+META-INF/MANIFEST.MFPK ;Acom/PK ; Acom/aquait/PK ;Acom/aquait/utils/PK ;A=com/aquait/utils/gwt/PK ;#Apcom/aquait/utils/gwt/introspection/PK ;Acom/aquait/utils/gwt/rebind/PK ; Acom/aquait/utils/gwt/reflection/PK ;&ݸ*)com/aquait/utils/gwt/Introspection.gwt.xmlPK ;'com/aquait/utils/gwt/Reflection.gwt.xmlPK ;D7com/aquait/utils/gwt/introspection/Introspectable.classPK ; &16com/aquait/utils/gwt/introspection/Introspectable.javaPK ;x.}6com/aquait/utils/gwt/introspection/Introspection.classPK ;R 5 com/aquait/utils/gwt/introspection/Introspection.javaPK ;7: com/aquait/utils/gwt/rebind/IntrospectionGenerator$1.classPK ;Y)EEKU com/aquait/utils/gwt/rebind/IntrospectionGenerator$PropertyDescriptor.classPK ; 8com/aquait/utils/gwt/rebind/IntrospectionGenerator.classPK ;bi"i"72com/aquait/utils/gwt/rebind/IntrospectionGenerator.javaPK ;C5Ucom/aquait/utils/gwt/rebind/ReflectionGenerator.classPK ;Q#pss4ocom/aquait/utils/gwt/rebind/ReflectionGenerator.javaPK ;  9˃com/aquait/utils/gwt/reflection/InvocationException.classPK ;N&İ8/com/aquait/utils/gwt/reflection/InvocationException.javaPK ;]p1com/aquait/utils/gwt/reflection/Reflectable.classPK ;V0ncom/aquait/utils/gwt/reflection/Reflectable.javaPK ;+Ƣ0com/aquait/utils/gwt/reflection/Reflection.classPK ;ef2@@/ɍcom/aquait/utils/gwt/reflection/Reflection.javaPKF V