public Object visit(ASTAnnotation node, Object data) { try { Class subAnnotation = Thread.currentThread().getContextClassLoader().loadClass(node.getIdentifier()); typeValue = createAnnotation(node, subAnnotation); } catch (Exception e) { throw new RuntimeException(e); } return null; }
public Object visit(ASTAnnotation node, Object data) { try { Class<?> subAnnotation = loader.loadClass(node.getIdentifier()); typeValue = createAnnotation(node, subAnnotation); } catch (Exception e) { throw new RuntimeException(e); } return null; }
public Object visit(ASTAnnotation node, Object data) { pw.println(""); indent++; XmlAnnotationCompiler.indenter(pw, indent); pw.println("<annotation tag=\"" + node.getIdentifier() + "\">"); indent++; node.childrenAccept(this, data); indent--; XmlAnnotationCompiler.indenter(pw, indent); pw.println("</annotation>"); indent--; XmlAnnotationCompiler.indenter(pw, indent); return null; }
public Object visit(ASTAnnotation node, Object data) { try { CtClass annotation = pool.get(node.getIdentifier()); javassist.bytecode.annotation.Annotation info = new javassist.bytecode.annotation.Annotation(cp, annotation); AnnotationInfoCreator creator = new AnnotationInfoCreator(pool, cp, info); node.childrenAccept(creator, data); AnnotationMemberValue mv = (AnnotationMemberValue) data; mv.setValue(info); } catch (NotFoundException e) { throw new RuntimeException(e); //To change body of catch statement use Options | File Templates. } return null; }
public static javassist.bytecode.annotation.Annotation createAnnotationInfo(ClassPool pool, ConstPool cp, ASTAnnotation node) throws Exception { CtClass annotation = pool.get(node.getIdentifier()); javassist.bytecode.annotation.Annotation info = new javassist.bytecode.annotation.Annotation(cp, annotation); AnnotationInfoCreator creator = new AnnotationInfoCreator(pool, cp, info); if (node.jjtGetNumChildren() > 0) { node.jjtGetChild(0).jjtAccept(creator, null); } return info; }
annotations.addAnnotation(methods[i], introduction.getAnnotation().getIdentifier(), introduction.getOriginalAnnotationExpr());
String info = (annotation != null) ? annotation.getName() : node.getIdentifier(); if (log.isTraceEnabled()) log.trace("No ClassLoader provided, using TCCL: " + info); annotation = loader.loadClass(node.getIdentifier());
annotations.addClassAnnotation(introduction.getAnnotation().getIdentifier(), introduction.getOriginalAnnotationExpr()); annotations.addAnnotation(fields[i], introduction.getAnnotation().getIdentifier(), introduction.getOriginalAnnotationExpr()); annotations.addAnnotation(cons[i], introduction.getAnnotation().getIdentifier(), introduction.getOriginalAnnotationExpr());
annotation = loader.loadClass(node.getIdentifier());
advisor.getAnnotations().addClassAnnotation(introduction.getAnnotation().getIdentifier(), introduction.getOriginalAnnotationExpr()); advisor.getAnnotations().addAnnotation(methods[i], introduction.getAnnotation().getIdentifier()); advisor.getAnnotations().addAnnotation(cons[i], introduction.getAnnotation().getIdentifier()); advisor.getAnnotations().addAnnotation(fields[i], introduction.getAnnotation().getIdentifier());