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) |
protected |
Node2BeanTransformerImpl(PreConfiguredBeanUtils beanUtilsBean,
Class<?> defaultListImpl,
Class<?> defaultSetImpl,
Class<?> defaultQueueImpl) |
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
@Deprecated public Node2BeanTransformerImpl()
@Inject public Node2BeanTransformerImpl(PreConfiguredBeanUtils beanUtilsBean)
@Deprecated public Node2BeanTransformerImpl(Class<?> defaultListImpl, Class<?> defaultSetImpl, Class<?> defaultQueueImpl)
protected Node2BeanTransformerImpl(PreConfiguredBeanUtils beanUtilsBean, Class<?> defaultListImpl, Class<?> defaultSetImpl, Class<?> defaultQueueImpl)
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 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
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–2016 Magnolia International Ltd.. All rights reserved.