@Override public boolean matches(E element) { return super.matches(element) && element.getAnnotation(annotationType) != null; } }
if (elts.size() > 0) elts.get(0).getAnnotations().remove( elts.get(0).getAnnotation( getFactory().Type().createReference( Service.class))); LifeCycle annot = elt.getAnnotation(LifeCycle.class);
if (typeMember.getAnnotation(Parameter.class) != null) { if (typeMember.getAnnotation(Local.class) != null) {
/** * Adds an annotation to an element. * * @param element * the program element to annotate * @param annotationType * the annotation type * @return the concerned annotation */ public <A extends Annotation> CtAnnotation<A> annotate(CtElement element, CtTypeReference<A> annotationType) { CtAnnotationType<A> ctAnnotationType = ((CtAnnotationType<A>) annotationType.getDeclaration()); boolean isRepeatable = false; if (ctAnnotationType != null) { isRepeatable = (ctAnnotationType.getAnnotation(factory.Type().createReference(Repeatable.class)) != null); } CtAnnotation<A> annotation = element.getAnnotation(annotationType); if (annotation == null || isRepeatable) { annotation = factory.Core().createAnnotation(); annotation.setAnnotationType(factory.Core().clone(annotationType)); element.addAnnotation(annotation); } return annotation; }
@Override public boolean matches(E element) { return super.matches(element) && element.getAnnotation(annotationType) != null; } }
private static String getStageName(CtElement element) { return element.getAnnotation(element.getFactory().Type().createReference(Stage.class)) .getElementValue("value"); }
/** * Remove template-specific {@link Local} annotations. */ @Override public void scanCtElement(CtElement e) { CtAnnotation<?> a = e.getAnnotation(e.getFactory().Type().createReference(Local.class)); if (a != null) { e.removeAnnotation(a); } super.scanCtElement(e); }
Parameter param = ref.getDeclaration().getAnnotation(Parameter.class); ParameterMatcher instance; if (param == null) {
CtAnnotation<A> annotation = element.getAnnotation(factory.Type().createReference(annotationType)); if (annotation == null) { annotation = factory.Core().createAnnotation();
/** * Adds an annotation to an element. * * @param element * the program element to annotate * @param annotationType * the annotation type * @return the concerned annotation */ public <A extends Annotation> CtAnnotation<A> annotate(CtElement element, Class<A> annotationType) { CtAnnotation<A> annotation = element.getAnnotation(factory.Type().createReference(annotationType)); if (annotation == null) { annotation = factory.Core().createAnnotation(); annotation.setAnnotationType(factory.Type().createReference(annotationType)); element.addAnnotation(annotation); } return annotation; }