Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## org.gradle.api
[Java] Interface NamedDomainObjectContainer

    org.gradle.api.DomainObjectCollection
      org.gradle.api.NamedDomainObjectCollection
          org.gradle.api.NamedDomainObjectContainer

All Superinterfaces:
  DomainObjectCollection, NamedDomainObjectCollection

    public interface NamedDomainObjectContainer
    extends NamedDomainObjectCollection

A `DomainObjectContainer` represents a mutable collection of domain objects of type `T`.

Parameters:
  `` - The type of domain objects in this container.

Method Summary
`Rule` | `addRule(Rule rule)` Adds a rule to this container.
`Rule` | `addRule(java.lang.String description, groovy.lang.Closure ruleAction)` Adds a rule to this container.
`java.util.List` | `getRules()` Returns the rules used by this container.

Methods inherited from interface NamedDomainObjectCollection
findByName, getAsMap, getAt, getByName, getByName, matching, matching, withType

Methods inherited from interface DomainObjectCollection
all, all, allObjects, allObjects, findAll, getAll, matching, matching, whenObjectAdded, whenObjectAdded, whenObjectRemoved, withType, withType, withType

Methods inherited from interface java.lang.Iterable
java.lang.Iterable#iterator()

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Method Detail

### addRule

    public Rule addRule(Rule rule)

  Adds a rule to this container. The given rule is invoked when an unknown object is requested by name.
  Parameters:
    `rule` - The rule to add.
  Returns:
    The added rule.

### addRule

    public Rule addRule(java.lang.String description, groovy.lang.Closure ruleAction)

  Adds a rule to this container. The given closure is executed when an unknown object is requested by name. The requested name is passed to the closure as a parameter.
  Parameters:
    `description` - The description of the rule.
    `ruleAction` - The closure to execute to apply the rule.
  Returns:
    The added rule.

### getRules

    public java.util.List getRules()

  Returns the rules used by this container.
  Returns:
    The rules, in the order they will be applied.

Groovy Documentation