Annotation Type ConfigType
Defines an instance of an OSGi R7 Component Property Type as a combination of a
Class
and an array of strings
defining property values in the form expected by Component.property()
.
This provides both runtime retention for OSGi config annotations that do not have RetentionPolicy.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 single
AnnotatedElement
.- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?>
Whenpid()
is set toComponent.NAME
, set this attribute to a class whose name should be used instead.boolean
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()
.Specify a configuration pid to load, which will override matching values specified byproperty()
.String[]
Treat likeComponent.property()
.
-
Element Details
-
type
Class<?> typeRequired type to construct. This can be an annotation or an interface.- Returns:
- the type to construct
-
-
-
pid
String pidSpecify 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<?> componentWhenpid()
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[] propertyTreat likeComponent.property()
.- Returns:
- osgi component properties
- Default:
- {}
-
lenient
boolean lenientWhen 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
-