info.magnolia.module.blossom.content2bean
Class SpringContent2BeanTransformer

java.lang.Object
  extended by info.magnolia.content2bean.impl.Content2BeanTransformerImpl
      extended by info.magnolia.module.blossom.content2bean.SpringContent2BeanTransformer
All Implemented Interfaces:
info.magnolia.cms.core.Content.ContentFilter, info.magnolia.content2bean.Content2BeanTransformer

public class SpringContent2BeanTransformer
extends info.magnolia.content2bean.impl.Content2BeanTransformerImpl

Content2BeanTransformer that provides support for autowiring of properties, initialization callbacks and gives any configured BeanPostProcessors a chance to modify or proxy the bean.

You can get access to the content node by implementing a method with the signature void setContent(Content). It will be called before bean post processors are called and initialization callbacks. More specifically before @PostConstruct and afterPropertiesSet().

Contrary to the normal Content2Bean mechanism it will NOT invoke a method with the signature void init(). Instead use @PostConstruct or implement InitializingBean.

Since:
1.2

Nested Class Summary
 
Nested classes/interfaces inherited from interface info.magnolia.content2bean.Content2BeanTransformer
info.magnolia.content2bean.Content2BeanTransformer.Factory
 
Constructor Summary
SpringContent2BeanTransformer(org.springframework.beans.factory.config.AutowireCapableBeanFactory autowireCapableBeanFactory)
           
 
Method Summary
 void initBean(info.magnolia.content2bean.TransformationState state, Map properties)
           
 Object newBeanInstance(info.magnolia.content2bean.TransformationState state, Map properties, info.magnolia.objectfactory.ComponentProvider componentProvider)
           
protected  info.magnolia.content2bean.TypeDescriptor onResolveType(info.magnolia.content2bean.TypeMapping typeMapping, info.magnolia.content2bean.TransformationState state, info.magnolia.content2bean.TypeDescriptor resolvedType, info.magnolia.objectfactory.ComponentProvider componentProvider)
           
protected  String resolveBeanName(info.magnolia.content2bean.TransformationState state, Object bean)
           
 void setDefaultClass(Class<?> defaultClass)
           
 void setTopLevelBeanName(String topLevelBeanName)
           
 
Methods inherited from class info.magnolia.content2bean.impl.Content2BeanTransformerImpl
accept, convertPropertyValue, getChildren, getTypeMapping, newState, onResolveType, resolveType, resolveType, setProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringContent2BeanTransformer

public SpringContent2BeanTransformer(org.springframework.beans.factory.config.AutowireCapableBeanFactory autowireCapableBeanFactory)
Method Detail

setDefaultClass

public void setDefaultClass(Class<?> defaultClass)

setTopLevelBeanName

public void setTopLevelBeanName(String topLevelBeanName)

onResolveType

protected info.magnolia.content2bean.TypeDescriptor onResolveType(info.magnolia.content2bean.TypeMapping typeMapping,
                                                                  info.magnolia.content2bean.TransformationState state,
                                                                  info.magnolia.content2bean.TypeDescriptor resolvedType,
                                                                  info.magnolia.objectfactory.ComponentProvider componentProvider)
Overrides:
onResolveType in class info.magnolia.content2bean.impl.Content2BeanTransformerImpl

newBeanInstance

public Object newBeanInstance(info.magnolia.content2bean.TransformationState state,
                              Map properties,
                              info.magnolia.objectfactory.ComponentProvider componentProvider)
                       throws info.magnolia.content2bean.Content2BeanException
Specified by:
newBeanInstance in interface info.magnolia.content2bean.Content2BeanTransformer
Overrides:
newBeanInstance in class info.magnolia.content2bean.impl.Content2BeanTransformerImpl
Throws:
info.magnolia.content2bean.Content2BeanException

initBean

public void initBean(info.magnolia.content2bean.TransformationState state,
                     Map properties)
              throws info.magnolia.content2bean.Content2BeanException
Specified by:
initBean in interface info.magnolia.content2bean.Content2BeanTransformer
Overrides:
initBean in class info.magnolia.content2bean.impl.Content2BeanTransformerImpl
Throws:
info.magnolia.content2bean.Content2BeanException

resolveBeanName

protected String resolveBeanName(info.magnolia.content2bean.TransformationState state,
                                 Object bean)


Copyright © 2009-2012 Magnolia International Ltd.. All Rights Reserved.