private void addListenerToClass(SourceUnit source, ClassNode classNode) { boolean bindable = BindableASTTransformation.hasBindableAnnotation(classNode); for (PropertyNode propertyNode : classNode.getProperties()) { if (!hasVetoableAnnotation(propertyNode.getField()) && !propertyNode.getField().isFinal() && !propertyNode.getField().isStatic()) { createListenerSetter(source, bindable || BindableASTTransformation.hasBindableAnnotation(propertyNode.getField()), classNode, propertyNode); } } }
if (hasBindableAnnotation(consideredClass)) return false; for (FieldNode field : consideredClass.getFields()) { if (hasBindableAnnotation(field)) return false;
private void addListenerToClass(SourceUnit source, ClassNode classNode) { if (needsPropertyChangeSupport(classNode, source)) { addPropertyChangeSupport(classNode); } for (PropertyNode propertyNode : classNode.getProperties()) { FieldNode field = propertyNode.getField(); // look to see if per-field handlers will catch this one... if (hasBindableAnnotation(field) || ((field.getModifiers() & Opcodes.ACC_FINAL) != 0) || field.isStatic() || VetoableASTTransformation.hasVetoableAnnotation(field)) { // explicitly labeled properties are already handled, // don't transform final properties // don't transform static properties // VetoableASTTransformation will handle both @Bindable and @Vetoable continue; } createListenerSetter(classNode, propertyNode); } }
private void addListenerToProperty(SourceUnit source, AnnotationNode node, AnnotatedNode parent) { ClassNode declaringClass = parent.getDeclaringClass(); FieldNode field = ((FieldNode) parent); String fieldName = field.getName(); for (PropertyNode propertyNode : declaringClass.getProperties()) { boolean bindable = BindableASTTransformation.hasBindableAnnotation(parent) || BindableASTTransformation.hasBindableAnnotation(parent.getDeclaringClass()); if (propertyNode.getName().equals(fieldName)) { if (field.isStatic()) { //noinspection ThrowableInstanceNeverThrown source.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage( new SyntaxException("@groovy.beans.Vetoable cannot annotate a static property.", node.getLineNumber(), node.getColumnNumber(), node.getLastLineNumber(), node.getLastColumnNumber()), source)); } else { createListenerSetter(source, bindable, declaringClass, propertyNode); } return; } } //noinspection ThrowableInstanceNeverThrown source.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage( new SyntaxException("@groovy.beans.Vetoable must be on a property, not a field. Try removing the private, protected, or public modifier.", node.getLineNumber(), node.getColumnNumber(), node.getLastLineNumber(), node.getLastColumnNumber()), source)); }
private void addListenerToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) { boolean bindable = BindableASTTransformation.hasBindableAnnotation(classNode); for (PropertyNode propertyNode : classNode.getProperties()) { if (!hasVetoableAnnotation(propertyNode.getField()) && !((propertyNode.getField().getModifiers() & Opcodes.ACC_FINAL) != 0) && !propertyNode.getField().isStatic()) { createListenerSetter(source, node, bindable || BindableASTTransformation.hasBindableAnnotation(propertyNode.getField()), classNode, propertyNode); } } }
private void addListenerToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) { boolean bindable = BindableASTTransformation.hasBindableAnnotation(classNode); for (PropertyNode propertyNode : (Collection<PropertyNode>) classNode.getProperties()) { if (!hasVetoableAnnotation(propertyNode.getField()) && !((propertyNode.getField().getModifiers() & Opcodes.ACC_FINAL) != 0) && !propertyNode.getField().isStatic()) { createListenerSetter(source, node, bindable || BindableASTTransformation.hasBindableAnnotation(propertyNode.getField()), classNode, propertyNode); } } }
private void addListenerToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) { boolean bindable = BindableASTTransformation.hasBindableAnnotation(classNode); for (PropertyNode propertyNode : (Collection<PropertyNode>) classNode.getProperties()) { if (!hasVetoableAnnotation(propertyNode.getField()) && !((propertyNode.getField().getModifiers() & Opcodes.ACC_FINAL) != 0) && !propertyNode.getField().isStatic()) { createListenerSetter(source, node, bindable || BindableASTTransformation.hasBindableAnnotation(propertyNode.getField()), classNode, propertyNode); } } }
if (hasBindableAnnotation(consideredClass)) return false; for (FieldNode field : consideredClass.getFields()) { if (hasBindableAnnotation(field)) return false;
if (hasBindableAnnotation(consideredClass)) return false; for (FieldNode field : consideredClass.getFields()) { if (hasBindableAnnotation(field)) return false;
private void addListenerToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) { if (needsPropertyChangeSupport(classNode, source)) { addPropertyChangeSupport(classNode); } for (PropertyNode propertyNode : (Collection<PropertyNode>) classNode.getProperties()) { FieldNode field = propertyNode.getField(); // look to see if per-field handlers will catch this one... if (hasBindableAnnotation(field) || ((field.getModifiers() & Opcodes.ACC_FINAL) != 0) || field.isStatic() || VetoableASTTransformation.hasVetoableAnnotation(field)) { // explicitly labeled properties are already handled, // don't transform final properties // don't transform static properties // VetoableASTTransformation will handle both @Bindable and @Vetoable continue; } createListenerSetter(source, node, classNode, propertyNode); } }
private void addListenerToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) { if (needsPropertyChangeSupport(classNode, source)) { addPropertyChangeSupport(classNode); } for (PropertyNode propertyNode : classNode.getProperties()) { FieldNode field = propertyNode.getField(); // look to see if per-field handlers will catch this one... if (hasBindableAnnotation(field) || ((field.getModifiers() & Opcodes.ACC_FINAL) != 0) || field.isStatic() || VetoableASTTransformation.hasVetoableAnnotation(field)) { // explicitly labeled properties are already handled, // don't transform final properties // don't transform static properties // VetoableASTTransformation will handle both @Bindable and @Vetoable continue; } createListenerSetter(source, node, classNode, propertyNode); } }
private void addListenerToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) { if (needsPropertyChangeSupport(classNode, source)) { addPropertyChangeSupport(classNode); } for (PropertyNode propertyNode : (Collection<PropertyNode>) classNode.getProperties()) { FieldNode field = propertyNode.getField(); // look to see if per-field handlers will catch this one... if (hasBindableAnnotation(field) || ((field.getModifiers() & Opcodes.ACC_FINAL) != 0) || field.isStatic() || VetoableASTTransformation.hasVetoableAnnotation(field)) { // explicitly labeled properties are already handled, // don't transform final properties // don't transform static properties // VetoableASTTransformation will handle both @Bindable and @Vetoable continue; } createListenerSetter(source, node, classNode, propertyNode); } }
private void addListenerToProperty(SourceUnit source, AnnotationNode node, AnnotatedNode parent) { ClassNode declaringClass = parent.getDeclaringClass(); FieldNode field = ((FieldNode) parent); String fieldName = field.getName(); for (PropertyNode propertyNode : declaringClass.getProperties()) { boolean bindable = BindableASTTransformation.hasBindableAnnotation(parent) || BindableASTTransformation.hasBindableAnnotation(parent.getDeclaringClass()); if (propertyNode.getName().equals(fieldName)) { if (field.isStatic()) { //noinspection ThrowableInstanceNeverThrown source.getErrorCollector().addErrorAndContinue( new SyntaxErrorMessage(new SyntaxException( "@groovy.beans.Vetoable cannot annotate a static property.", node.getLineNumber(), node.getColumnNumber()), source)); } else { createListenerSetter(source, node, bindable, declaringClass, propertyNode); } return; } } //noinspection ThrowableInstanceNeverThrown source.getErrorCollector().addErrorAndContinue( new SyntaxErrorMessage(new SyntaxException( "@groovy.beans.Vetoable must be on a property, not a field. Try removing the private, protected, or public modifier.", node.getLineNumber(), node.getColumnNumber()), source)); }
private void addListenerToProperty(SourceUnit source, AnnotationNode node, AnnotatedNode parent) { ClassNode declaringClass = parent.getDeclaringClass(); FieldNode field = ((FieldNode) parent); String fieldName = field.getName(); for (PropertyNode propertyNode : (Collection<PropertyNode>) declaringClass.getProperties()) { boolean bindable = BindableASTTransformation.hasBindableAnnotation(parent) || BindableASTTransformation.hasBindableAnnotation(parent.getDeclaringClass()); if (propertyNode.getName().equals(fieldName)) { if (field.isStatic()) { //noinspection ThrowableInstanceNeverThrown source.getErrorCollector().addErrorAndContinue( new SyntaxErrorMessage(new SyntaxException( "@groovy.beans.Vetoable cannot annotate a static property.", node.getLineNumber(), node.getColumnNumber()), source)); } else { createListenerSetter(source, node, bindable, declaringClass, propertyNode); } return; } } //noinspection ThrowableInstanceNeverThrown source.getErrorCollector().addErrorAndContinue( new SyntaxErrorMessage(new SyntaxException( "@groovy.beans.Vetoable must be on a property, not a field. Try removing the private, protected, or public modifier.", node.getLineNumber(), node.getColumnNumber()), source)); }
private void addListenerToProperty(SourceUnit source, AnnotationNode node, AnnotatedNode parent) { ClassNode declaringClass = parent.getDeclaringClass(); FieldNode field = ((FieldNode) parent); String fieldName = field.getName(); for (PropertyNode propertyNode : (Collection<PropertyNode>) declaringClass.getProperties()) { boolean bindable = BindableASTTransformation.hasBindableAnnotation(parent) || BindableASTTransformation.hasBindableAnnotation(parent.getDeclaringClass()); if (propertyNode.getName().equals(fieldName)) { if (field.isStatic()) { //noinspection ThrowableInstanceNeverThrown source.getErrorCollector().addErrorAndContinue( new SyntaxErrorMessage(new SyntaxException( "@groovy.beans.Vetoable cannot annotate a static property.", node.getLineNumber(), node.getColumnNumber()), source)); } else { createListenerSetter(source, node, bindable, declaringClass, propertyNode); } return; } } //noinspection ThrowableInstanceNeverThrown source.getErrorCollector().addErrorAndContinue( new SyntaxErrorMessage(new SyntaxException( "@groovy.beans.Vetoable must be on a property, not a field. Try removing the private, protected, or public modifier.", node.getLineNumber(), node.getColumnNumber()), source)); }