Class AbstractSirenConverter
java.lang.Object
com.adobe.granite.rest.converter.siren.AbstractSirenConverter
- All Implemented Interfaces:
ResourceConverter<Entity>
- Direct Known Subclasses:
AbstractPageableSirenConverter
AbtractConverter is a base implementation of ResourceConverter. ResourceConverter implementations
are encouraged to extend from this abstract base class.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSIREN properties prefixstatic final StringRelation attribute name "child".static final StringRelation attribute name "content".static final StringRelation attribute name "next".static final StringRelation attribute name "parent".static final StringRelation attribute name "prev".static final StringRelation attribute name "self". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoEntity(ResourceConverterContext context) Converts aresourceinto an object of typeTto represent an entity.toSubEntity(ResourceConverterContext context) Converts aresourceto an object of typeTto represent a sub-entity.
-
Field Details
-
PREFIX_SRN
SIREN properties prefix- See Also:
-
REL_SELF
Relation attribute name "self".- See Also:
-
REL_CHILD
Relation attribute name "child".- See Also:
-
REL_CONTENT
Relation attribute name "content".- See Also:
-
REL_NEXT
Relation attribute name "next".- See Also:
-
REL_PREV
Relation attribute name "prev".- See Also:
-
REL_PARENT
Relation attribute name "parent".- See Also:
-
-
Constructor Details
-
AbstractSirenConverter
-
-
Method Details
-
toEntity
Converts aresourceinto an object of typeTto represent an entity.- Specified by:
toEntityin interfaceResourceConverter<Entity>- Parameters:
context- Converter context- Returns:
- Converted object of type T
- Throws:
ResourceConverterException- if an error occurs during conversion
-
toSubEntity
Description copied from interface:ResourceConverterConverts aresourceto an object of typeTto represent a sub-entity. The sub-entity might only contain a subset of information and might be used to represent child elements of a collection.- Specified by:
toSubEntityin interfaceResourceConverter<Entity>- Parameters:
context- Converter context- Returns:
- Converted sub-object of type T
- Throws:
ResourceConverterException- if an error occurs during conversion
-