Class ValueInspectorService<T extends GenericValue>
java.lang.Object
io.wcm.siteapi.genericedit.builder.ValueInspectorService<T>
- All Implemented Interfaces:
io.wcm.sling.commons.caservice.ContextAwareService
@ConsumerType
public abstract class ValueInspectorService<T extends GenericValue>
extends Object
implements io.wcm.sling.commons.caservice.ContextAwareService
Allows to customize the inspection process which turns properties in Sling Models instance
to specific ones e.g. for links, media and rich text.
-
Field Summary
Fields inherited from interface io.wcm.sling.commons.caservice.ContextAwareService
PROPERTY_ACCEPTS_CONTEXT_PATH_EMPTY, PROPERTY_CONTEXT_PATH_BLACKLIST_PATTERN, PROPERTY_CONTEXT_PATH_PATTERN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInspect the value of given property to check if a specific value representation can be extracted.protected abstract TinspectValue(@NotNull String key, @NotNull Object rawValue, @NotNull Object instance) Inspects raw value and tries to convert it to the target type.
-
Constructor Details
-
ValueInspectorService
public ValueInspectorService()
-
-
Method Details
-
inspect
@NotNull public @NotNull List<T> inspect(@NotNull @NotNull String key, @NotNull @NotNull List<Object> rawValues, @NotNull @NotNull Object instance) Inspect the value of given property to check if a specific value representation can be extracted.- Parameters:
key- Property keyrawValues- Raw property valuesinstance- Instance property is read from for further inspection- Returns:
- List of matching values that are found. Returns empty list if not value was found.
-
inspectValue
@Nullable protected abstract T inspectValue(@NotNull @NotNull String key, @NotNull @NotNull Object rawValue, @NotNull @NotNull Object instance) Inspects raw value and tries to convert it to the target type.- Parameters:
key- Property keyrawValue- Raw property valueinstance- Instance property is read from for further inspection- Returns:
- Target type instance or null
-