Class AbstractSirenConverter
- java.lang.Object
-
- com.adobe.granite.rest.converter.siren.AbstractSirenConverter
-
- All Implemented Interfaces:
ResourceConverter<Entity>
- Direct Known Subclasses:
AbstractPageableSirenConverter
public abstract class AbstractSirenConverter extends java.lang.Object implements ResourceConverter<Entity>
AbtractConverteris a base implementation ofResourceConverter. ResourceConverter implementations are encouraged to extend from this abstract base class.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPREFIX_SRNSIREN properties prefixstatic java.lang.StringREL_CHILDRelation attribute name "child".static java.lang.StringREL_CONTENTRelation attribute name "content".static java.lang.StringREL_NEXTRelation attribute name "next".static java.lang.StringREL_PARENTRelation attribute name "parent".static java.lang.StringREL_PREVRelation attribute name "prev".static java.lang.StringREL_SELFRelation attribute name "self".
-
Constructor Summary
Constructors Constructor Description AbstractSirenConverter(Resource resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntitytoEntity(ResourceConverterContext context)Converts aresourceinto an object of typeTto represent an entity.EntitytoSubEntity(ResourceConverterContext context)Converts aresourceto an object of typeTto represent a sub-entity.
-
-
-
Field Detail
-
PREFIX_SRN
public static final java.lang.String PREFIX_SRN
SIREN properties prefix- See Also:
- Constant Field Values
-
REL_SELF
public static final java.lang.String REL_SELF
Relation attribute name "self".- See Also:
- Constant Field Values
-
REL_CHILD
public static final java.lang.String REL_CHILD
Relation attribute name "child".- See Also:
- Constant Field Values
-
REL_CONTENT
public static final java.lang.String REL_CONTENT
Relation attribute name "content".- See Also:
- Constant Field Values
-
REL_NEXT
public static final java.lang.String REL_NEXT
Relation attribute name "next".- See Also:
- Constant Field Values
-
REL_PREV
public static final java.lang.String REL_PREV
Relation attribute name "prev".- See Also:
- Constant Field Values
-
REL_PARENT
public static final java.lang.String REL_PARENT
Relation attribute name "parent".- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractSirenConverter
public AbstractSirenConverter(Resource resource)
-
-
Method Detail
-
toEntity
public Entity toEntity(ResourceConverterContext context) throws ResourceConverterException
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
public Entity toSubEntity(ResourceConverterContext context) throws ResourceConverterException
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
-
-