Search in sources :

Example 1 with PropertyValueVisitor

use of org.gradle.api.internal.tasks.properties.PropertyValueVisitor 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));
            }
        });
    }
}
Also used : TypeMetadata(org.gradle.api.internal.tasks.properties.TypeMetadata) BeanPropertyContext(org.gradle.api.internal.tasks.properties.BeanPropertyContext) PropertyMetadata(org.gradle.api.internal.tasks.properties.PropertyMetadata) PropertyValue(org.gradle.api.internal.tasks.properties.PropertyValue) PropertyValueVisitor(org.gradle.api.internal.tasks.properties.PropertyValueVisitor)

Aggregations

BeanPropertyContext (org.gradle.api.internal.tasks.properties.BeanPropertyContext)1 PropertyMetadata (org.gradle.api.internal.tasks.properties.PropertyMetadata)1 PropertyValue (org.gradle.api.internal.tasks.properties.PropertyValue)1 PropertyValueVisitor (org.gradle.api.internal.tasks.properties.PropertyValueVisitor)1 TypeMetadata (org.gradle.api.internal.tasks.properties.TypeMetadata)1