/** * Handles the bulk of the processing, mostly delegating to other methods. * * @param nodes the AST nodes * @param source the source unit for the nodes */ public void visit(ASTNode[] nodes, SourceUnit source) { if (!(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) { throw new RuntimeException("Internal error: wrong types: $node.class / $parent.class"); } AnnotationNode node = (AnnotationNode) nodes[0]; if (nodes[1] instanceof ClassNode) { addListenerToClass(source, (ClassNode) nodes[1]); } else { if ((((FieldNode)nodes[1]).getModifiers() & Opcodes.ACC_FINAL) != 0) { source.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage( new SyntaxException("@groovy.beans.Vetoable cannot annotate a final property.", node.getLineNumber(), node.getColumnNumber(), node.getLastLineNumber(), node.getLastColumnNumber()), source)); } addListenerToProperty(source, node, (AnnotatedNode) nodes[1]); } }
/** * Handles the bulk of the processing, mostly delegating to other methods. * * @param nodes the AST nodes * @param source the source unit for the nodes */ public void visit(ASTNode[] nodes, SourceUnit source) { if (!(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) { throw new RuntimeException("Internal error: wrong types: $node.class / $parent.class"); } AnnotationNode node = (AnnotationNode) nodes[0]; if (nodes[1] instanceof ClassNode) { addListenerToClass(source, node, (ClassNode) nodes[1]); } else { if ((((FieldNode)nodes[1]).getModifiers() & Opcodes.ACC_FINAL) != 0) { source.getErrorCollector().addErrorAndContinue( new SyntaxErrorMessage(new SyntaxException( "@groovy.beans.Vetoable cannot annotate a final property.", node.getLineNumber(), node.getColumnNumber()), source)); } addListenerToProperty(source, node, (AnnotatedNode) nodes[1]); } }
/** * Handles the bulk of the processing, mostly delegating to other methods. * * @param nodes the AST nodes * @param source the source unit for the nodes */ public void visit(ASTNode[] nodes, SourceUnit source) { if (!(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) { throw new RuntimeException("Internal error: wrong types: $node.class / $parent.class"); } AnnotationNode node = (AnnotationNode) nodes[0]; if (nodes[1] instanceof ClassNode) { addListenerToClass(source, node, (ClassNode) nodes[1]); } else { if ((((FieldNode)nodes[1]).getModifiers() & Opcodes.ACC_FINAL) != 0) { source.getErrorCollector().addErrorAndContinue( new SyntaxErrorMessage(new SyntaxException( "@groovy.beans.Vetoable cannot annotate a final property.", node.getLineNumber(), node.getColumnNumber()), source)); } addListenerToProperty(source, node, (AnnotatedNode) nodes[1]); } }
/** * Handles the bulk of the processing, mostly delegating to other methods. * * @param nodes the AST nodes * @param source the source unit for the nodes */ public void visit(ASTNode[] nodes, SourceUnit source) { if (!(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) { throw new RuntimeException("Internal error: wrong types: $node.class / $parent.class"); } AnnotationNode node = (AnnotationNode) nodes[0]; if (nodes[1] instanceof ClassNode) { addListenerToClass(source, node, (ClassNode) nodes[1]); } else { if ((((FieldNode)nodes[1]).getModifiers() & Opcodes.ACC_FINAL) != 0) { source.getErrorCollector().addErrorAndContinue( new SyntaxErrorMessage(new SyntaxException( "@groovy.beans.Vetoable cannot annotate a final property.", node.getLineNumber(), node.getColumnNumber()), source)); } addListenerToProperty(source, node, (AnnotatedNode) nodes[1]); } }