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 -
Method Summary
Modifier and TypeMethodDescriptionconvert(M obj, Projection projection) Convert a DSpace model object into its equivalent REST resource, applying a given projection.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 userprotected abstract RMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.dspace.app.rest.converter.DSpaceConverter
getModelClass
-
Constructor Details
-
DSpaceObjectConverter
public DSpaceObjectConverter()
-
-
Method Details
-
convert
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
-
getPermissionFilteredMetadata
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
-