Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.relations.api.impl
Class AbstractResourceAdapter

java.lang.Object
  extended by org.nuxeo.ecm.platform.relations.api.impl.AbstractResourceAdapter
All Implemented Interfaces:
ResourceAdapter
Direct Known Subclasses:
DocumentModelResourceAdapter

public abstract class AbstractResourceAdapter
extends Object
implements ResourceAdapter

Author:
Anahide Tchertchian

Field Summary
 
Fields inherited from interface org.nuxeo.ecm.platform.relations.api.ResourceAdapter
CORE_SESSION_ID_CONTEXT_KEY
 
Constructor Summary
AbstractResourceAdapter()
           
 
Method Summary
 Class<?> getKlass()
           
 String getNamespace()
           
 Resource getResource(Serializable object, Map<String,Serializable> context)
          Transforms an incoming object into a Resource.
 Serializable getResourceRepresentation(Resource resource, Map<String,Serializable> context)
          Resolves the resource to an applicative representation, for instance a DocumentModel.
 void setNamespace(String namespace)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractResourceAdapter

public AbstractResourceAdapter()
Method Detail

getNamespace

public String getNamespace()
Specified by:
getNamespace in interface ResourceAdapter

setNamespace

public void setNamespace(String namespace)
Specified by:
setNamespace in interface ResourceAdapter

getKlass

public Class<?> getKlass()
Specified by:
getKlass in interface ResourceAdapter
Returns:
the class being adapted

getResource

public Resource getResource(Serializable object,
                            Map<String,Serializable> context)
Description copied from interface: ResourceAdapter
Transforms an incoming object into a Resource.

Specified by:
getResource in interface ResourceAdapter
Parameters:
object - the object to transform
context - a context map
Returns:
the resource

getResourceRepresentation

public Serializable getResourceRepresentation(Resource resource,
                                              Map<String,Serializable> context)
Description copied from interface: ResourceAdapter
Resolves the resource to an applicative representation, for instance a DocumentModel.

Specified by:
getResourceRepresentation in interface ResourceAdapter
context - a context map (holding for instance a CoreSession instance.
Returns:
the representation

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.