K
- V
- public class ValidatingMappedConfigurationWrapper<K,V> extends AbstractConfigurationImpl<V> implements MappedConfiguration<K,V>
MappedConfiguration
interface, and provides
two forms of validation for mapped configurations:
ContributionDef
, then a
warning is loggedConstructor and Description |
---|
ValidatingMappedConfigurationWrapper(Class<V> expectedValueType,
ObjectLocator locator,
TypeCoercerProxy typeCoercer,
Map<K,V> map,
Map<K,MappedConfigurationOverride<K,V>> overrides,
String serviceId,
ContributionDef contributionDef,
Class<K> expectedKeyType,
Map<K,ContributionDef> keyToContributor) |
Modifier and Type | Method and Description |
---|---|
void |
add(K key,
V value)
Adds a keyed object to the service's contribution.
|
void |
addInstance(K key,
Class<? extends V> clazz)
Adds a keyed object as an instantiated instance (with dependencies injected) of a class.
|
void |
override(K key,
V value)
Overrides an existing contribution by its key.
|
void |
overrideInstance(K key,
Class<? extends V> clazz)
Overrides an existing contribution with a new instance.
|
instantiate
public ValidatingMappedConfigurationWrapper(Class<V> expectedValueType, ObjectLocator locator, TypeCoercerProxy typeCoercer, Map<K,V> map, Map<K,MappedConfigurationOverride<K,V>> overrides, String serviceId, ContributionDef contributionDef, Class<K> expectedKeyType, Map<K,ContributionDef> keyToContributor)
public void add(K key, V value)
MappedConfiguration
add
in interface MappedConfiguration<K,V>
key
- unique id for the valuevalue
- to contributepublic void addInstance(K key, Class<? extends V> clazz)
MappedConfiguration
addInstance
in interface MappedConfiguration<K,V>
key
- unique id for the valueclazz
- class to instantiate and contributepublic void override(K key, V value)
MappedConfiguration
override
in interface MappedConfiguration<K,V>
key
- unique id of value to overridevalue
- new value, or null to remove the key entirelypublic void overrideInstance(K key, Class<? extends V> clazz)
MappedConfiguration
overrideInstance
in interface MappedConfiguration<K,V>
key
- unique id of value to overrideclazz
- class to instantiate as override5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.