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 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; }
private int printField(PrintWriter pw, JavaField field, int indent, AnnotationDocletTag tag) throws Exception { indenter(pw, indent); pw.println("<field name=\"" + field.getName() + "\">"); indent++; XmlAnnotationVisitor visitor = new XmlAnnotationVisitor(indent, pw); if (tag.getAnnotation().jjtGetNumChildren() > 0) tag.getAnnotation().jjtGetChild(0).jjtAccept(visitor, null); indent--; indenter(pw, indent); pw.println("</field>"); return indent; }
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; }
final public void Annotation() throws ParseException { ASTAnnotation jjtn000 = new ASTAnnotation(JJTANNOTATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);Token tok; jj_consume_token(9); tok = jj_consume_token(IDENTIFIER); jjtn000.setIdentifier(tok.image); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 10:
public Object visit(ASTAnnotation node, Object data) { System.out.println(indentString() + node); ++indent; data = node.childrenAccept(this, data); --indent; return data; }
private int printConstructor(PrintWriter pw, JavaMethod method, int indent, AnnotationDocletTag tag) throws Exception { indenter(pw, indent); pw.print("<constructor expr=\""); pw.print(method.getName() + "("); boolean first = true; for (int k = 0; k < method.getParameters().length; k++) { JavaParameter param = method.getParameters()[k]; if (!first) pw.print(", "); else first = false; pw.print(param.getType().toString()); } pw.println(")\">"); indent++; XmlAnnotationVisitor visitor = new XmlAnnotationVisitor(indent, pw); if (tag.getAnnotation().jjtGetNumChildren() > 0) tag.getAnnotation().jjtGetChild(0).jjtAccept(visitor, null); indent--; indenter(pw, indent); pw.println("</constructor>"); return indent; } }
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; }
final public void Annotation() throws ParseException { ASTAnnotation jjtn000 = new ASTAnnotation(JJTANNOTATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);Token tok; jj_consume_token(9); tok = jj_consume_token(IDENTIFIER); jjtn000.setIdentifier(tok.image); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 10:
public Object visit(ASTAnnotation node, Object data) { System.out.println(indentString() + node); ++indent; data = node.childrenAccept(this, data); --indent; return data; }
String info = (annotation != null) ? annotation.getName() : node.getIdentifier(); if (log.isTraceEnabled()) log.trace("No ClassLoader provided, using TCCL: " + info); annotation = loader.loadClass(node.getIdentifier()); if (node.jjtGetNumChildren() > 0) Node contained = node.jjtGetChild(0); if (contained instanceof ASTSingleMemberValue)
private int printMethod(PrintWriter pw, JavaMethod method, int indent, AnnotationDocletTag tag) throws Exception { indenter(pw, indent); pw.print("<method expr=\""); pw.print(method.getReturns().toString()); pw.print(" " + method.getName() + "("); boolean first = true; for (int k = 0; k < method.getParameters().length; k++) { JavaParameter param = method.getParameters()[k]; if (!first) pw.print(", "); else first = false; pw.print(param.getType().toString()); } pw.println(")\">"); indent++; XmlAnnotationVisitor visitor = new XmlAnnotationVisitor(indent, pw); if (tag.getAnnotation().jjtGetNumChildren() > 0) tag.getAnnotation().jjtGetChild(0).jjtAccept(visitor, null); indent--; indenter(pw, indent); pw.println("</method>"); return indent; }
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; }
annotations.addAnnotation(methods[i], introduction.getAnnotation().getIdentifier(), introduction.getOriginalAnnotationExpr());
annotation = loader.loadClass(node.getIdentifier()); if (node.jjtGetNumChildren() > 0) Node contained = node.jjtGetChild(0); if (contained instanceof ASTSingleMemberValue)
indent++; XmlAnnotationVisitor visitor = new XmlAnnotationVisitor(indent, pw); if (tag.getAnnotation().jjtGetNumChildren() > 0) tag.getAnnotation().jjtGetChild(0).jjtAccept(visitor, null); indent--; indenter(pw, indent);
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());
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());