public abstract class AbstractNamedDomainObjectContainer<T> extends DefaultNamedDomainObjectSet<T> implements NamedDomainObjectContainer<T>
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractNamedDomainObjectContainer(Class<T> type,
Instantiator instantiator) |
protected |
AbstractNamedDomainObjectContainer(Class<T> type,
Instantiator instantiator,
Namer<? super T> namer) |
| Modifier and Type | Method and Description |
|---|---|
AbstractNamedDomainObjectContainer<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.
|
protected Object |
createConfigureDelegate(Closure configureClosure) |
protected abstract T |
doCreate(String name)
Subclasses need only implement this method as the creation strategy.
|
String |
getDisplayName() |
filtered, filteredStore, findAll, matching, matching, withTypeadd, addRule, addRule, assertCanAdd, assertCanAdd, createNotFoundException, findByName, findByNameWithoutRules, getAsDynamicObject, getAsMap, getAt, getByName, getByName, getConvention, getElementsAsDynamicObject, getExtensions, getInstantiator, getNamer, getRules, getTypeDisplayName, handleAttemptToAddItemWithNonUniqueName, hasWithName, removeByNameaddAll, all, all, assertMutable, beforeChange, clear, contains, containsAll, createFilter, createFilter, createFilter, filteredEvents, findAll, getEventRegister, getStore, getType, isEmpty, iterator, remove, removeAll, retainAll, size, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withTypetoArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindAll, matching, matching, withTypeadd, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getRulesall, all, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withTypeprotected AbstractNamedDomainObjectContainer(Class<T> type, Instantiator instantiator, Namer<? super T> namer)
protected AbstractNamedDomainObjectContainer(Class<T> type, Instantiator instantiator)
protected abstract T doCreate(String name)
public T create(String name)
NamedDomainObjectContainercreate in interface NamedDomainObjectContainer<T>name - The name to assign to the created objectpublic T create(String name, Closure configureClosure)
NamedDomainObjectContainercreate in interface NamedDomainObjectContainer<T>name - The name to assign to the created objectconfigureClosure - The closure to configure the created object withpublic AbstractNamedDomainObjectContainer<T> configure(Closure configureClosure)
NamedDomainObjectContainerAllows the container to be configured, creating missing objects as they are referenced.
TODO: example usage
configure in interface NamedDomainObjectContainer<T>configure in interface Configurable<NamedDomainObjectContainer<T>>configureClosure - The closure to configure this container withpublic String getDisplayName()
getDisplayName in class DefaultNamedDomainObjectSet<T>Copyright © 2013. All rights reserved