Package com.sun.enterprise.deployment
Class InjectionTarget
- java.lang.Object
-
- com.sun.enterprise.deployment.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 Summary
Constructors Constructor Description InjectionTarget()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getClassName()
Gets the class name that is being injected intoField
getField()
Gets the field that is being injected intoString
getFieldName()
Gets the name of the field that is being injected intoMetadataSource
getMetadataSource()
Method
getMethod()
String
getMethodName()
Inject method name is the actual java method name of the setter method, not the bean property name.String
getTargetName()
This is the form used by the .xml injection-group elements to represent the target of injection.int
hashCode()
boolean
isFieldInjectable()
Returns true if the field can be injected intoboolean
isMethodInjectable()
Returns true if method can be injected intovoid
setClassName(String className)
Sets the class name that is being injected intovoid
setField(Field field)
Sets the field that is being injected intovoid
setFieldName(String fieldName)
Sets the name of the field that is being injected intovoid
setMetadataSource(MetadataSource metadataSource)
Sets where the information about the injection is coming fromvoid
setMethod(Method method)
void
setMethodName(String methodName)
void
setTargetName(String targetName)
Sets the name of that is being injected into
-
-
-
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:
-
setTargetName
public void setTargetName(String targetName)
Sets the name of that is being injected into- Parameters:
targetName
-- See Also:
setFieldName(String)
,setMethodName(String)
-
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)
-
getMetadataSource
public MetadataSource getMetadataSource()
-
setMetadataSource
public void setMetadataSource(MetadataSource metadataSource)
Sets where the information about the injection is coming from- Parameters:
metadataSource
- XML, ANNOTATION or PROGRAMMATIC
-
-