org.jboss.msc.inject
Class MapInjector<K,T>

java.lang.Object
  extended by org.jboss.msc.inject.MapInjector<K,T>
Type Parameters:
K - the key type
T - the value type
All Implemented Interfaces:
Injector<T>

public final class MapInjector<K,T>
extends Object
implements Injector<T>

An injector which applies a value to a map entry.

Author:
David M. Lloyd

Constructor Summary
MapInjector(Map<K,T> map, K key)
          Construct a new instance.
 
Method Summary
 void inject(T value)
          Inject the given value.
 void uninject()
          Uninject the given value (in other words, cancel or undo a previous injection).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapInjector

public MapInjector(Map<K,T> map,
                   K key)
Construct a new instance.

Parameters:
map - the map to update
key - the key for this injector
Method Detail

inject

public void inject(T value)
            throws InjectionException
Inject the given value.

Specified by:
inject in interface Injector<T>
Parameters:
value - the value
Throws:
InjectionException - if the injection failed

uninject

public void uninject()
Uninject the given value (in other words, cancel or undo a previous injection). Only called after inject() has been called.

Specified by:
uninject in interface Injector<T>


Copyright © 2011. All Rights Reserved.