@Multibinding public interface TypeResolver
TypeResolver
attempts to deduce the object type from the provided
properties related to that object.
Historically to-bean transformers in Magnolia contained similar
functionality which is now provided as the default implementation
of this interface (ClassPropertyBasedTypeResolver
).
This interface is closely related to the BeanTypeResolver
component which manages the instances of type resolvers
.
NOTE: for the time being this class is meant for the internal use only and is a subject to change any moment!
Modifier and Type | Method and Description |
---|---|
default Optional<Class<?>> |
resolve(Map<String,Object> properties)
Deprecated.
since 6.1 - use
resolveType(TypeDescriptor, Map) instead. |
default Optional<Class<?>> |
resolveType(TypeDescriptor typeDescriptor,
Map<String,Object> properties)
Attempt to resolve the object type based on its properties and the
base parent type.
|
default boolean |
supportsType(TypeDescriptor typeDescriptor)
Report whether current resolver is capable of dealing with
the object types related to the one provided.
|
@Deprecated default Optional<Class<?>> resolve(Map<String,Object> properties)
resolveType(TypeDescriptor, Map)
instead.properties
- raw map of related bean propertiesOptional
instance containing the resolved class
in case of successful resolution or Optional.empty()
otherwise.default Optional<Class<?>> resolveType(TypeDescriptor typeDescriptor, Map<String,Object> properties)
typeDescriptor
- type descriptorproperties
- raw map of related bean propertiesOptional
instance containing the resolved class
in case of successful resolution or Optional.empty()
otherwise.default boolean supportsType(TypeDescriptor typeDescriptor)
typeDescriptor
- type descriptortrue
if current resolver is capable of resolving the
descendants of the type described by the provided type descriptor,
false
otherwise.Copyright © 2003–2021 Magnolia International Ltd.. All rights reserved.