api / org.gradle.api.tasks / Nested

Nested

@Target([AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FIELD]) class Nested

Marks a property as specifying a nested bean, whose properties should be checked for annotations.

This annotation should be attached to the getter method in Java or the property in Groovy. Annotations on setters or just the field in Java are ignored.

The implementation of the nested bean is tracked as an input, too. This allows tracking behavior such as org.gradle.api.Actions as task inputs.

This annotations supports org.gradle.api.provider.Provider values by treating the result of org.gradle.api.provider.Provider#get() as a nested bean.

This annotation supports Iterable values by treating each element as a separate nested bean. As a property name, the index of the element in the iterable prefixed by $ is used, e.g. $0. If the element implements org.gradle.api.Named, then the property name is composed of org.gradle.api.Named#getName() and the index, e.g. name$1. The ordering of the elements in the iterable is crucial for for reliable up-to-date checks and caching.

This annotation supports $java.util.Map values by treating each value of the map as a separate nested bean. The keys of the map are used as property names.

Constructors

<init>

Nested()

Marks a property as specifying a nested bean, whose properties should be checked for annotations.

This annotation should be attached to the getter method in Java or the property in Groovy. Annotations on setters or just the field in Java are ignored.

The implementation of the nested bean is tracked as an input, too. This allows tracking behavior such as org.gradle.api.Actions as task inputs.

This annotations supports org.gradle.api.provider.Provider values by treating the result of org.gradle.api.provider.Provider#get() as a nested bean.

This annotation supports Iterable values by treating each element as a separate nested bean. As a property name, the index of the element in the iterable prefixed by $ is used, e.g. $0. If the element implements org.gradle.api.Named, then the property name is composed of org.gradle.api.Named#getName() and the index, e.g. name$1. The ordering of the elements in the iterable is crucial for for reliable up-to-date checks and caching.

This annotation supports $java.util.Map values by treating each value of the map as a separate nested bean. The keys of the map are used as property names.