Interface ServerResourceProducer
- All Known Implementing Classes:
DeploymentManagerProducer,ModelControllerClientProducer,ServerManagerProducer,UriProducer
public interface ServerResourceProducer
An implementation of this interface is used to inject static fields, instance fields and parameters. For static
fields and instance fields, the field must be annotated with
ServerResource.- Author:
- James R. Perkins
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanInject(ExtensionContext context, Class<?> clazz, Annotation... annotations) Indicates the type can be produced from this producer.produce(ExtensionContext context, Class<?> clazz, Annotation... annotations) Creates the object which can be injected into a static field, an instance field or a parameter.
-
Method Details
-
canInject
Indicates the type can be produced from this producer.- Parameters:
context- the current extension contextclazz- the type to checkannotations- the annotations, if any, for the field or parameter- Returns:
trueif this producer can create this type, otherwisefalse
-
produce
Object produce(ExtensionContext context, Class<?> clazz, Annotation... annotations) throws IllegalArgumentException Creates the object which can be injected into a static field, an instance field or a parameter.- Parameters:
context- the current extension contextclazz- the type of the field or parameterannotations- the annotations, if any, for the field or parameter- Returns:
- the newly constructed object or
nullif it could not be produced - Throws:
IllegalArgumentException- if the type cannot be assigned to the type this producer can produce
-