use of org.gradle.api.internal.tasks.properties.BeanPropertyContext in project gradle by gradle.
the class AbstractNestedRuntimeBeanNode method visitProperties.
protected void visitProperties(PropertyVisitor visitor, final Queue<RuntimeBeanNode<?>> queue, final RuntimeBeanNodeFactory nodeFactory, TypeValidationContext validationContext) {
TypeMetadata typeMetadata = getTypeMetadata();
typeMetadata.visitValidationFailures(getPropertyName(), validationContext);
for (PropertyMetadata propertyMetadata : typeMetadata.getPropertiesMetadata()) {
PropertyAnnotationHandler annotationHandler = typeMetadata.getAnnotationHandlerFor(propertyMetadata);
if (annotationHandler.shouldVisit(visitor)) {
String propertyName = getQualifiedPropertyName(propertyMetadata.getPropertyName());
PropertyValue value = new BeanPropertyValue(getBean(), propertyMetadata.getGetterMethod());
annotationHandler.visitPropertyValue(propertyName, value, propertyMetadata, visitor, new BeanPropertyContext() {
@Override
public void addNested(String propertyName, Object bean) {
queue.add(nodeFactory.create(AbstractNestedRuntimeBeanNode.this, propertyName, bean));
}
});
}
}
}
use of org.gradle.api.internal.tasks.properties.BeanPropertyContext in project gradle by gradle.
the class AbstractNestedRuntimeBeanNode method visitProperties.
public void visitProperties(PropertyVisitor visitor, PropertySpecFactory specFactory, final Queue<RuntimeBeanNode<?>> queue, final RuntimeBeanNodeFactory nodeFactory) {
TypeMetadata typeMetadata = getTypeMetadata();
for (final PropertyMetadata propertyMetadata : typeMetadata.getPropertiesMetadata()) {
PropertyValueVisitor propertyValueVisitor = propertyMetadata.getPropertyValueVisitor();
if (propertyValueVisitor == null) {
continue;
}
String propertyName = getQualifiedPropertyName(propertyMetadata.getFieldName());
PropertyValue propertyValue = new DefaultPropertyValue(propertyName, propertyMetadata.getAnnotations(), getBean(), propertyMetadata.getMethod());
propertyValueVisitor.visitPropertyValue(propertyValue, visitor, specFactory, new BeanPropertyContext() {
@Override
public void addNested(String propertyName, Object bean) {
queue.add(nodeFactory.create(AbstractNestedRuntimeBeanNode.this, propertyName, bean));
}
});
}
}
Aggregations