org.apache.jackrabbit.ocm.manager.beanconverter.impl
Class InlineBeanConverterImpl

java.lang.Object
  extended by org.apache.jackrabbit.ocm.manager.beanconverter.impl.AbstractBeanConverterImpl
      extended by org.apache.jackrabbit.ocm.manager.beanconverter.impl.InlineBeanConverterImpl
All Implemented Interfaces:
BeanConverter

public class InlineBeanConverterImpl
extends AbstractBeanConverterImpl
implements BeanConverter

Bean converter used to map some node properties into one nested bean field. The corresponding bean field is not associated to a subnode.

Author:
Lombart Christophe

Field Summary
 
Fields inherited from class org.apache.jackrabbit.ocm.manager.beanconverter.impl.AbstractBeanConverterImpl
atomicTypeConverterProvider, mapper, objectConverter
 
Constructor Summary
InlineBeanConverterImpl(Mapper mapper, ObjectConverter objectConverter, AtomicTypeConverterProvider atomicTypeConverterProvider)
           
 
Method Summary
 Object getObject(Session session, Node parentNode, BeanDescriptor beanDescriptor, ClassDescriptor beanClassDescriptor, Class beanClass, Object bean)
          Retrieve a bean from the repository.
 void insert(Session session, Node parentNode, BeanDescriptor beanDescriptor, ClassDescriptor beanClassDescriptor, Object object, ClassDescriptor parentClassDescriptor, Object parent)
          Insert the object.
 void remove(Session session, Node parentNode, BeanDescriptor beanDescriptor, ClassDescriptor beanClassDescriptor, Object object, ClassDescriptor parentClassDescriptor, Object parent)
          Remove the bean from the repository.
 void update(Session session, Node parentNode, BeanDescriptor beanDescriptor, ClassDescriptor beanClassDescriptor, Object object, ClassDescriptor parentClassDescriptor, Object parent)
          Update repository from bean values.
 
Methods inherited from class org.apache.jackrabbit.ocm.manager.beanconverter.impl.AbstractBeanConverterImpl
getPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jackrabbit.ocm.manager.beanconverter.BeanConverter
getPath
 

Constructor Detail

InlineBeanConverterImpl

public InlineBeanConverterImpl(Mapper mapper,
                               ObjectConverter objectConverter,
                               AtomicTypeConverterProvider atomicTypeConverterProvider)
Method Detail

insert

public void insert(Session session,
                   Node parentNode,
                   BeanDescriptor beanDescriptor,
                   ClassDescriptor beanClassDescriptor,
                   Object object,
                   ClassDescriptor parentClassDescriptor,
                   Object parent)
            throws ObjectContentManagerException,
                   RepositoryException,
                   JcrMappingException
Description copied from interface: BeanConverter
Insert the object.

Specified by:
insert in interface BeanConverter
Specified by:
insert in class AbstractBeanConverterImpl
Parameters:
session - the JCR session
parentNode - The node which will contain the converter bean
beanDescriptor - The bean descriptor
beanClassDescriptor - the Class Descriptor associated to the bean to insert
object - the bean to convert( insert into the JCR structure)
parentClassDescriptor - The Class Descriptor associated to the parent object
parent - the object which will contain the bean to convert
Throws:
ObjectContentManagerException - thrown in case the insert fails; marks a failure due to logic of the insert (parent node cannot be accessed, the insert fails, etc.)
RepositoryException - thrown in case the underlying repository has thrown a javax.jcr.RepositoryException that is not possible to be handled or wrapped in ObjectContentManagerException; marks a repository failure
JcrMappingException - throws in case the mapping of the bean is not correct

update

public void update(Session session,
                   Node parentNode,
                   BeanDescriptor beanDescriptor,
                   ClassDescriptor beanClassDescriptor,
                   Object object,
                   ClassDescriptor parentClassDescriptor,
                   Object parent)
            throws ObjectContentManagerException,
                   RepositoryException,
                   JcrMappingException
Description copied from interface: BeanConverter
Update repository from bean values.

Specified by:
update in interface BeanConverter
Specified by:
update in class AbstractBeanConverterImpl
Parameters:
session - the JCR session
parentNode - The node which will contain the converter bean
beanDescriptor - The bean descriptor
beanClassDescriptor - the Class Descriptor associated to the bean to update
object - the bean to convert( insert into the JCR structure)
parentClassDescriptor - The Class Descriptor associated to the parent object
parent - the object which will contain the bean to convert
Throws:
ObjectContentManagerException - thrown in case the update fails; marks a failure due to logic of update (parent node cannot be accessed, the update fails, etc.)
RepositoryException - thrown in case the underlying repository has thrown a javax.jcr.RepositoryException that is not possible to be handled or wrapped in ObjectContentManagerException; marks a repository failure
JcrMappingException - throws in case the mapping of the bean is not correct

getObject

public Object getObject(Session session,
                        Node parentNode,
                        BeanDescriptor beanDescriptor,
                        ClassDescriptor beanClassDescriptor,
                        Class beanClass,
                        Object bean)
                 throws ObjectContentManagerException,
                        RepositoryException,
                        JcrMappingException
Description copied from interface: BeanConverter
Retrieve a bean from the repository.

Specified by:
getObject in interface BeanConverter
Specified by:
getObject in class AbstractBeanConverterImpl
Parameters:
session - the JCR session
parentNode - The parent node
beanDescriptor - The bean descriptor
beanClassDescriptor - the Class Descriptor associated to the bean to insert
beanClass - The bean Class
bean - The parent which contain the bean to retrieve
Throws:
ObjectContentManagerException - thrown in case the bean cannot be retrieved or initialized; marks a failure due to logic of retrieval
RepositoryException - thrown in case the underlying repository has thrown a javax.jcr.RepositoryException that is not possible to be handled or wrapped in ObjectContentManagerException; marks a repository failure
JcrMappingException - throws in case the mapping of the bean is not correct

remove

public void remove(Session session,
                   Node parentNode,
                   BeanDescriptor beanDescriptor,
                   ClassDescriptor beanClassDescriptor,
                   Object object,
                   ClassDescriptor parentClassDescriptor,
                   Object parent)
            throws ObjectContentManagerException,
                   RepositoryException,
                   JcrMappingException
Description copied from interface: BeanConverter
Remove the bean from the repository.

Specified by:
remove in interface BeanConverter
Specified by:
remove in class AbstractBeanConverterImpl
Parameters:
session - the JCR session
parentNode - The node which will contain the converter bean
beanDescriptor - The bean descriptor
beanClassDescriptor - the Class Descriptor associated to the bean to update
object - the bean to convert( insert into the JCR structure)
parentClassDescriptor - The Class Descriptor associated to the parent object
parent - the object which contains the bean to convert
Throws:
ObjectContentManagerException - thrown in case the bean cannot be removed; marks a failure due to logic of removal
RepositoryException - thrown in case the underlying repository has thrown a javax.jcr.RepositoryException that is not possible to be handled or wrapped in ObjectContentManagerException; marks a repository failure
JcrMappingException - throws in case the mapping of the bean is not correct


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