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 model
R - 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 Details

    • DSpaceObjectConverter

      public DSpaceObjectConverter()
  • Method Details

    • convert

      public R convert(M obj, Projection projection)
      Description copied from interface: DSpaceConverter
      Convert a DSpace model object into its equivalent REST resource, applying a given projection.
      Specified by:
      convert in interface DSpaceConverter<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 context
      obj - The object of which the filtered metadata will be retrieved
      Returns:
      A list of object metadata filtered based on the the hidden metadata configuration