@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 |
---|---|
Optional<Class<?>> |
resolve(Map<String,Object> properties)
Attempt to resolve the object type based on its properties.
|
boolean |
supportsType(TypeDescriptor typeDescriptor)
Report whether current resolver is capable of dealing with
the object types related to the one provided.
|
Optional<Class<?>> resolve(Map<String,Object> properties)
properties
- raw map of related bean propertiesOptional
instance containing the resolved class
in case of successful resolution or Optional.empty()
otherwise.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–2017 Magnolia International Ltd.. All rights reserved.