info.magnolia.content2bean.impl
Class Content2BeanTransformerImpl

java.lang.Object
  extended by info.magnolia.content2bean.impl.Content2BeanTransformerImpl
All Implemented Interfaces:
Content.ContentFilter, Content2BeanTransformer
Direct Known Subclasses:
CacheConfigurationTransformer, CollectionPropertyHidingTransformer, CommandTransformer, Content2BeanUtil.DefaultClassTransformer, Content2BeanUtil.ToMapTransformer, IPSecurityManagerImpl.IPSecurityManagerTransformer

Deprecated. since 4.5.18 - use Node2BeanTransformerImpl instead.

@Singleton
public class Content2BeanTransformerImpl
extends Object
implements Content2BeanTransformer, Content.ContentFilter

Concrete implementation using reflection and adder methods.


Nested Class Summary
 
Nested classes/interfaces inherited from interface info.magnolia.content2bean.Content2BeanTransformer
Content2BeanTransformer.Factory
 
Constructor Summary
Content2BeanTransformerImpl()
          Deprecated.  
 
Method Summary
 boolean accept(Content content)
          Deprecated. Process all nodes except MetaData and nodes with names prefixed by "jcr:".
 Object convertPropertyValue(Class<?> propertyType, Object value)
          Deprecated. Most of the conversion is done by the BeanUtils.
 Collection<Content> getChildren(Content node)
          Deprecated. Returns the children of the node to be transformed.
 TypeMapping getTypeMapping()
          Deprecated. since 4.5, do not use.
 void initBean(TransformationState state, Map properties)
          Deprecated. Initializes bean by calling its init method if present.
 Object newBeanInstance(TransformationState state, Map properties, ComponentProvider componentProvider)
          Deprecated. Use the factory util to instantiate.
 TransformationState newState()
          Deprecated. Create a state object to share the state between the processor and transformer.
protected  TypeDescriptor onResolveType(TransformationState state, TypeDescriptor resolvedType, ComponentProvider componentProvider)
          Deprecated. since 4.5, use onResolveType(info.magnolia.content2bean.TypeMapping, info.magnolia.content2bean.TransformationState, info.magnolia.content2bean.TypeDescriptor, info.magnolia.objectfactory.ComponentProvider)
protected  TypeDescriptor onResolveType(TypeMapping typeMapping, TransformationState state, TypeDescriptor resolvedType, ComponentProvider componentProvider)
          Deprecated. Called once the type should have been resolved.
 TypeDescriptor resolveType(TransformationState state)
          Deprecated. 
 TypeDescriptor resolveType(TypeMapping typeMapping, TransformationState state, ComponentProvider componentProvider)
          Deprecated. Resolves the TypeDescriptor from current transformation state.
 void setProperty(TransformationState state, PropertyTypeDescriptor descriptor, Map<String,Object> values)
          Deprecated.  
 void setProperty(TypeMapping mapping, TransformationState state, PropertyTypeDescriptor descriptor, Map<String,Object> values)
          Deprecated. Do not set class property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Content2BeanTransformerImpl

public Content2BeanTransformerImpl()
Deprecated. 
Method Detail

resolveType

@Deprecated
public TypeDescriptor resolveType(TransformationState state)
                           throws ClassNotFoundException
Deprecated. 

Specified by:
resolveType in interface Content2BeanTransformer
Throws:
ClassNotFoundException

resolveType

public TypeDescriptor resolveType(TypeMapping typeMapping,
                                  TransformationState state,
                                  ComponentProvider componentProvider)
                           throws ClassNotFoundException
Deprecated. 
Resolves the TypeDescriptor from current transformation state. Resolving happens in the following order:

Specified by:
resolveType in interface Content2BeanTransformer
Throws:
ClassNotFoundException

onResolveType

protected TypeDescriptor onResolveType(TypeMapping typeMapping,
                                       TransformationState state,
                                       TypeDescriptor resolvedType,
                                       ComponentProvider componentProvider)
Deprecated. 
Called once the type should have been resolved. The resolvedType might be null if no type has been resolved. After the call the FactoryUtil and custom transformers are used to get the final type. TODO - check javadoc


onResolveType

protected TypeDescriptor onResolveType(TransformationState state,
                                       TypeDescriptor resolvedType,
                                       ComponentProvider componentProvider)
Deprecated. since 4.5, use onResolveType(info.magnolia.content2bean.TypeMapping, info.magnolia.content2bean.TransformationState, info.magnolia.content2bean.TypeDescriptor, info.magnolia.objectfactory.ComponentProvider)


getChildren

public Collection<Content> getChildren(Content node)
Deprecated. 
Description copied from interface: Content2BeanTransformer
Returns the children of the node to be transformed. Those are normally the direct children but might differ.

Specified by:
getChildren in interface Content2BeanTransformer

accept

public boolean accept(Content content)
Deprecated. 
Process all nodes except MetaData and nodes with names prefixed by "jcr:".

Specified by:
accept in interface Content.ContentFilter
Returns:
if true this will be a part of collection

setProperty

public void setProperty(TransformationState state,
                        PropertyTypeDescriptor descriptor,
                        Map<String,Object> values)
Deprecated. 
Specified by:
setProperty in interface Content2BeanTransformer

setProperty

public void setProperty(TypeMapping mapping,
                        TransformationState state,
                        PropertyTypeDescriptor descriptor,
                        Map<String,Object> values)
Deprecated. 
Do not set class property. In case of a map/collection try to use adder method.

Specified by:
setProperty in interface Content2BeanTransformer

convertPropertyValue

public Object convertPropertyValue(Class<?> propertyType,
                                   Object value)
                            throws Content2BeanException
Deprecated. 
Most of the conversion is done by the BeanUtils. TODO don't use bean utils conversion since it can't be used for the adder methods

Specified by:
convertPropertyValue in interface Content2BeanTransformer
Throws:
Content2BeanException

newBeanInstance

public Object newBeanInstance(TransformationState state,
                              Map properties,
                              ComponentProvider componentProvider)
                       throws Content2BeanException
Deprecated. 
Use the factory util to instantiate. This is useful to get default implementation of interfaces

Specified by:
newBeanInstance in interface Content2BeanTransformer
Throws:
Content2BeanException

initBean

public void initBean(TransformationState state,
                     Map properties)
              throws Content2BeanException
Deprecated. 
Initializes bean by calling its init method if present.

Specified by:
initBean in interface Content2BeanTransformer
Throws:
Content2BeanException

newState

public TransformationState newState()
Deprecated. 
Description copied from interface: Content2BeanTransformer
Create a state object to share the state between the processor and transformer.

Specified by:
newState in interface Content2BeanTransformer

getTypeMapping

public TypeMapping getTypeMapping()
Deprecated. since 4.5, do not use.

Returns the default mapping.

Specified by:
getTypeMapping in interface Content2BeanTransformer


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