|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
T - The type of domain objects in this container.public interface NamedDomainObjectContainer<T>
A named domain object container is a specialisation of NamedDomainObjectSet that adds the ability to create
instances of the element type.
Implementations may use different strategies for creating new object instances.
Note that a container is an implementation of SortedSet, which means that the container is guaranteed
to only contain elements with unique names within this container. Furthermore, items are ordered by their name.
NamedDomainObjectSet| Method Summary | |
|---|---|
NamedDomainObjectContainer<T> |
configure(Closure configureClosure)
Allows the container to be configured, creating missing objects as they are referenced. |
T |
create(String name)
Creates a new item with the given name, adding it to this container. |
T |
create(String name,
Closure configureClosure)
Creates a new item with the given name, adding it to this container, then configuring it with the given closure. |
| Methods inherited from interface org.gradle.api.NamedDomainObjectSet |
|---|
findAll, matching, matching, withType |
| Methods inherited from interface org.gradle.api.NamedDomainObjectCollection |
|---|
add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getRules |
| Methods inherited from interface org.gradle.api.DomainObjectCollection |
|---|
all, all, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withType |
| Methods inherited from interface java.util.Collection |
|---|
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Methods inherited from interface java.util.Set |
|---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Method Detail |
|---|
T create(String name)
throws InvalidUserDataException
name - The name to assign to the created object
InvalidUserDataException - if an object with the given name already exists in this container.
T create(String name,
Closure configureClosure)
throws InvalidUserDataException
name - The name to assign to the created objectconfigureClosure - The closure to configure the created object with
InvalidUserDataException - if an object with the given name already exists in this container.NamedDomainObjectContainer<T> configure(Closure configureClosure)
Allows the container to be configured, creating missing objects as they are referenced.
TODO: example usage
configure in interface org.gradle.util.Configurable<NamedDomainObjectContainer<T>>configureClosure - The closure to configure this container with
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||