org.springframework.jee.inject
Class Injection<E extends InjectionInfo>

java.lang.Object
  extended by org.springframework.jee.inject.Injection<E>
All Implemented Interfaces:
InjectionI<E>
Direct Known Subclasses:
FieldInjection, MethodInjection

public abstract class Injection<E extends InjectionInfo>
extends Object
implements InjectionI<E>

Class modelling an injected member of a JEE component.

Author:
Rod Johnson, Costin Leau

Field Summary
protected  E info
           
protected  Member member
           
 
Constructor Summary
Injection(Member member, E resourceInfo)
           
 
Method Summary
abstract  void apply(Object instance, Object value)
          Applies the given value on the instance according to the injection information - implementation specific.
 boolean containsValue()
           
protected  String getDefaultName()
          Return the default name to be used if the info does not contain one.
 E getInfo()
           
 Member getMember()
           
protected abstract  Class getMemberType()
          Need to be implemented based on the member type.
 String getName()
           
 Class getType()
           
 Object getValue()
           
 void setValue(Object value)
          If this method is called, we are dealing with a literal value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

info

protected final E extends InjectionInfo info

member

protected final Member member
Constructor Detail

Injection

public Injection(Member member,
                 E resourceInfo)
Method Detail

getInfo

public E getInfo()
Specified by:
getInfo in interface InjectionI<E extends InjectionInfo>

getValue

public Object getValue()
Specified by:
getValue in interface InjectionI<E extends InjectionInfo>

setValue

public void setValue(Object value)
If this method is called, we are dealing with a literal value. A lookup will not be required: the value will be set.

Specified by:
setValue in interface InjectionI<E extends InjectionInfo>
Parameters:
value -

containsValue

public boolean containsValue()
Specified by:
containsValue in interface InjectionI<E extends InjectionInfo>

getName

public String getName()
Specified by:
getName in interface InjectionI<E extends InjectionInfo>

getType

public Class getType()
Specified by:
getType in interface InjectionI<E extends InjectionInfo>

getMember

public Member getMember()
Specified by:
getMember in interface InjectionI<E extends InjectionInfo>

getDefaultName

protected String getDefaultName()
Return the default name to be used if the info does not contain one.

Returns:

toString

public String toString()
Specified by:
toString in interface InjectionI<E extends InjectionInfo>
Overrides:
toString in class Object

getMemberType

protected abstract Class getMemberType()
Need to be implemented based on the member type.

Returns:

apply

public abstract void apply(Object instance,
                           Object value)
Applies the given value on the instance according to the injection information - implementation specific.

Specified by:
apply in interface InjectionI<E extends InjectionInfo>
Parameters:
instance -
value -


Copyright © 2006-2008 SpringSource (formerly Interface21). All Rights Reserved.