info.magnolia.jcr.node2bean
Interface Node2BeanTransformer

All Known Implementing Classes:
CollectionPropertyHidingTransformer, Node2BeanTransformerImpl

public interface Node2BeanTransformer

Contract for transformation from node to java beans.


Method Summary
 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.
 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.
 

Method Detail

newState

TransformationState newState()
Create a state object to share the state between the processor and transformer.


resolveType

TypeDescriptor resolveType(TypeMapping typeMapping,
                           TransformationState state,
                           ComponentProvider componentProvider)
                           throws ClassNotFoundException,
                                  javax.jcr.RepositoryException
Resolves the class to use for the current node.

Throws:
ClassNotFoundException
javax.jcr.RepositoryException

getChildren

javax.jcr.NodeIterator getChildren(javax.jcr.Node node)
                                   throws javax.jcr.RepositoryException
Returns the children of the node to be transformed. Those are normally the direct children but might differ.

Throws:
javax.jcr.RepositoryException

newBeanInstance

Object newBeanInstance(TransformationState state,
                       Map<String,Object> values,
                       ComponentProvider componentProvider)
                       throws Node2BeanException
Instantiates the bean.

Throws:
Node2BeanException

initBean

void initBean(TransformationState state,
              Map<String,Object> values)
              throws Node2BeanException
Called after all properties are set.

Throws:
Node2BeanException

setProperty

void setProperty(TypeMapping typeMapping,
                 TransformationState state,
                 PropertyTypeDescriptor descriptor,
                 Map<String,Object> values)
                 throws javax.jcr.RepositoryException
Set this property on that bean. Allows excluding of properties.

Throws:
javax.jcr.RepositoryException

convertPropertyValue

Object convertPropertyValue(Class<?> propertyType,
                            Object value)
                            throws Node2BeanException
Transforms the simple basic jcr property value objects to more complex properties.

Throws:
Node2BeanException


Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.