Package org.glassfish.hk2.api
Annotation Type Customizer
-
@Documented @Retention(RUNTIME) @Target(TYPE) public @interface Customizer
Gives the type (and optional name) of a customizer service to use when an unknown method on a bean interface is encountered. Customizers are found in the hk2 service registryThis annotation is for use with the hk2-xml configuration system
- Author:
- jwells
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
failWhenMethodNotFound
If true then if a bean method is not mirrored in the customizer a RuntimeException will be thrown.String[]
name
The name of the customizer to lookup for this bean
-
-
-
Element Detail
-
value
Class<?>[] value
The class of the customizer to lookup for this bean- Returns:
- the class of the customizer for this bean
-
-
-
name
String[] name
The name of the customizer to lookup for this bean- Returns:
- the name of the customizer for this bean
- Default:
- {}
-
-
-
failWhenMethodNotFound
boolean failWhenMethodNotFound
If true then if a bean method is not mirrored in the customizer a RuntimeException will be thrown. Otherwise unknown methods are treated as a no-op. Setting this to false must be used with care as any method with a scalar return will throw a null pointer exception if no method can be found in the customizer methods since converting null to a scalar value does not work- Returns:
- true if an unknown method called on a bean at runtime which does not have a mirrored method on the customizer should raise a RuntimeException
- Default:
- true
-
-