Package org.glassfish.hk2.utilities
Annotation Type Stub
-
@Documented @Retention(SOURCE) @Target(TYPE) public @interface StubWhen 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 emptyServiceannotationAny
NamedorContractsProvidedannotation 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, theRankannotation 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.Typevalue 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.VALUESthen the methods will return nulls or fixed values for scalars.If set to
Stub.Type.EXCEPTIONSthen the methods will throw UnsupportedOperationException- Returns:
- The behavior of the generated methods
- Default:
- org.glassfish.hk2.utilities.Stub.Type.VALUES
-
-