Package org.apache.tapestry5.commons
Interface MappedConfiguration<K,V>
-
- All Known Implementing Classes:
ValidatingMappedConfigurationWrapper
public interface MappedConfiguration<K,V>
Object passed into a service contributor method that allows the method provide contributed values to the service's configuration. A service can collect contributions in three different ways:- As an un-ordered collection of values
- As an ordered list of values (where each value has a unique id, pre-requisites and post-requisites)
- As a map of keys and values
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(K key, V value)Adds a keyed object to the service's contribution.voidaddInstance(K key, java.lang.Class<? extends V> clazz)Adds a keyed object as an instantiated instance (with dependencies injected) of a class.voidoverride(K key, V value)Overrides an existing contribution by its key.voidoverrideInstance(K key, java.lang.Class<? extends V> clazz)Overrides an existing contribution with a new instance.
-
-
-
Method Detail
-
add
void add(K key, V value)
Adds a keyed object to the service's contribution.- Parameters:
key- unique id for the valuevalue- to contribute- Throws:
java.lang.IllegalArgumentException- if key is not unique
-
override
void override(K key, V value)
Overrides an existing contribution by its key.- Parameters:
key- unique id of value to overridevalue- new value, or null to remove the key entirely- Since:
- 5.1.0.0
-
addInstance
void addInstance(K key, java.lang.Class<? extends V> clazz)
Adds a keyed object as an instantiated instance (with dependencies injected) of a class. When the value type is an interface and the class to be contributed is a local file, then a reloadable proxy for the value class will be created and contributed.- Parameters:
key- unique id for the valueclazz- class to instantiate and contribute- Since:
- 5.1.0.0
-
overrideInstance
void overrideInstance(K key, java.lang.Class<? extends V> clazz)
Overrides an existing contribution with a new instance. When the value type is an interface and the class to be contributed is a local file, then a reloadable proxy for the value class will be created and contributed.- Parameters:
key- unique id of value to overrideclazz- class to instantiate as override
-
-