public interface Node2BeanTransformer
Modifier and Type | Method and Description |
---|---|
default boolean |
canHandleValue(TypeMapping typeMapping,
TransformationState state,
PropertyTypeDescriptor descriptor,
Map.Entry<String,Object> value)
Returns whether this transformer can consume the given value and assign it to the currently-processed bean.
|
Object |
convertPropertyValue(Class<?> propertyType,
Object value)
Transforms the simple basic jcr property value objects to more complex properties.
|
javax.jcr.NodeIterator |
getChildren(javax.jcr.Node node)
Returns the children of the node to be transformed.
|
default javax.jcr.PropertyIterator |
getProperties(javax.jcr.Node node) |
void |
initBean(TransformationState state,
Map<String,Object> values)
Called after all properties are set.
|
Object |
newBeanInstance(TransformationState state,
Map<String,Object> values,
ComponentProvider componentProvider)
Instantiates the bean.
|
TransformationState |
newState()
Create a state object to share the state between the processor and transformer.
|
TypeDescriptor |
resolveType(TypeMapping typeMapping,
TransformationState state,
ComponentProvider componentProvider)
Resolves the class to use for the current node.
|
void |
setProperty(TypeMapping typeMapping,
TransformationState state,
PropertyTypeDescriptor descriptor,
Map<String,Object> values)
Set this property on that bean.
|
default boolean |
supportsValueClaims()
Returns whether this transformer handles value claims, helping
Node2BeanProcessor to report unknown bean properties. |
TransformationState newState()
TypeDescriptor resolveType(TypeMapping typeMapping, TransformationState state, ComponentProvider componentProvider) throws ClassNotFoundException, javax.jcr.RepositoryException
ClassNotFoundException
javax.jcr.RepositoryException
javax.jcr.NodeIterator getChildren(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
default javax.jcr.PropertyIterator getProperties(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
Object newBeanInstance(TransformationState state, Map<String,Object> values, ComponentProvider componentProvider) throws Node2BeanException
Node2BeanException
void initBean(TransformationState state, Map<String,Object> values) throws Node2BeanException
Node2BeanException
void setProperty(TypeMapping typeMapping, TransformationState state, PropertyTypeDescriptor descriptor, Map<String,Object> values) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
default boolean canHandleValue(TypeMapping typeMapping, TransformationState state, PropertyTypeDescriptor descriptor, Map.Entry<String,Object> value)
This is used in conjunction with Node2BeanProcessor
to help it report unknown properties
(aka TransformationProblems
).
default boolean supportsValueClaims()
Node2BeanProcessor
to report unknown bean properties.#canHandleValue(TypeMapping, TransformationState, PropertyTypeDescriptor, Entry)
accordingly.Object convertPropertyValue(Class<?> propertyType, Object value) throws Node2BeanException
Node2BeanException
Copyright © 2003–2018 Magnolia International Ltd.. All rights reserved.