コード例 #1
0
ファイル: JProgram.java プロジェクト: imatellan/gwt
  public static boolean isClinit(JMethod method) {
    JDeclaredType enclosingType = method.getEnclosingType();

    boolean isClinit = enclosingType != null && method == enclosingType.getClinitMethod();
    assert !isClinit || method.getName().equals(GwtAstBuilder.CLINIT_NAME);
    return isClinit;
  }
コード例 #2
0
 private <T extends Annotation> T findAnnotationOnMethodOrEnclosingType(
     final JMethod method, final Class<T> annotationType) {
   T annotation = method.getAnnotation(annotationType);
   if (annotation == null) {
     annotation = method.getEnclosingType().getAnnotation(annotationType);
   }
   return annotation;
 }
コード例 #3
0
ファイル: JDeclaredType.java プロジェクト: hammoum/gwt
 /** Adds a method to this type. */
 public final void addMethod(JMethod method) {
   assert method.getEnclosingType() == this;
   assert !method.getName().equals("$clinit") || getMethods().size() == 0
       : "Attempted adding " + "$clinit method with index != 0";
   assert !method.getName().equals("$init") || getMethods().size() == 1
       : "Attempted adding $init " + "method with index != 1";
   methods = Lists.add(methods, method);
 }
コード例 #4
0
ファイル: JProgram.java プロジェクト: hammoum/gwt
 public static boolean isClinit(JMethod method) {
   JDeclaredType enclosingType = method.getEnclosingType();
   if ((enclosingType != null) && (method == enclosingType.getClinitMethod())) {
     assert (method.getName().equals("$clinit"));
     return true;
   } else {
     return false;
   }
 }
コード例 #5
0
ファイル: JProgram.java プロジェクト: imatellan/gwt
  public static boolean isInit(JMethod method) {
    JDeclaredType enclosingType = method.getEnclosingType();

    if (method.isStatic()) {
      // Hack, check the name.
      return method.getName().equals(GwtAstBuilder.STATIC_INIT_NAME);
    }

    boolean isInit = enclosingType != null && method == enclosingType.getInitMethod();
    assert !isInit || method.getName().equals(GwtAstBuilder.INIT_NAME);
    return isInit;
  }
コード例 #6
0
ファイル: JProgram.java プロジェクト: imatellan/gwt
 public static String getFullName(JMethod method) {
   return method.getEnclosingType().getName() + "." + method.getJsniSignature(false, true);
 }
コード例 #7
0
ファイル: JProgram.java プロジェクト: imatellan/gwt
 public JMethod getStaticImpl(JMethod method) {
   JMethod staticImpl = instanceToStaticMap.get(method);
   assert staticImpl == null || staticImpl.getEnclosingType().getMethods().contains(staticImpl);
   return staticImpl;
 }
コード例 #8
0
ファイル: JProgram.java プロジェクト: hammoum/gwt
 public static String getFullName(JMethod method) {
   return method.getEnclosingType().getName() + "." + getJsniSig(method);
 }