Class InjecteeImpl
java.lang.Object
org.glassfish.jersey.internal.inject.InjecteeImpl
- All Implemented Interfaces:
Injectee
An Injectee represents the point of injection. It can be used by injection resolvers to discover all of the information
available about the entity being injected into.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanClass<?>Returns the parent class for this injectee.This method returns foreign descriptor of the current injectee that means that the DI provider is able to store its specific descriptor and that use it in the descriptor processing.If this Injectee is in a constructor this will return the constructor being injected into.Class<? extends Annotation>This method returns scope in which the parent class is registered.intIf this Injectee is a constructor or method parameter, this will return the index of the parameter.This is the set of required qualifiers for this injectee.This is the required type of the injectee.inthashCode()booleanThis method returnstrueif the injectee value is provided usingSupplier.booleanThis method returnstrueif this injection point is annotated with VOptional.booleanThis method returnstrueif the injectee value is provided usingProvider.voidsetFactory(boolean factory) Sets a flag whether the injectee is a factory.voidsetInjecteeClass(Class<?> injecteeClass) Sets type of the injectee.voidsetInjecteeDescriptor(ForeignDescriptor injecteeDescriptor) Sets the descriptor for this Injectee.voidsetOptional(boolean optional) Sets whether or not this Injectee should be considered optional.voidsetParent(AnnotatedElement parent) This setter sets both the parent and the injecteeClass fields.voidsetParentClassScope(Class<? extends Annotation> parentClassScope) Sets the scope in which the parent class is registered.voidsetPosition(int position) Sets the position of this Injectee.voidsetProvider(boolean provider) Sets a flag whether the injectee is a provider.voidsetRequiredQualifiers(Set<Annotation> requiredQualifiers) Sets the required qualifiers for this Injectee.voidsetRequiredType(Type requiredType) Sets the required type of this Injectee.toString()
-
Constructor Details
-
InjecteeImpl
public InjecteeImpl()
-
-
Method Details
-
getRequiredType
Description copied from interface:InjecteeThis is the required type of the injectee. The object that is injected into this point must be type-safe with regards to this type.- Specified by:
getRequiredTypein interfaceInjectee- Returns:
- The type that this injectee is expecting. Any object injected into this injection point must be type-safe with regards to this type.
-
setRequiredType
Sets the required type of this Injectee.- Parameters:
requiredType- The required type of this injectee.
-
getRequiredQualifiers
Description copied from interface:InjecteeThis is the set of required qualifiers for this injectee. All of these qualifiers must be present on the implementation class of the object that is injected into this injectee. Note that the fields of the annotation must also match.- Specified by:
getRequiredQualifiersin interfaceInjectee- Returns:
- Will not return
null, but may return an empty set. The set of all qualifiers that must match.
-
setRequiredQualifiers
Sets the required qualifiers for this Injectee.- Parameters:
requiredQualifiers- The non-null set of required qualifiers.
-
getParentClassScope
Description copied from interface:InjecteeThis method returns scope in which the parent class is registered.- Specified by:
getParentClassScopein interfaceInjectee- Returns:
- scope annotation.
-
setParentClassScope
Sets the scope in which the parent class is registered. -
isFactory
public boolean isFactory()Description copied from interface:InjecteeThis method returnstrueif the injectee value is provided usingSupplier. -
setFactory
public void setFactory(boolean factory) Sets a flag whether the injectee is a factory.- Parameters:
factory-trueflag whether the injectee is factory.
-
isProvider
public boolean isProvider()Description copied from interface:InjecteeThis method returnstrueif the injectee value is provided usingProvider.- Specified by:
isProviderin interfaceInjectee- Returns:
trueif the injectee is a provider.
-
setProvider
public void setProvider(boolean provider) Sets a flag whether the injectee is a provider.- Parameters:
provider-trueflag whether the injectee is provider.
-
getPosition
public int getPosition()Description copied from interface:InjecteeIf this Injectee is a constructor or method parameter, this will return the index of the parameter. If thisInjecteeis a field, this will return-1.- Specified by:
getPositionin interfaceInjectee- Returns:
- the position of the parameter, or
-1if this is a field.
-
setPosition
public void setPosition(int position) Sets the position of this Injectee. The position represents the index of the parameter, or-1if this Injectee is describing a field.- Parameters:
position- The index position of the parameter, or-1if describing a field.
-
getInjecteeClass
Description copied from interface:InjecteeReturns the parent class for this injectee. This is the class of the object that will be injected into. This field may returnnullif this is from a service lookup.- Specified by:
getInjecteeClassin interfaceInjectee- Returns:
- The class of the object that will be injected into.
-
setInjecteeClass
Sets type of the injectee.- Parameters:
injecteeClass- injectee type.
-
getParent
Description copied from interface:InjecteeIf this Injectee is in a constructor this will return the constructor being injected into. If this Injectee is in a method this will return the method being injected into. If this injectee represents a field, this will return the field being injected into. This injectee may be neither in which case this will returnnull. -
setParent
This setter sets both the parent and the injecteeClass fields.- Parameters:
parent- The parent (Field, Constructor or Method) which is the parent of this Injectee.
-
isOptional
public boolean isOptional()Description copied from interface:InjecteeThis method returnstrueif this injection point is annotated with VOptional. In this case if there is no definition for the injection point in the system it is allowable for the system to merely returnnull.- Specified by:
isOptionalin interfaceInjectee- Returns:
trueif the injection point is annotated with VOptional,falseotherwise.
-
setOptional
public void setOptional(boolean optional) Sets whether or not this Injectee should be considered optional.- Parameters:
optional- true if this injectee is optional, false if required.
-
getInjecteeDescriptor
Description copied from interface:InjecteeThis method returns foreign descriptor of the current injectee that means that the DI provider is able to store its specific descriptor and that use it in the descriptor processing.- Specified by:
getInjecteeDescriptorin interfaceInjectee- Returns:
- DI specific foreign descriptor.
-
setInjecteeDescriptor
Sets the descriptor for this Injectee.- Parameters:
injecteeDescriptor- injectee's descriptor.
-
toString
-
equals
-
hashCode
public int hashCode()
-