JClassType returnType = method.getReturnType().isClassOrInterface(); assert returnType != null; DefaultExtensions annotation = returnType.findAnnotationInTypeHierarchy(DefaultExtensions.class); String[] extensions; if (annotation != null) {
@Override public boolean isAnnotationPresent(Class<? extends Annotation> annotClass) { return type.findAnnotationInTypeHierarchy(annotClass) != null; } }
@Override public boolean isAnnotationPresent(Class<? extends Annotation> annotClass) { return type.findAnnotationInTypeHierarchy(annotClass) != null; } }
public boolean isAnnotationPresent(Class<? extends Annotation> annotClass) { return type.findAnnotationInTypeHierarchy(annotClass) != null; } }
public boolean isAnnotationPresent(Class<? extends Annotation> annotClass) { return type.findAnnotationInTypeHierarchy(annotClass) != null; } }
@Override public <A extends Annotation> A getAnnotation(Class<A> annotClass) { return type.findAnnotationInTypeHierarchy(annotClass); }
@Override public <A extends Annotation> A getAnnotation(Class<A> annotClass) { return type.findAnnotationInTypeHierarchy(annotClass); }
public <A extends Annotation> A getAnnotation(Class<A> annotClass) { return type.findAnnotationInTypeHierarchy(annotClass); }
public <A extends Annotation> A getAnnotation(Class<A> annotClass) { return type.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); }
public <A extends Annotation> A getAnnotation(Class<A> annotClass) { A annot = method.getAnnotation(annotClass); if (annot != null) { return annot; } return method.getEnclosingType().findAnnotationInTypeHierarchy(annotClass); }
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); }
/** * Given a JMethod, find the a ResourceGenerator class that will be able to * provide an implementation of the method. */ private Class<? extends ResourceGenerator> findResourceGenerator( TreeLogger logger, JMethod method) throws UnableToCompleteException { JClassType resourceType = method.getReturnType().isClassOrInterface(); assert resourceType != null; ResourceGeneratorType annotation = resourceType.findAnnotationInTypeHierarchy(ResourceGeneratorType.class); if (annotation == null) { logger.log(TreeLogger.ERROR, "No @" + ResourceGeneratorType.class.getName() + " was specifed for type " + resourceType.getQualifiedSourceName() + " or its supertypes"); throw new UnableToCompleteException(); } return annotation.value(); }
/** * Given a JMethod, find the a ResourceGenerator class that will be able to * provide an implementation of the method. */ private Class<? extends ResourceGenerator> findResourceGenerator( TreeLogger logger, JMethod method) throws UnableToCompleteException { JClassType resourceType = method.getReturnType().isClassOrInterface(); assert resourceType != null; ResourceGeneratorType annotation = resourceType.findAnnotationInTypeHierarchy(ResourceGeneratorType.class); if (annotation == null) { logger.log(TreeLogger.ERROR, "No @" + ResourceGeneratorType.class.getName() + " was specifed for type " + resourceType.getQualifiedSourceName() + " or its supertypes"); throw new UnableToCompleteException(); } return annotation.value(); }
JClassType returnType = method.getReturnType().isClassOrInterface(); assert returnType != null; DefaultExtensions annotation = returnType.findAnnotationInTypeHierarchy(DefaultExtensions.class); String[] extensions; if (annotation != null) {
JClassType returnType = method.getReturnType().isClassOrInterface(); assert returnType != null; DefaultExtensions annotation = returnType.findAnnotationInTypeHierarchy(DefaultExtensions.class); String[] extensions; if (annotation != null) {
private String generateGenericValidator(final TreeLogger logger, final GeneratorContext context, final JClassType validatorType) throws UnableToCompleteException { final String typeName = validatorType.getName(); final GwtValidation gwtValidation = validatorType.findAnnotationInTypeHierarchy(GwtValidation.class); if (gwtValidation == null) { logger.log(TreeLogger.ERROR, typeName + " must be anntotated with " + GwtValidation.class.getCanonicalName(), null); throw new UnableToCompleteException(); } if (gwtValidation.groups().length == 0) { logger.log(TreeLogger.ERROR, "The @" + GwtValidation.class.getSimpleName() + " of " + typeName + "must specify at least one validation group.", null); throw new UnableToCompleteException(); } validGroups = gwtValidation.groups(); final TreeLogger validatorLogger = logger.branch(TreeLogger.DEBUG, "Generating Validator for '" + validatorType.getQualifiedSourceName() + "'", null); final AbstractCreator creator = new ValidatorCreator(validatorType, gwtValidation, validatorLogger, context, cache); return creator.create(); }
String typeName = validatorType.getName(); GwtValidation gwtValidation = validatorType.findAnnotationInTypeHierarchy(GwtValidation.class);
String typeName = validatorType.getName(); GwtValidation gwtValidation = validatorType.findAnnotationInTypeHierarchy(GwtValidation.class);