org.apache.jackrabbit.ocm.manager.collectionconverter
Interface CollectionConverter

All Known Implementing Classes:
AbstractCollectionConverterImpl, BeanReferenceCollectionConverterImpl, BeanReferenceMapConverterImpl, DefaultCollectionConverterImpl, MultiValueCollectionConverterImpl, NTCollectionConverterImpl, ReferenceCollectionConverterImpl, ResidualNodesCollectionConverterImpl, ResidualPropertiesCollectionConverterImpl

public interface CollectionConverter

Convert any kind of ManageableObjects into severals JCR nodes.

Author:
Lombart Christophe

Method Summary
 ManageableObjects getCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, Class collectionFieldClass)
          Get a ManageableObjects from the JCR repository
 void insertCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, ManageableObjects objects)
          Insert/convert collection elements (a Collection or a Map) into some JCR nodes
 boolean isNull(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, Class collectionFieldClass)
          Check if the collection is null.
 void updateCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, ManageableObjects objects)
          Update collection elements (a Collection or a Map) already present in the JCR repository
 

Method Detail

insertCollection

void insertCollection(Session session,
                      Node parentNode,
                      CollectionDescriptor collectionDescriptor,
                      ManageableObjects objects)
                      throws ObjectContentManagerException
Insert/convert collection elements (a Collection or a Map) into some JCR nodes

Parameters:
session - The JCR session
parentNode - the node which will contains the collection element
collectionDescriptor - The collection descriptor
objects - The objects to insert
Throws:
ObjectContentManagerException - when it is not possible to insert the collection

updateCollection

void updateCollection(Session session,
                      Node parentNode,
                      CollectionDescriptor collectionDescriptor,
                      ManageableObjects objects)
                      throws ObjectContentManagerException
Update collection elements (a Collection or a Map) already present in the JCR repository

Parameters:
session - The JCR session
parentNode - the node which will contains the collection element
collectionDescriptor - The collection descriptor
objects - The objects to update
Throws:
ObjectContentManagerException - when it is not possible to update the collection

getCollection

ManageableObjects getCollection(Session session,
                                Node parentNode,
                                CollectionDescriptor collectionDescriptor,
                                Class collectionFieldClass)
                                throws ObjectContentManagerException
Get a ManageableObjects from the JCR repository

Parameters:
session - The JCR session
parentNode - the node which contains the collection element
collectionDescriptor - The collection descriptor
collectionFieldClass - The collection class to used (ArrayList, Vector, ..)
Returns:
The collection or a map populates with all elements found in the JCR repository
Throws:
ObjectContentManagerException - when it is not possible to retrieve the collection

isNull

boolean isNull(Session session,
               Node parentNode,
               CollectionDescriptor collectionDescriptor,
               Class collectionFieldClass)
               throws ObjectContentManagerException
Check if the collection is null. This method is mainly used in the Proxy manager to return a null value or a proxy object Without proxy proxy, this method is never called.

Parameters:
session - The JCR session
parentNode - the node which contains the collection element
collectionDescriptor - The collection descriptor
collectionFieldClass - The collection class to used (ArrayList, Vector, ..)
Returns:
true if the collection contains elements.
Throws:
ObjectContentManagerException - when it is not possible to retrieve the collection


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