Annotation Type ConfigType
-
@Repeatable(ConfigTypes.class) @Retention(RUNTIME) public @interface ConfigType
Defines an instance of an OSGi R7 Component Property Type as a combination of aClass
and an array of strings defining property values in the form expected byComponent.property()
. This provides both runtime retention for OSGi config annotations that do not haveRetentionPolicy.RUNTIME
, allowing for simple construction through reflection for explicit passing to SCR component constructors and lifecycle methods, as well as repeatability to support defining sequenced, heterogeneous lists of desired types on any singleAnnotatedElement
.- See Also:
- Component Property Types
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Class<?>
component
Whenpid()
is set toComponent.NAME
, set this attribute to a class whose name should be used instead.boolean
lenient
When set to false, throw aConfigTypeStrictnessViolation
on construction if there is not an exact one-to-one mapping between property names specified inproperty()
and the addressable attributes oftype()
.String
pid
Specify a configuration pid to load, which will override matching values specified byproperty()
.String[]
property
Treat likeComponent.property()
.
-
-
-
Element Detail
-
type
Class<?> type
Required type to construct. This can be an annotation or an interface.- Returns:
- the type to construct
-
-
-
pid
String pid
Specify a configuration pid to load, which will override matching values specified byproperty()
. The default value isComponent.NAME
, which is a special string ("$") that can be used to specify the name of thecomponent()
class as a configuration PID.- Returns:
- a configuration pid, or an empty string
- Default:
- "$"
-
-
-
component
Class<?> component
Whenpid()
is set toComponent.NAME
, set this attribute to a class whose name should be used instead. The default value isVoid
, which has a special significance for this annotation indicating that no configuration should be loaded from ConfigurationAdmin.- Returns:
- the configurable component class
- Default:
- java.lang.Void.class
-
-
-
property
String[] property
Treat likeComponent.property()
.- Returns:
- osgi component properties
- Default:
- {}
-
-
-
lenient
boolean lenient
When set to false, throw aConfigTypeStrictnessViolation
on construction if there is not an exact one-to-one mapping between property names specified inproperty()
and the addressable attributes oftype()
. Properties loaded from configuration are not considered by the strictness check.- Returns:
- false to enforce strictness, true to skip the check
- Default:
- false
-
-