private void visitAnnotations(AnnotatedNode targetNode, AnnotatedNode sourceNode, Object visitor) { for (AnnotationNode an : sourceNode.getAnnotations()) { // skip built-in properties if (an.isBuiltIn()) continue; if (an.hasSourceRetention()) continue; AnnotationVisitor av = getAnnotationVisitor(targetNode, an, visitor); visitAnnotationAttributes(an, av); av.visitEnd(); } }
AnnotationVisitor av2 = av.visitAnnotation((String) entry.getKey(), BytecodeHelper.getTypeDescription(atNode.getClassNode())); visitAnnotationAttributes(atNode, av2); av2.visitEnd();
private void visitParameterAnnotations(Parameter parameter, int paramNumber, MethodVisitor mv) { for (AnnotationNode an : parameter.getAnnotations()) { // skip built-in properties if (an.isBuiltIn()) continue; if (an.hasSourceRetention()) continue; final String annotationDescriptor = BytecodeHelper.getTypeDescription(an.getClassNode()); AnnotationVisitor av = mv.visitParameterAnnotation(paramNumber, annotationDescriptor, an.hasRuntimeRetention()); visitAnnotationAttributes(an, av); av.visitEnd(); } }
private void visitAnnotationArrayElement(Expression expr, int arrayElementType, AnnotationVisitor av) { switch (arrayElementType) { case 1: AnnotationNode atAttr = (AnnotationNode) ((AnnotationConstantExpression) expr).getValue(); AnnotationVisitor av2 = av.visitAnnotation(null, BytecodeHelper.getTypeDescription(atAttr.getClassNode())); visitAnnotationAttributes(atAttr, av2); av2.visitEnd(); break; case 2: av.visit(null, ((ConstantExpression) expr).getValue()); break; case 3: av.visit(null, Type.getType(BytecodeHelper.getTypeDescription(expr.getType()))); break; case 4: PropertyExpression propExpr = (PropertyExpression) expr; av.visitEnum(null, BytecodeHelper.getTypeDescription(propExpr.getObjectExpression().getType()), String.valueOf(((ConstantExpression) propExpr.getProperty()).getValue())); break; } }
AnnotationNode value = (AnnotationNode) avExp.getValue(); AnnotationVisitor avc = av.visitAnnotation(null, BytecodeHelper.getTypeDescription(avExp.getType())); visitAnnotationAttributes(value, avc); } else { throw new GroovyBugError("unexpected annotation type " + type.getName());
private void visitAnnotations(AnnotatedNode targetNode, Object visitor) { Map annotionMap = targetNode.getAnnotations(); if (annotionMap.isEmpty()) return; Iterator it = annotionMap.values().iterator(); while (it.hasNext()) { AnnotationNode an = (AnnotationNode) it.next(); //skip builtin properties if (an.isBuiltIn()) continue; if (an.hasSourceRetention()) continue; AnnotationVisitor av = getAnnotationVisitor(targetNode, an, visitor); visitAnnotationAttributes(an, av); av.visitEnd(); } }
private void visitAnnotations(AnnotatedNode targetNode, Object visitor) { List annotions = targetNode.getAnnotations(); if (annotions.isEmpty()) return; Iterator it = annotions.iterator(); while (it.hasNext()) { AnnotationNode an = (AnnotationNode) it.next(); //skip builtin properties if (an.isBuiltIn()) continue; if (an.hasSourceRetention()) continue; AnnotationVisitor av = getAnnotationVisitor(targetNode, an, visitor); visitAnnotationAttributes(an, av); av.visitEnd(); } }
private void visitAnnotations(AnnotatedNode targetNode, Object visitor) { List annotations = targetNode.getAnnotations(); if (annotations.isEmpty()) return; Iterator it = annotations.iterator(); while (it.hasNext()) { AnnotationNode an = (AnnotationNode) it.next(); // skip built-in properties if (an.isBuiltIn()) continue; if (an.hasSourceRetention()) continue; AnnotationVisitor av = getAnnotationVisitor(targetNode, an, visitor); visitAnnotationAttributes(an, av); av.visitEnd(); } }
private void visitParameterAnnotations(Parameter parameter, int paramNumber, MethodVisitor mv) { Map annotionMap = parameter.getAnnotations(); if (annotionMap.isEmpty()) return; Iterator it = annotionMap.values().iterator(); while (it.hasNext()) { AnnotationNode an = (AnnotationNode) it.next(); //skip builtin properties if (an.isBuiltIn()) continue; if (an.hasSourceRetention()) continue; final String annotationDescriptor = BytecodeHelper.getTypeDescription(an.getClassNode()); AnnotationVisitor av = mv.visitParameterAnnotation(paramNumber, annotationDescriptor, an.hasRuntimeRetention()); visitAnnotationAttributes(an, av); av.visitEnd(); } }
private void visitParameterAnnotations(Parameter parameter, int paramNumber, MethodVisitor mv) { List annotations = parameter.getAnnotations(); if (annotations.isEmpty()) return; Iterator it = annotations.iterator(); while (it.hasNext()) { AnnotationNode an = (AnnotationNode) it.next(); // skip built-in properties if (an.isBuiltIn()) continue; if (an.hasSourceRetention()) continue; final String annotationDescriptor = BytecodeHelper.getTypeDescription(an.getClassNode()); AnnotationVisitor av = mv.visitParameterAnnotation(paramNumber, annotationDescriptor, an.hasRuntimeRetention()); visitAnnotationAttributes(an, av); av.visitEnd(); } }
AnnotationVisitor av2 = av.visitAnnotation((String) entry.getKey(), BytecodeHelper.getTypeDescription(atNode.getClassNode())); visitAnnotationAttributes(atNode, av2); av2.visitEnd();
private void visitParameterAnnotations(Parameter parameter, int paramNumber, MethodVisitor mv) { List annotions = parameter.getAnnotations(); if (annotions.isEmpty()) return; Iterator it = annotions.iterator(); while (it.hasNext()) { AnnotationNode an = (AnnotationNode) it.next(); //skip builtin properties if (an.isBuiltIn()) continue; if (an.hasSourceRetention()) continue; final String annotationDescriptor = BytecodeHelper.getTypeDescription(an.getClassNode()); AnnotationVisitor av = mv.visitParameterAnnotation(paramNumber, annotationDescriptor, an.hasRuntimeRetention()); visitAnnotationAttributes(an, av); av.visitEnd(); } }
AnnotationVisitor av2 = av.visitAnnotation((String) entry.getKey(), BytecodeHelper.getTypeDescription(atNode.getClassNode())); visitAnnotationAttributes(atNode, av2); av2.visitEnd();
private void visitAnnotations(AnnotatedNode targetNode, Object visitor) { for (AnnotationNode an : targetNode.getAnnotations()) { // skip built-in properties if (an.isBuiltIn()) continue; if (an.hasSourceRetention()) continue; AnnotationVisitor av = getAnnotationVisitor(targetNode, an, visitor); visitAnnotationAttributes(an, av); av.visitEnd(); } }
AnnotationVisitor av2 = av.visitAnnotation((String) entry.getKey(), BytecodeHelper.getTypeDescription(atNode.getClassNode())); visitAnnotationAttributes(atNode, av2); av2.visitEnd();
private void visitParameterAnnotations(Parameter parameter, int paramNumber, MethodVisitor mv) { for (AnnotationNode an : parameter.getAnnotations()) { // skip built-in properties if (an.isBuiltIn()) continue; if (an.hasSourceRetention()) continue; final String annotationDescriptor = BytecodeHelper.getTypeDescription(an.getClassNode()); AnnotationVisitor av = mv.visitParameterAnnotation(paramNumber, annotationDescriptor, an.hasRuntimeRetention()); visitAnnotationAttributes(an, av); av.visitEnd(); } }
AnnotationNode value = (AnnotationNode) avExp.getValue(); AnnotationVisitor avc = av.visitAnnotation(null, BytecodeHelper.getTypeDescription(avExp.getType())); visitAnnotationAttributes(value,avc); } else { throw new GroovyBugError("unexpected annotation type " + type.getName());
AnnotationNode value = (AnnotationNode) avExp.getValue(); AnnotationVisitor avc = av.visitAnnotation(null, BytecodeHelper.getTypeDescription(avExp.getType())); visitAnnotationAttributes(value,avc); } else { throw new GroovyBugError("unexpected annotation type " + type.getName());
private void visitAnnotationArrayElement(Expression expr, int arrayElementType, AnnotationVisitor av) { switch (arrayElementType) { case 1: AnnotationNode atAttr = (AnnotationNode) ((AnnotationConstantExpression) expr).getValue(); AnnotationVisitor av2 = av.visitAnnotation(null, BytecodeHelper.getTypeDescription(atAttr.getClassNode())); visitAnnotationAttributes(atAttr, av2); av2.visitEnd(); break; case 2: av.visit(null, ((ConstantExpression) expr).getValue()); break; case 3: av.visit(null, Type.getType(BytecodeHelper.getTypeDescription(expr.getType()))); break; case 4: PropertyExpression propExpr = (PropertyExpression) expr; av.visitEnum(null, BytecodeHelper.getTypeDescription(propExpr.getObjectExpression().getType()), String.valueOf(((ConstantExpression) propExpr.getProperty()).getValue())); break; } }
AnnotationNode value = (AnnotationNode) avExp.getValue(); AnnotationVisitor avc = av.visitAnnotation(null, BytecodeHelper.getTypeDescription(avExp.getType())); visitAnnotationAttributes(value,avc); } else { throw new GroovyBugError("unexpected annotation type " + type.getName());