public class Node2BeanTransformerImpl extends Object implements Node2BeanTransformer
Modifier | Constructor and Description |
---|---|
|
Node2BeanTransformerImpl()
Deprecated.
since 5.4 - use IoC, don't instantiate directly. You should not have to instantiate this if you
use magnolia-configuration mechanisms introduced in 5.4.
|
|
Node2BeanTransformerImpl(Class<?> defaultListImpl,
Class<?> defaultSetImpl,
Class<?> defaultQueueImpl)
Deprecated.
since 5.4 - use IoC, don't instantiate directly. You should not have to instantiate this if you
use magnolia-configuration mechanisms introduced in 5.4.
|
|
Node2BeanTransformerImpl(PreConfiguredBeanUtils beanUtilsBean)
Deprecated.
since 5.5.1 - use
Node2BeanTransformerImpl(PreConfiguredBeanUtils, BeanTypeResolver) instead. |
|
Node2BeanTransformerImpl(PreConfiguredBeanUtils beanUtilsBean,
BeanTypeResolver beanTypeResolver) |
protected |
Node2BeanTransformerImpl(PreConfiguredBeanUtils beanUtilsBean,
Class<?> defaultListImpl,
Class<?> defaultSetImpl,
Class<?> defaultQueueImpl,
BeanTypeResolver beanTypeResolver) |
Modifier and Type | Method and Description |
---|---|
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.
|
protected Collection<?> |
createCollectionFromMap(Map<?,?> map,
Class<?> clazz)
Creates collection from map.
|
javax.jcr.NodeIterator |
getChildren(javax.jcr.Node node)
Returns the children of the node to be transformed.
|
javax.jcr.PropertyIterator |
getProperties(javax.jcr.Node node) |
void |
initBean(TransformationState state,
Map values)
Called after all properties are set.
|
protected boolean |
isBeanEnabled(Object bean) |
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.
|
protected TypeDescriptor |
onResolveType(TypeMapping typeMapping,
TransformationState state,
TypeDescriptor resolvedType,
ComponentProvider componentProvider)
Called once the type should have been resolved.
|
TypeDescriptor |
resolveType(TypeMapping typeMapping,
TransformationState state,
ComponentProvider componentProvider)
Resolves the class to use for the current node.
|
void |
setProperty(TypeMapping mapping,
TransformationState state,
PropertyTypeDescriptor descriptor,
Map<String,Object> values)
Set this property on that bean.
|
boolean |
supportsValueClaims()
Returns whether this transformer handles value claims, helping
Node2BeanProcessor to report unknown bean properties. |
@Inject public Node2BeanTransformerImpl(PreConfiguredBeanUtils beanUtilsBean, BeanTypeResolver beanTypeResolver)
@Deprecated public Node2BeanTransformerImpl()
@Deprecated public Node2BeanTransformerImpl(PreConfiguredBeanUtils beanUtilsBean)
Node2BeanTransformerImpl(PreConfiguredBeanUtils, BeanTypeResolver)
instead.@Deprecated public Node2BeanTransformerImpl(Class<?> defaultListImpl, Class<?> defaultSetImpl, Class<?> defaultQueueImpl)
protected Node2BeanTransformerImpl(PreConfiguredBeanUtils beanUtilsBean, Class<?> defaultListImpl, Class<?> defaultSetImpl, Class<?> defaultQueueImpl, BeanTypeResolver beanTypeResolver)
public TransformationState newState()
Node2BeanTransformer
newState
in interface Node2BeanTransformer
public TypeDescriptor resolveType(TypeMapping typeMapping, TransformationState state, ComponentProvider componentProvider) throws ClassNotFoundException, javax.jcr.RepositoryException
Node2BeanTransformer
resolveType
in interface Node2BeanTransformer
ClassNotFoundException
javax.jcr.RepositoryException
public javax.jcr.NodeIterator getChildren(javax.jcr.Node node) throws javax.jcr.RepositoryException
Node2BeanTransformer
getChildren
in interface Node2BeanTransformer
javax.jcr.RepositoryException
public javax.jcr.PropertyIterator getProperties(javax.jcr.Node node) throws javax.jcr.RepositoryException
getProperties
in interface Node2BeanTransformer
javax.jcr.RepositoryException
public Object newBeanInstance(TransformationState state, Map<String,Object> values, ComponentProvider componentProvider) throws Node2BeanException
Node2BeanTransformer
newBeanInstance
in interface Node2BeanTransformer
Node2BeanException
public void initBean(TransformationState state, Map values) throws Node2BeanException
Node2BeanTransformer
initBean
in interface Node2BeanTransformer
Node2BeanException
public Object convertPropertyValue(Class<?> propertyType, Object value) throws Node2BeanException
Node2BeanTransformer
convertPropertyValue
in interface Node2BeanTransformer
Node2BeanException
protected TypeDescriptor onResolveType(TypeMapping typeMapping, TransformationState state, TypeDescriptor resolvedType, ComponentProvider componentProvider)
public void setProperty(TypeMapping mapping, TransformationState state, PropertyTypeDescriptor descriptor, Map<String,Object> values) throws javax.jcr.RepositoryException
Node2BeanTransformer
setProperty
in interface Node2BeanTransformer
javax.jcr.RepositoryException
public boolean canHandleValue(TypeMapping typeMapping, TransformationState state, PropertyTypeDescriptor descriptor, Map.Entry<String,Object> value)
Node2BeanTransformer
This is used in conjunction with Node2BeanProcessor
to help it report unknown properties
(aka TransformationProblems
).
canHandleValue
in interface Node2BeanTransformer
public boolean supportsValueClaims()
Node2BeanTransformer
Node2BeanProcessor
to report unknown bean properties.supportsValueClaims
in interface Node2BeanTransformer
#canHandleValue(TypeMapping, TransformationState, PropertyTypeDescriptor, Entry)
accordingly.protected boolean isBeanEnabled(Object bean)
protected Collection<?> createCollectionFromMap(Map<?,?> map, Class<?> clazz) throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
LinkedList
is used for creating List and Queue collections.HashSet
is used for creating Set collection.map
- a map which values will be converted to a collectionclazz
- collection typeSecurityException
NoSuchMethodException
IllegalArgumentException
InstantiationException
IllegalAccessException
InvocationTargetException
Copyright © 2003–2018 Magnolia International Ltd.. All rights reserved.