|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.jcr.node2bean.impl.Node2BeanTransformerImpl
public class Node2BeanTransformerImpl
Concrete implementation using reflection, generics and setter methods.
Constructor Summary | |
---|---|
Node2BeanTransformerImpl()
|
|
Node2BeanTransformerImpl(Class<?> defaultListImpl,
Class<?> defaultSetImpl,
Class<?> defaultQueueImpl)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Inject public Node2BeanTransformerImpl()
public Node2BeanTransformerImpl(Class<?> defaultListImpl, Class<?> defaultSetImpl, Class<?> defaultQueueImpl)
Method Detail |
---|
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 type
SecurityException
NoSuchMethodException
IllegalArgumentException
InstantiationException
IllegalAccessException
InvocationTargetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |