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; }
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; }
/** 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); }
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; } }
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; }
public static String getFullName(JMethod method) { return method.getEnclosingType().getName() + "." + method.getJsniSignature(false, true); }
public JMethod getStaticImpl(JMethod method) { JMethod staticImpl = instanceToStaticMap.get(method); assert staticImpl == null || staticImpl.getEnclosingType().getMethods().contains(staticImpl); return staticImpl; }
public static String getFullName(JMethod method) { return method.getEnclosingType().getName() + "." + getJsniSig(method); }