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 booleanequals(Object o)StringgetClassName()Gets the class name that is being injected intoFieldgetField()Gets the field that is being injected intoStringgetFieldName()Gets the name of the field that is being injected intoMetadataSourcegetMetadataSource()MethodgetMethod()StringgetMethodName()Inject method name is the actual java method name of the setter method, not the bean property name.StringgetTargetName()This is the form used by the .xml injection-group elements to represent the target of injection.inthashCode()booleanisFieldInjectable()Returns true if the field can be injected intobooleanisMethodInjectable()Returns true if method can be injected intovoidsetClassName(String className)Sets the class name that is being injected intovoidsetField(Field field)Sets the field that is being injected intovoidsetFieldName(String fieldName)Sets the name of the field that is being injected intovoidsetMetadataSource(MetadataSource metadataSource)Sets where the information about the injection is coming fromvoidsetMethod(Method method)voidsetMethodName(String methodName)voidsetTargetName(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
-
-