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 java.lang.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.
-
-
Constructor Summary
Constructors Constructor Description ValueInspectorService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description @NotNull java.util.List<T>
inspect(@NotNull java.lang.String key, @NotNull java.util.List<java.lang.Object> rawValues, @NotNull java.lang.Object instance)
Inspect the value of given property to check if a specific value representation can be extracted.protected abstract T
inspectValue(@NotNull java.lang.String key, @NotNull java.lang.Object rawValue, @NotNull java.lang.Object instance)
Inspects raw value and tries to convert it to the target type.
-
-
-
Method Detail
-
inspect
@NotNull public @NotNull java.util.List<T> inspect(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.util.List<java.lang.Object> rawValues, @NotNull @NotNull java.lang.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 java.lang.String key, @NotNull @NotNull java.lang.Object rawValue, @NotNull @NotNull java.lang.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
-
-