public ExecutableElement findExecutableElement(String name) { return ElementUtils.findExecutableElement(annotationType, name); }
public ExecutableElement findExecutableElement(String name) { return ElementUtils.findExecutableElement(annotationType, name); }
private CodeAnnotationMirror createExplodeLoop() { DeclaredType explodeLoopType = context.getDeclaredType(ExplodeLoop.class); CodeAnnotationMirror explodeLoop = new CodeAnnotationMirror(explodeLoopType); DeclaredType loopExplosionKind = context.getDeclaredType(ExplodeLoop.LoopExplosionKind.class); if (loopExplosionKind != null) { VariableElement kindValue = ElementUtils.findVariableElement(loopExplosionKind, "FULL_EXPLODE_UNTIL_RETURN"); if (kindValue != null) { explodeLoop.setElementValue(ElementUtils.findExecutableElement(explodeLoopType, "kind"), new CodeAnnotationValue(kindValue)); } } return explodeLoop; }
private CodeTypeElement generateWrapperAndFactory(ProcessorContext context, Element e) { CodeTypeElement wrapper = generateWrapper(context, e, false); if (wrapper == null) { return null; } CodeTypeElement factory = generateFactory(context, e, wrapper); // add @SuppressWarnings("deprecation") DeclaredType suppressWarnings = context.getDeclaredType(SuppressWarnings.class); CodeAnnotationMirror suppressWarningsAnnotation = new CodeAnnotationMirror(suppressWarnings); suppressWarningsAnnotation.setElementValue(ElementUtils.findExecutableElement(suppressWarnings, "value"), new CodeAnnotationValue(Arrays.asList(new CodeAnnotationValue("deprecation")))); factory.getAnnotationMirrors().add(suppressWarningsAnnotation); wrapper.getModifiers().add(Modifier.STATIC); factory.add(wrapper); assertNoErrorExpected(e); return factory; }
ExecutableElement createWrapper = ElementUtils.findExecutableElement(instrumentableNode, CREATE_WRAPPER_NAME);
descriptors.getImplements().add(optionDescriptorsType); ExecutableElement get = ElementUtils.findExecutableElement(optionDescriptorsType, "get"); CodeExecutableElement getMethod = CodeExecutableElement.clone(processingEnv, get); getMethod.getModifiers().remove(ABSTRACT); CodeExecutableElement iteratorMethod = CodeExecutableElement.clone(processingEnv, ElementUtils.findExecutableElement(optionDescriptorsType, "iterator")); iteratorMethod.getModifiers().remove(ABSTRACT); builder = iteratorMethod.createBuilder();