private boolean hasSharedAnnotation(JMethod method) { JClassType enclosingType = method.getEnclosingType(); Shared shared = enclosingType.getAnnotation(Shared.class); return shared != null; } }
private String source(JMethod o) { return o.getEnclosingType().getQualifiedSourceName(); } });
private static String key(JMethod method) { return method.getEnclosingType().getQualifiedSourceName() + "." + method.getName(); }
JClassType bundleType = method.getEnclosingType(); try { for (Map.Entry<JMethod, String> replacement : actualReplacements.entrySet()) { String qualifiedName = replacement.getKey().getEnclosingType().getQualifiedSourceName(); String baseName = replacement.getKey().getName(); writer.write(qualifiedName.replaceAll("[.$]", "-") + "-" + baseName);
/** * Add the type dependency requirements for a method, to the context. * * @param context * @param method */ private static void addTypeRequirementsForMethod(ResourceContext context, JMethod method) { ClientBundleRequirements reqs = context.getRequirements(); if (reqs != null) { reqs.addTypeHierarchy(method.getEnclosingType()); reqs.addTypeHierarchy((JClassType) method.getReturnType()); } }
replacement = obfuscationStyle.getPrettyName(styleClass, method.getEnclosingType(), obfuscatedClassName); replacementsForSharedMethods.put(method, replacement);
if (method.getEnclosingType() == type) { Shared shared = type.getAnnotation(Shared.class); if (shared != null) {
String path = method.getEnclosingType().getPackage().getName().replace('.', '/') + '/'; URL preferredUrl = ResourceGeneratorUtil .tryFindResource(logger, context.getGeneratorContext(), context, path + preferredFile);
getPathRelativeToPackage(method.getEnclosingType().getPackage(), method.getName() + extension), locale); getPathRelativeToPackage(method.getEnclosingType().getPackage(), resource), locale);
private boolean hasSharedAnnotation(JMethod method) { JClassType enclosingType = method.getEnclosingType(); Shared shared = enclosingType.getAnnotation(Shared.class); return shared != null; } }
private void maybeHandleSharedMethod(JMethod method, String obfuscatedClassName) { JClassType enclosingType = method.getEnclosingType(); Shared shared = enclosingType.getAnnotation(Shared.class); if (shared != null) { replacementsForSharedMethods.put(method, obfuscatedClassName); } } }
private <T extends Annotation> T findAnnotationOnMethodOrEnclosingType(JMethod method, Class<T> annotationType) { T annotation = getAnnotation(method, annotationType); if (annotation == null) { annotation = getAnnotation(method.getEnclosingType(), annotationType); } return annotation; }
public <A extends Annotation> A getAnnotation(Class<A> annotClass) { A annot = method.getAnnotation(annotClass); if (annot != null) { return annot; } return method.getEnclosingType().findAnnotationInTypeHierarchy(annotClass); }
private <T extends Annotation> T findAnnotationOnMethodOrEnclosingType(JMethod method, Class<T> annotationType) { T annotation = getAnnotation(method, annotationType); if (annotation == null) { annotation = getAnnotation(method.getEnclosingType(), annotationType); } return annotation; }
@Override public <A extends Annotation> A getAnnotation(Class<A> annotClass) { A annot = method.getAnnotation(annotClass); if (annot != null) { return annot; } return method.getEnclosingType().findAnnotationInTypeHierarchy(annotClass); }
@Override public String getPackageName() { return delegate.getEnclosingType().getPackage().getName(); } }
@Override public String getPackageName() { return delegate.getEnclosingType().getPackage().getName(); } }
public <A extends Annotation> A getAnnotation(Class<A> annotClass) { A annot = method.getAnnotation(annotClass); if (annot != null) { return annot; } return method.getEnclosingType().findAnnotationInTypeHierarchy(annotClass); }
@Override public <A extends Annotation> A getAnnotation(Class<A> annotClass) { A annot = method.getAnnotation(annotClass); if (annot != null) { return annot; } return method.getEnclosingType().findAnnotationInTypeHierarchy(annotClass); }
private String getLogMessage(Object methodOrClass) { if (methodOrClass instanceof JMethod) { JMethod method = (JMethod) methodOrClass; return method.getEnclosingType().getQualifiedSourceName() + "#" + method.getName() + "()"; } JClassType classType = (JClassType) methodOrClass; return classType.getQualifiedSourceName(); }