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>
AbtractConverter
is 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.String
PREFIX_SRN
SIREN properties prefixstatic java.lang.String
REL_CHILD
Relation attribute name "child".static java.lang.String
REL_CONTENT
Relation attribute name "content".static java.lang.String
REL_NEXT
Relation attribute name "next".static java.lang.String
REL_PARENT
Relation attribute name "parent".static java.lang.String
REL_PREV
Relation attribute name "prev".static java.lang.String
REL_SELF
Relation attribute name "self".
-
Constructor Summary
Constructors Constructor Description AbstractSirenConverter(Resource resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Entity
toEntity(ResourceConverterContext context)
Converts aresource
into an object of typeT
to represent an entity.Entity
toSubEntity(ResourceConverterContext context)
Converts aresource
to an object of typeT
to 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 aresource
into an object of typeT
to represent an entity.- Specified by:
toEntity
in 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:ResourceConverter
Converts aresource
to an object of typeT
to 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:
toSubEntity
in interfaceResourceConverter<Entity>
- Parameters:
context
- Converter context- Returns:
- Converted sub-object of type T
- Throws:
ResourceConverterException
- if an error occurs during conversion
-
-