/** * @param attrName the name * @param expression the expression * @param attrType the type */ protected void visitAnnotationExpression(String attrName, AnnotationConstantExpression expression, ClassNode attrType) { AnnotationNode annotationNode = (AnnotationNode) expression.getValue(); AnnotationVisitor visitor = new AnnotationVisitor(this.source, this.errorCollector); // TODO track Deprecated usage and give a warning? visitor.visit(annotationNode); }
/** * Resolve metadata and details of the annotation. * * @param unvisited the node to visit * @return the visited node */ private AnnotationNode visitAnnotation(AnnotationNode unvisited) { ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration()); AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector); AnnotationNode visited = visitor.visit(unvisited); this.source.getErrorCollector().addCollectorContents(errorCollector); return visited; }
private void visitConstructorOrMethod(MethodNode node, int methodTarget) { visitAnnotations(node, methodTarget); for (int i = 0; i < node.getParameters().length; i++) { Parameter parameter = node.getParameters()[i]; visitAnnotations(parameter, AnnotationNode.PARAMETER_TARGET); } if (this.currentClass.isAnnotationDefinition() && !node.isStaticConstructor()) { ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration()); AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector); visitor.setReportClass(currentClass); visitor.checkReturnType(node.getReturnType(), node); if (node.getParameters().length > 0) { addError("Annotation members may not have parameters.", node.getParameters()[0]); } if (node.getExceptions().length > 0) { addError("Annotation members may not have a throws clause.", node.getExceptions()[0]); } ReturnStatement code = (ReturnStatement) node.getCode(); if (code != null) { visitor.visitExpression(node.getName(), code.getExpression(), node.getReturnType()); visitor.checkCircularReference(currentClass, node.getReturnType(), code.getExpression()); } this.source.getErrorCollector().addCollectorContents(errorCollector); } Statement code = node.getCode(); if (code != null) { code.visit(this); } }
/** * @param attrName the name * @param expression the expression * @param attrType the type */ protected void visitAnnotationExpression(String attrName, AnnotationConstantExpression expression, ClassNode attrType) { AnnotationNode annotationNode = (AnnotationNode) expression.getValue(); AnnotationVisitor visitor = new AnnotationVisitor(this.source, this.errorCollector); // TODO track Deprecated usage and give a warning? visitor.visit(annotationNode); }
/** * @param attrName * @param expression * @param attrType */ protected void visitAnnotationExpression(String attrName, AnnotationConstantExpression expression, ClassNode attrType) { AnnotationNode annotationNode = (AnnotationNode) expression.getValue(); AnnotationVisitor visitor = new AnnotationVisitor(this.source, this.errorCollector); visitor.visit(annotationNode); }
/** * @param attrName * @param expression * @param attrType */ protected void visitAnnotationExpression(String attrName, AnnotationConstantExpression expression, Class attrType) { AnnotationNode annotationNode = (AnnotationNode) expression.getValue(); AnnotationVisitor visitor = new AnnotationVisitor(this.source, this.errorCollector); visitor.visit(annotationNode); }
/** * @param attrName * @param expression * @param attrType */ protected void visitAnnotationExpression(String attrName, AnnotationConstantExpression expression, ClassNode attrType) { AnnotationNode annotationNode = (AnnotationNode) expression.getValue(); AnnotationVisitor visitor = new AnnotationVisitor(this.source, this.errorCollector); // TODO track Deprecated usage and give a warning? visitor.visit(annotationNode); }
/** * Resolve metadata and details of the annotation. */ private AnnotationNode visitAnnotation(AnnotationNode node) { ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration()); AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector); AnnotationNode solvedAnnotation = visitor.visit(node); this.source.getErrorCollector().addCollectorContents(errorCollector); return solvedAnnotation; }
/** * Resolve metadata and details of the annotation. */ private AnnotationNode visitAnnotation(AnnotationNode node) { ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration()); AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector); AnnotationNode solvedAnnotation = visitor.visit(node); this.source.getErrorCollector().addCollectorContents(errorCollector); return solvedAnnotation; }
/** * Resolve metadata and details of the annotation. */ private AnnotationNode visitAnnotation(AnnotationNode node) { ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration()); AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector); AnnotationNode solvedAnnotation = visitor.visit(node); this.source.getErrorCollector().addCollectorContents(errorCollector); return solvedAnnotation; }
/** * Resolve metadata and details of the annotation. * * @param unvisited the node to visit * @return the visited node */ private AnnotationNode visitAnnotation(AnnotationNode unvisited) { ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration()); AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector); AnnotationNode visited = visitor.visit(unvisited); this.source.getErrorCollector().addCollectorContents(errorCollector); return visited; }
public void visitMethod(MethodNode node) { visitAnnotations(node, AnnotationNode.METHOD_TARGET); for (int i = 0; i < node.getParameters().length; i++) { Parameter parameter = node.getParameters()[i]; visitAnnotations(parameter, AnnotationNode.PARAMETER_TARGET); } if (this.currentClass.isAnnotationDefinition()) { ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration()); AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector); visitor.setReportClass(currentClass); visitor.checkReturnType(node.getReturnType(),node); if (node.getParameters().length>0) { addError ("Annotation members may not have parameters.",node.getParameters()[0]); } if (node.getExceptions().length>0) { addError ("Annotation members may not have a throws clause.",node.getExceptions()[0]); } ReturnStatement code = (ReturnStatement) node.getCode(); if (code!=null) { visitor.visitExpression(node.getName(),code.getExpression(),node.getReturnType()); visitor.checkcircularReference(currentClass,node.getReturnType(),code.getExpression()); } this.source.getErrorCollector().addCollectorContents(errorCollector); } }
private void visitConstructorOrMethod(MethodNode node, int methodTarget) { visitAnnotations(node, methodTarget); for (int i = 0; i < node.getParameters().length; i++) { Parameter parameter = node.getParameters()[i]; visitAnnotations(parameter, AnnotationNode.PARAMETER_TARGET); } if (this.currentClass.isAnnotationDefinition()) { ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration()); AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector); visitor.setReportClass(currentClass); visitor.checkReturnType(node.getReturnType(),node); if (node.getParameters().length>0) { addError ("Annotation members may not have parameters.",node.getParameters()[0]); } if (node.getExceptions().length>0) { addError ("Annotation members may not have a throws clause.",node.getExceptions()[0]); } ReturnStatement code = (ReturnStatement) node.getCode(); if (code!=null) { visitor.visitExpression(node.getName(),code.getExpression(),node.getReturnType()); visitor.checkcircularReference(currentClass,node.getReturnType(),code.getExpression()); } this.source.getErrorCollector().addCollectorContents(errorCollector); } }
private void visitConstructorOrMethod(MethodNode node, int methodTarget) { visitAnnotations(node, methodTarget); for (int i = 0; i < node.getParameters().length; i++) { Parameter parameter = node.getParameters()[i]; visitAnnotations(parameter, AnnotationNode.PARAMETER_TARGET); } if (this.currentClass.isAnnotationDefinition() && !node.isStaticConstructor()) { ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration()); AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector); visitor.setReportClass(currentClass); visitor.checkReturnType(node.getReturnType(), node); if (node.getParameters().length > 0) { addError("Annotation members may not have parameters.", node.getParameters()[0]); } if (node.getExceptions().length > 0) { addError("Annotation members may not have a throws clause.", node.getExceptions()[0]); } ReturnStatement code = (ReturnStatement) node.getCode(); if (code != null) { visitor.visitExpression(node.getName(), code.getExpression(), node.getReturnType()); visitor.checkCircularReference(currentClass, node.getReturnType(), code.getExpression()); } this.source.getErrorCollector().addCollectorContents(errorCollector); } }