Top Description Methods
jakarta.enterprise.inject.spi

public Interface InjectionTarget<T>

extends Producer<T>
Type Parameters
<T>
The class of the instance
Imports
jakarta.enterprise.context.spi.CreationalContext

Provides operations for performing dependency injection and lifecycle callbacks on an instance of a type.

CDI Lite implementations are not required to provide support for InjectionTarget.

Authors
Pete Muir, David Allen
See Also
jakarta.annotation.PostConstruct, jakarta.annotation.PreDestroy

Method Summary

Modifier and TypeMethod and Description
public void
inject(T
The instance upon which to perform injection
instance
,
CreationalContext<T>
The CreationalContext to use for creating new instances
ctx
)

Performs dependency injection upon the given object.

public void
postConstruct(T
The instance on which to invoke the jakarta.annotation.PostConstruct method
instance
)

Calls the jakarta.annotation.PostConstruct callback, if it exists, according to the semantics required by the Java EE platform specification.

public void
preDestroy(T
The instance on which to invoke the jakarta.annotation.PreDestroy method
instance
)

Calls the jakarta.annotation.PreDestroy callback, if it exists, according to the semantics required by the Java EE platform specification.

Inherited from jakarta.enterprise.inject.spi.Producer:
disposegetInjectionPointsproduce

Method Detail

injectback to summary
public void inject(T instance, CreationalContext<T> ctx)

Performs dependency injection upon the given object. Performs Java EE component environment injection, sets the value of all injected fields, and calls all initializer methods.

Parameters
instance:T

The instance upon which to perform injection

ctx:CreationalContext<T>

The CreationalContext to use for creating new instances

postConstructback to summary
public void postConstruct(T instance)

Calls the jakarta.annotation.PostConstruct callback, if it exists, according to the semantics required by the Java EE platform specification.

Parameters
instance:T

The instance on which to invoke the jakarta.annotation.PostConstruct method

preDestroyback to summary
public void preDestroy(T instance)

Calls the jakarta.annotation.PreDestroy callback, if it exists, according to the semantics required by the Java EE platform specification.

Parameters
instance:T

The instance on which to invoke the jakarta.annotation.PreDestroy method