Package org.dspace.app.rest.converter
Class ItemConverter
- java.lang.Object
-
- org.dspace.app.rest.converter.DSpaceObjectConverter<Item,ItemRest>
-
- org.dspace.app.rest.converter.ItemConverter
-
- All Implemented Interfaces:
DSpaceConverter<Item,ItemRest>,IndexableObjectConverter<Item,ItemRest>
@Component public class ItemConverter extends DSpaceObjectConverter<Item,ItemRest> implements IndexableObjectConverter<Item,ItemRest>
This is the converter from/to the Item in the DSpace API data model and the REST data model- Author:
- Andrea Bollini (andrea.bollini at 4science.it)
-
-
Constructor Summary
Constructors Constructor Description ItemConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemRestconvert(Item obj, Projection projection)Convert a DSpace model object into its equivalent REST resource, applying a given projection.Class<Item>getModelClass()For what DSpace API model class does this converter convert?MetadataValueListgetPermissionFilteredMetadata(Context context, Item 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 Overrides the parent method to include virtual metadataprotected ItemRestnewInstance()booleansupportsModel(IndexableObject idxo)
-
-
-
Method Detail
-
convert
public ItemRest convert(Item 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<Item,ItemRest>- Overrides:
convertin classDSpaceObjectConverter<Item,ItemRest>- Parameters:
obj- a DSpace API model object.- Returns:
- a resource representing the model object.
-
getPermissionFilteredMetadata
public MetadataValueList getPermissionFilteredMetadata(Context context, Item 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 Overrides the parent method to include virtual metadata- Overrides:
getPermissionFilteredMetadatain classDSpaceObjectConverter<Item,ItemRest>- Parameters:
context- The contextobj- The object of which the filtered metadata will be retrieved- Returns:
- A list of object metadata (including virtual metadata) filtered based on the the hidden metadata configuration
-
newInstance
protected ItemRest newInstance()
- Specified by:
newInstancein classDSpaceObjectConverter<Item,ItemRest>
-
getModelClass
public Class<Item> getModelClass()
Description copied from interface:DSpaceConverterFor what DSpace API model class does this converter convert?- Specified by:
getModelClassin interfaceDSpaceConverter<Item,ItemRest>- Returns:
- Class of model objects represented.
-
supportsModel
public boolean supportsModel(IndexableObject idxo)
- Specified by:
supportsModelin interfaceIndexableObjectConverter<Item,ItemRest>- Parameters:
idxo- the IndexableObject to check- Returns:
- true if the actual converter implementation is able to manage the supplied IndexableObject
-
-