org.apache.jackrabbit.ocm.manager.objectconverter.impl
Class ObjectConverterImpl

java.lang.Object
  extended by org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl
All Implemented Interfaces:
ObjectConverter

public class ObjectConverterImpl
extends Object
implements ObjectConverter

Default implementation for ObjectConverterImpl

Author:
Lombart Christophe , Alexandru Popescu, Boni Gopalan

Constructor Summary
ObjectConverterImpl()
          No-arg constructor.
ObjectConverterImpl(Mapper mapper, AtomicTypeConverterProvider converterProvider)
          Constructor
ObjectConverterImpl(Mapper mapper, AtomicTypeConverterProvider converterProvider, ProxyManager proxyManager, ObjectCache requestObjectCache)
          Constructor
 
Method Summary
 Object getObject(Session session, Class clazz, String path)
          Retrieve an object from the JCR repo
 Object getObject(Session session, String path)
          Retrieve an object from the JCR repo
 String getPath(Session session, Object object)
          Get the object JCR path
 void insert(Session session, Node parentNode, String nodeName, Object object)
          Insert the object
 void insert(Session session, Object object)
          Insert the object
 void retrieveAllMappedAttributes(Session session, Object object)
          Retrieve all mapped attributes for the given persistent object.
 void retrieveMappedAttribute(Session session, Object object, String attributeName)
          Retrieve the specified attribute for the given persistent object.
 void setAtomicTypeConverterProvider(AtomicTypeConverterProvider converterProvider)
          Sets the converter provider.
 void setMapper(Mapper mapper)
          Set the Mapper used to solve mappings.
 void update(Session session, Node objectNode, Object object)
          Update the object
 void update(Session session, Node parentNode, String nodeName, Object object)
          Update the object
 void update(Session session, Object object)
          Update the object
 void update(Session session, String uuId, Object object)
          Update the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectConverterImpl

public ObjectConverterImpl()
No-arg constructor.


ObjectConverterImpl

public ObjectConverterImpl(Mapper mapper,
                           AtomicTypeConverterProvider converterProvider)
Constructor

Parameters:
mapper - The mapper to used
converterProvider - The atomic type converter provider

ObjectConverterImpl

public ObjectConverterImpl(Mapper mapper,
                           AtomicTypeConverterProvider converterProvider,
                           ProxyManager proxyManager,
                           ObjectCache requestObjectCache)
Constructor

Parameters:
mapper - The mapper to used
converterProvider - The atomic type converter provider
Method Detail

setMapper

public void setMapper(Mapper mapper)
Set the Mapper used to solve mappings.

Parameters:
mapper - a Mapper

setAtomicTypeConverterProvider

public void setAtomicTypeConverterProvider(AtomicTypeConverterProvider converterProvider)
Sets the converter provider.

Parameters:
converterProvider - an AtomicTypeConverterProvider

insert

public void insert(Session session,
                   Object object)
Description copied from interface: ObjectConverter
Insert the object

Specified by:
insert in interface ObjectConverter
Parameters:
session - the JCR session
object - the object to insert
See Also:
ObjectConverter.insert(javax.jcr.Session, java.lang.Object)

insert

public void insert(Session session,
                   Node parentNode,
                   String nodeName,
                   Object object)
Description copied from interface: ObjectConverter
Insert the object

Specified by:
insert in interface ObjectConverter
Parameters:
session - the JCR session
parentNode - The parent node used to store the new JCR element (object)
nodeName - The node name used to store the object
object - the object to insert
See Also:
ObjectConverter.insert(javax.jcr.Session, javax.jcr.Node, java.lang.String, java.lang.Object)

update

public void update(Session session,
                   Object object)
Description copied from interface: ObjectConverter
Update the object

Specified by:
update in interface ObjectConverter
Parameters:
session - the JCR session
object - the object to update
See Also:
ObjectConverter.update(javax.jcr.Session, java.lang.Object)

update

public void update(Session session,
                   String uuId,
                   Object object)
Description copied from interface: ObjectConverter
Update the object

Specified by:
update in interface ObjectConverter
Parameters:
session - the JCR session
uuId - The UUID of the node to get updated.
object - the object to update
See Also:
ObjectConverter.update(javax.jcr.Session, javax.jcr.Node, java.lang.String, java.lang.Object)

update

public void update(Session session,
                   Node objectNode,
                   Object object)
Description copied from interface: ObjectConverter
Update the object

Specified by:
update in interface ObjectConverter
Parameters:
session - the JCR session
objectNode - The node to store the object
object - the object to update
See Also:
ObjectConverter.update(javax.jcr.Session, javax.jcr.Node, java.lang.Object)

update

public void update(Session session,
                   Node parentNode,
                   String nodeName,
                   Object object)
Description copied from interface: ObjectConverter
Update the object

Specified by:
update in interface ObjectConverter
Parameters:
session - the JCR session
parentNode - The parent node used to store the new JCR element (object)
nodeName - The node name used to store the object
object - the object to update
See Also:
ObjectConverter.update(javax.jcr.Session, javax.jcr.Node, java.lang.String, java.lang.Object)

getObject

public Object getObject(Session session,
                        String path)
Description copied from interface: ObjectConverter
Retrieve an object from the JCR repo

Specified by:
getObject in interface ObjectConverter
Parameters:
session - The JCR session
path - the JCR path
Returns:
The object found or null
See Also:
ObjectConverter.getObject(javax.jcr.Session, java.lang.Class, java.lang.String)

getObject

public Object getObject(Session session,
                        Class clazz,
                        String path)
Description copied from interface: ObjectConverter
Retrieve an object from the JCR repo

Specified by:
getObject in interface ObjectConverter
Parameters:
session - The JCR session
clazz - The class assigned to the object to retrieve
path - the JCR path
Returns:
The object found or null
See Also:
ObjectConverter.getObject(javax.jcr.Session, java.lang.Class, java.lang.String)

retrieveAllMappedAttributes

public void retrieveAllMappedAttributes(Session session,
                                        Object object)
Description copied from interface: ObjectConverter
Retrieve all mapped attributes for the given persistent object.

Specified by:
retrieveAllMappedAttributes in interface ObjectConverter
Parameters:
session - The JCR session
object - The persistent object

retrieveMappedAttribute

public void retrieveMappedAttribute(Session session,
                                    Object object,
                                    String attributeName)
Description copied from interface: ObjectConverter
Retrieve the specified attribute for the given persistent object. this attribute is either a bean or a collection. This method is usefull if the corresponding descriptor has an autoRetrieve="false"

Specified by:
retrieveMappedAttribute in interface ObjectConverter
Parameters:
session - The JCR session
object - The persistent object
attributeName - The name of the attribute to retrieve

getPath

public String getPath(Session session,
                      Object object)
Description copied from interface: ObjectConverter
Get the object JCR path

Specified by:
getPath in interface ObjectConverter
Parameters:
session - the JCR session
object - the object for which the path has to be retrieve
Returns:
the object JCR path
Throws:
JcrMappingException
See Also:
ObjectConverter.getPath(javax.jcr.Session, java.lang.Object)


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.