public void setInjectionClassType ( Class < ? > injectionClassType ) throws InjectionException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setInjectionClassType: " + injectionClassType ) ; // if the injection class type hasn't been set yet ( null from XML or // Object from annotations, the default) then set it. if ( ivInjectionClassType == null || ivInjectionClassType == Object . class ) { ivInjectionClassType = injectionClassType ; } // If the specified class is a sublcass of the current setting, then // replace it, otherwise insure it is compatible else { if ( ivInjectionClassType . isAssignableFrom ( injectionClassType ) ) { ivInjectionClassType = injectionClassType ; } else { if ( ! injectionClassType . isAssignableFrom ( ivInjectionClassType ) ) { // TODO : Currently this warning will be present for most // primitives... need to improve this method to // properly handle primitives, and throw an exception here! if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "WARNING: Class " + injectionClassType + " is not assignable from " + ivInjectionClassType ) ; } } } }
Set the InjectionClassType to be most fine grained injection target Class type .