Class InjectionTarget

  • All Implemented Interfaces:
    Serializable

    public class InjectionTarget
    extends Object
    implements Serializable
    This class holds information about an injection target like the class name of the injected target, and field/method information used for injection.
    Author:
    Jerome Dochez
    See Also:
    Serialized Form
    • Constructor Detail

      • InjectionTarget

        public InjectionTarget()
    • Method Detail

      • isFieldInjectable

        public boolean isFieldInjectable()
        Returns true if the field can be injected into
        Returns:
      • isMethodInjectable

        public boolean isMethodInjectable()
        Returns true if method can be injected into
        Returns:
      • getClassName

        public String getClassName()
        Gets the class name that is being injected into
        Returns:
      • setClassName

        public void setClassName​(String className)
        Sets the class name that is being injected into
        Parameters:
        className -
      • getTargetName

        public String getTargetName()
        This is the form used by the .xml injection-group elements to represent the target of injection. It either represents the javabeans property name of the injection method or the name of the injected field. This value is set on the descriptor during .xml processing and converted into the appropriate field/method name during validation.
        Returns:
      • getFieldName

        public String getFieldName()
        Gets the name of the field that is being injected into
        Returns:
      • setFieldName

        public void setFieldName​(String fieldName)
        Sets the name of the field that is being injected into
        Parameters:
        fieldName -
      • getField

        public Field getField()
        Gets the field that is being injected into
        Returns:
      • setField

        public void setField​(Field field)
        Sets the field that is being injected into
        Parameters:
        field -
      • getMethodName

        public String getMethodName()
        Inject method name is the actual java method name of the setter method, not the bean property name. E.g., for @Resource void setFoo(Bar b) it would be "setFoo", not the property name "foo".
        Returns:
      • setMethodName

        public void setMethodName​(String methodName)
      • getMethod

        public Method getMethod()
      • setMethod

        public void setMethod​(Method method)
      • setMetadataSource

        public void setMetadataSource​(MetadataSource metadataSource)
        Sets where the information about the injection is coming from
        Parameters:
        metadataSource - XML, ANNOTATION or PROGRAMMATIC
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object