Class ValueMapInjector
java.lang.Object
org.apache.sling.models.impl.injectors.ValueMapInjector
- All Implemented Interfaces:
org.apache.sling.models.spi.Injector,org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory,org.apache.sling.models.spi.ValuePreparer
public class ValueMapInjector
extends Object
implements org.apache.sling.models.spi.Injector, org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory, org.apache.sling.models.spi.ValuePreparer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorcreateAnnotationProcessor(Object adaptable, AnnotatedElement element) @NotNull StringgetName()protected org.apache.sling.api.resource.ResourceResolvergetResourceResolver(Object adaptable) getValue(@NotNull Object adaptable, String name, @NotNull Type type, @NotNull AnnotatedElement element, @NotNull org.apache.sling.models.spi.DisposalCallbackRegistry callbackRegistry) protected @Nullable org.apache.sling.api.resource.ValueMapgetValueMap(Object adaptable) Retrieve the ValueMap from the given adaptable.protected booleanisDeclaredTypeCollection(Type declaredType) @NotNull ObjectprepareValue(@NotNull Object adaptable) protected @Nullable org.apache.sling.api.resource.ValueMaptoValueMap(org.apache.sling.api.resource.Resource resource)
-
Constructor Details
-
ValueMapInjector
public ValueMapInjector()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceorg.apache.sling.models.spi.Injector
-
getValue
public Object getValue(@NotNull @NotNull Object adaptable, String name, @NotNull @NotNull Type type, @NotNull @NotNull AnnotatedElement element, @NotNull @NotNull org.apache.sling.models.spi.DisposalCallbackRegistry callbackRegistry) - Specified by:
getValuein interfaceorg.apache.sling.models.spi.Injector
-
prepareValue
- Specified by:
prepareValuein interfaceorg.apache.sling.models.spi.ValuePreparer
-
createAnnotationProcessor
public org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessor createAnnotationProcessor(Object adaptable, AnnotatedElement element) - Specified by:
createAnnotationProcessorin interfaceorg.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory
-
getResourceResolver
-
getValueMap
Retrieve the ValueMap from the given adaptable. This succeeds, if the adaptable is either- a
ValueMap, - a
SlingJakartaHttpServletRequestorSlingHttpServletRequest, in which case the returnedValueMapis the one derived from the request's resource or - adaptable to a
ValueMap.
nullis returned.- Parameters:
adaptable- Adaptable- Returns:
- a ValueMap or
null.
- a
-
toValueMap
@Nullable protected @Nullable org.apache.sling.api.resource.ValueMap toValueMap(org.apache.sling.api.resource.Resource resource) -
isDeclaredTypeCollection
-