Package org.glassfish.hk2.utilities
Annotation Type Stub
-
@Documented @Retention(SOURCE) @Target(TYPE) public @interface Stub
When this annotation is placed on an abstract class the methods of the class that are abstract will be generated into a subclass by the hk2-metadata-generator along with an emptyService
annotationAny
Named
orContractsProvided
annotation on the class marked with this annotation will also be copied to the implementation. No other qualifier or annotation will be copied to the concrete implementation. However, theRank
annotation on the stub class will be honored.The methods generated into the subclass can either return null and fixed values (for scalars) or can throw exceptions, depending on the
Stub.Type
value of this annotationUsing this annotation is useful for testing, though it will work both with test code and non-test code
-
-
Element Detail
-
value
Stub.Type value
This value determines what the generated methods doIf set to
Stub.Type.VALUES
then the methods will return nulls or fixed values for scalars.If set to
Stub.Type.EXCEPTIONS
then the methods will throw UnsupportedOperationException- Returns:
- The behavior of the generated methods
- Default:
- org.glassfish.hk2.utilities.Stub.Type.VALUES
-
-