Class AbstractResourceAdapter
- java.lang.Object
-
- 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 Modifier and Type Field Description protected String
namespace
-
Fields inherited from interface org.nuxeo.ecm.platform.relations.api.ResourceAdapter
CORE_SESSION_CONTEXT_KEY
-
-
Constructor Summary
Constructors Constructor Description AbstractResourceAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>
getKlass()
String
getNamespace()
Resource
getResource(Serializable object, Map<String,Object> context)
Transforms an incoming object into a Resource.Serializable
getResourceRepresentation(Resource resource, Map<String,Object> context)
Resolves the resource to an applicative representation, for instance aDocumentModel
.void
setNamespace(String namespace)
-
-
-
Field Detail
-
namespace
protected String namespace
-
-
Method Detail
-
getNamespace
public String getNamespace()
- Specified by:
getNamespace
in interfaceResourceAdapter
-
setNamespace
public void setNamespace(String namespace)
- Specified by:
setNamespace
in interfaceResourceAdapter
-
getKlass
public Class<?> getKlass()
- Specified by:
getKlass
in interfaceResourceAdapter
- Returns:
- the class being adapted
-
getResource
public Resource getResource(Serializable object, Map<String,Object> context)
Description copied from interface:ResourceAdapter
Transforms an incoming object into a Resource.- Specified by:
getResource
in interfaceResourceAdapter
- Parameters:
object
- the object to transformcontext
- a context map- Returns:
- the resource
-
getResourceRepresentation
public Serializable getResourceRepresentation(Resource resource, Map<String,Object> context)
Description copied from interface:ResourceAdapter
Resolves the resource to an applicative representation, for instance aDocumentModel
.- Specified by:
getResourceRepresentation
in interfaceResourceAdapter
context
- a context map (holding for instance aCoreSession
instance.- Returns:
- the representation
-
-