org.hippoecm.hst.content.beans.manager
Class ObjectConverterImpl

java.lang.Object
  extended by org.hippoecm.hst.content.beans.manager.ObjectConverterImpl
All Implemented Interfaces:
ObjectConverter

public class ObjectConverterImpl
extends Object
implements ObjectConverter


Field Summary
protected  String[] fallBackJcrNodeTypes
           
protected  Map<Class<? extends HippoBean>,String> jcrBeanPrimaryNodeTypePairs
           
protected  Map<String,Class<? extends HippoBean>> jcrPrimaryNodeTypeBeanPairs
           
 
Constructor Summary
ObjectConverterImpl(Map<String,Class<? extends HippoBean>> jcrPrimaryNodeTypeBeanPairs, String[] fallBackJcrNodeTypes)
           
 
Method Summary
 Class<? extends HippoBean> getAnnotatedClassFor(String jcrPrimaryNodeType)
           
 Object getObject(javax.jcr.Node node)
           
 Object getObject(javax.jcr.Node node, String relPath)
           
 Object getObject(javax.jcr.Session session, String path)
           
 Object getObject(String uuid, javax.jcr.Node node)
           
 Object getObject(String uuid, javax.jcr.Session session)
           
 String getPrimaryNodeTypeNameFor(Class<? extends HippoBean> hippoBean)
           
 String getPrimaryObjectType(javax.jcr.Node node)
          Returns the Primary Node Type for a Node (or a child Node if the Node is a Handle) to be used for Object conversion, possibly using a fallback Node Type if no exact match can be determined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jcrPrimaryNodeTypeBeanPairs

protected Map<String,Class<? extends HippoBean>> jcrPrimaryNodeTypeBeanPairs

jcrBeanPrimaryNodeTypePairs

protected Map<Class<? extends HippoBean>,String> jcrBeanPrimaryNodeTypePairs

fallBackJcrNodeTypes

protected String[] fallBackJcrNodeTypes
Constructor Detail

ObjectConverterImpl

public ObjectConverterImpl(Map<String,Class<? extends HippoBean>> jcrPrimaryNodeTypeBeanPairs,
                           String[] fallBackJcrNodeTypes)
Method Detail

getObject

public Object getObject(javax.jcr.Session session,
                        String path)
                 throws ObjectBeanManagerException
Specified by:
getObject in interface ObjectConverter
Throws:
ObjectBeanManagerException

getObject

public Object getObject(javax.jcr.Node node,
                        String relPath)
                 throws ObjectBeanManagerException
Specified by:
getObject in interface ObjectConverter
Throws:
ObjectBeanManagerException

getObject

public Object getObject(String uuid,
                        javax.jcr.Session session)
                 throws ObjectBeanManagerException
Specified by:
getObject in interface ObjectConverter
Throws:
ObjectBeanManagerException

getObject

public Object getObject(String uuid,
                        javax.jcr.Node node)
                 throws ObjectBeanManagerException
Specified by:
getObject in interface ObjectConverter
Throws:
ObjectBeanManagerException

getObject

public Object getObject(javax.jcr.Node node)
                 throws ObjectBeanManagerException
Specified by:
getObject in interface ObjectConverter
Throws:
ObjectBeanManagerException

getPrimaryObjectType

public String getPrimaryObjectType(javax.jcr.Node node)
                            throws ObjectBeanManagerException
Description copied from interface: ObjectConverter
Returns the Primary Node Type for a Node (or a child Node if the Node is a Handle) to be used for Object conversion, possibly using a fallback Node Type if no exact match can be determined.

Specified by:
getPrimaryObjectType in interface ObjectConverter
Parameters:
node - to determine the Primary Object Type for
Returns:
Primary Object Type to be used for Object conversion
Throws:
ObjectBeanManagerException

getAnnotatedClassFor

public Class<? extends HippoBean> getAnnotatedClassFor(String jcrPrimaryNodeType)
Specified by:
getAnnotatedClassFor in interface ObjectConverter
Returns:
the annotated Class for this jcrPrimaryNodeType or null if no annotated class can be found

getPrimaryNodeTypeNameFor

public String getPrimaryNodeTypeNameFor(Class<? extends HippoBean> hippoBean)
Specified by:
getPrimaryNodeTypeNameFor in interface ObjectConverter


Copyright © 2008-2012 Hippo. All Rights Reserved.