@ComponentPropertyType
public @interface SlingAdapter
AdapterFactory
.
The annotated component will be registered as a Sling adapter, using its minimum required configuration.
Due to technical limitations, it is possible to set either of the values to an empty array, in which case the adapter registration will not be picked up by the framework. Extra care must be taken by the developer to ensure that both values will are entered correctly.
If multiple implementations for the same combination of adapter and adaptable are registered,
the implementation with the lowest service.ranking
-property wins. This property can be set
through the use of the ServiceRanking
Component Property Type annotation.
The services defined through this annotation will be picked up by the AdapterManager
, which is
responsible for honoring the service.ranking
when multiple matching factories are found.
Warning: It is up to the implementation of the annotated class to handle the adaption properly:
type
-parameter can be used to check the adapter-type requested;adapter.condition
should be set to indicate this.
For the registration of the other related service properties, see also AdapterCondition
and the
lesser used AdapterDeprecated
.
Modifier and Type | Required Element and Description |
---|---|
Class<?>[] |
adaptables
Specifies the adaptables for which this adapter will be called.
|
Class<?>[] |
adapters
Specifies the adapters for which this adapter will be called, but only if the source adaptable matches
any of the specified adaptables.
|
public abstract Class<?>[] adaptables
public abstract Class<?>[] adapters
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.