Package org.dspace.app.rest.converter
Class DSpaceObjectConverter<M extends DSpaceObject,R extends DSpaceObjectRest>
- java.lang.Object
-
- org.dspace.app.rest.converter.DSpaceObjectConverter<M,R>
-
- Type Parameters:
M- the Class in the DSpace API data modelR- the Class in the DSpace REST data model
- All Implemented Interfaces:
DSpaceConverter<M,R>
- Direct Known Subclasses:
BitstreamConverter,BundleConverter,CollectionConverter,CommunityConverter,EPersonConverter,GroupConverter,ItemConverter,SiteConverter
public abstract class DSpaceObjectConverter<M extends DSpaceObject,R extends DSpaceObjectRest> extends Object implements DSpaceConverter<M,R>
This is the base converter from/to objects in the DSpace API data model and the REST data model- Author:
- Andrea Bollini (andrea.bollini at 4science.it)
-
-
Constructor Summary
Constructors Constructor Description DSpaceObjectConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Rconvert(M obj, Projection projection)Convert a DSpace model object into its equivalent REST resource, applying a given projection.MetadataValueListgetPermissionFilteredMetadata(Context context, M obj)Retrieves the metadata list filtered according to the hidden metadata configuration When the context is null, it will return the metadatalist as for an anonymous userprotected abstract RnewInstance()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dspace.app.rest.converter.DSpaceConverter
getModelClass
-
-
-
-
Method Detail
-
convert
public R convert(M obj, Projection projection)
Description copied from interface:DSpaceConverterConvert a DSpace model object into its equivalent REST resource, applying a given projection.- Specified by:
convertin interfaceDSpaceConverter<M extends DSpaceObject,R extends DSpaceObjectRest>- Parameters:
obj- a DSpace API model object.- Returns:
- a resource representing the model object.
-
newInstance
protected abstract R newInstance()
-
getPermissionFilteredMetadata
public MetadataValueList getPermissionFilteredMetadata(Context context, M obj)
Retrieves the metadata list filtered according to the hidden metadata configuration When the context is null, it will return the metadatalist as for an anonymous user- Parameters:
context- The contextobj- The object of which the filtered metadata will be retrieved- Returns:
- A list of object metadata filtered based on the the hidden metadata configuration
-
-