Class DefaultAnnotationStrategy
java.lang.Object
com.sap.cloud.sdk.datamodel.odatav4.generator.annotation.DefaultAnnotationStrategy
- All Implemented Interfaces:
AnnotationStrategy
Default implementation of
AnnotationStrategy
that applies the necessary annotations for the full set of
generated VDM classes (POJOs, fluent helpers, service classes, etc.), which uses the SAP Cloud SDK to access OData
services.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDefault implementation for the SAP Cloud SDK which adds the following annotations: GsonSerializedName
with the value set to the OData EDM name of the navigation property. JacksonJsonProperty
with the value set to the OData EDM name of the navigation property.Nullable
, but only if the multiplicity of the navigation property is 1..1 or 0..1Default implementation for the SAP Cloud SDK which adds the following annotations: LombokBuilder
,NoArgsConstructor
, andAllArgsConstructor
.Default implementation for the SAP Cloud SDK which adds the following annotations: GsonSerializedName
with the value set to the OData EDM name of the complex type property. JacksonJsonProperty
with the value set to the OData EDM name of the complex type property.Nullable
GsonJsonAdapter
with default parameter set to an appropriateTypeAdapter
class.Default implementation for the SAP Cloud SDK which adds the following annotations: LombokBuilder
,NoArgsConstructor
, andAllArgsConstructor
.Default implementation for the SAP Cloud SDK which adds the following annotations: GsonSerializedName
with the value set to the OData EDM name of the entity property. JacksonJsonProperty
with the value set to the OData EDM name of the entity property.Nullable
GsonJsonAdapter
with default parameter set to an appropriateTypeAdapter
class.
-
Constructor Details
-
DefaultAnnotationStrategy
public DefaultAnnotationStrategy()
-
-
Method Details
-
getAnnotationsForEntity
@Nonnull public Set<AnnotationDefinition> getAnnotationsForEntity(@Nonnull EntityAnnotationModel context) Default implementation for the SAP Cloud SDK which adds the following annotations:- Lombok
Builder
,NoArgsConstructor
, andAllArgsConstructor
. But only if there are less than 254 properties in the entity (Java constructor limitation). - Lombok
Data
- Lombok
ToString
with parametersdoNotUseGetters=true
andcallSuper=true
- Lombok
EqualsAndHashCode
with parametersdoNotUseGetters=true
andcallSuper=true
- Gson
JsonAdapter
with default parameter set toODataVdmEntityAdapterFactory.class
, for deserializing OData responses.
- Specified by:
getAnnotationsForEntity
in interfaceAnnotationStrategy
- Parameters:
context
- Object representing an OData entity.- Returns:
- Default set of annotations that are needed by the SAP Cloud SDK implementation of the VDM.
- Lombok
-
getAnnotationsForEntityProperty
@Nonnull public Set<AnnotationDefinition> getAnnotationsForEntityProperty(@Nonnull EntityPropertyAnnotationModel context) Default implementation for the SAP Cloud SDK which adds the following annotations:- Gson
SerializedName
with the value set to the OData EDM name of the entity property. - Jackson
JsonProperty
with the value set to the OData EDM name of the entity property. Nullable
- Gson
JsonAdapter
with default parameter set to an appropriateTypeAdapter
class. The adapter used is based on the OData EDM type of the entity property.
- Specified by:
getAnnotationsForEntityProperty
in interfaceAnnotationStrategy
- Parameters:
context
- Object representing an OData entity property.- Returns:
- Default set of annotations that are needed by the SAP Cloud SDK implementation of the VDM.
- Gson
-
getAnnotationsForComplexType
@Nonnull public Set<AnnotationDefinition> getAnnotationsForComplexType(@Nonnull EntityAnnotationModel context) Default implementation for the SAP Cloud SDK which adds the following annotations:- Lombok
Builder
,NoArgsConstructor
, andAllArgsConstructor
. But only if there are less than 254 properties in the entity (Java constructor limitation). - Lombok
Data
- Lombok
ToString
with parametersdoNotUseGetters=true
andcallSuper=true
- Lombok
EqualsAndHashCode
with parametersdoNotUseGetters=true
andcallSuper=true
- Gson
JsonAdapter
with default parameter set toODataVdmEntityAdapterFactory.class
, for deserializing OData responses.
- Specified by:
getAnnotationsForComplexType
in interfaceAnnotationStrategy
- Parameters:
context
- Object representing an OData complex type.- Returns:
- Default set of annotations that are needed by the SAP Cloud SDK implementation of the VDM.
- Lombok
-
getAnnotationsForComplexTypeProperty
@Nonnull public Set<AnnotationDefinition> getAnnotationsForComplexTypeProperty(@Nonnull EntityPropertyAnnotationModel context) Default implementation for the SAP Cloud SDK which adds the following annotations:- Gson
SerializedName
with the value set to the OData EDM name of the complex type property. - Jackson
JsonProperty
with the value set to the OData EDM name of the complex type property. Nullable
- Gson
JsonAdapter
with default parameter set to an appropriateTypeAdapter
class. The adapter used is based on the OData EDM type of the complex type property.
- Specified by:
getAnnotationsForComplexTypeProperty
in interfaceAnnotationStrategy
- Parameters:
context
- Object representing an OData complex type property.- Returns:
- Default set of annotations that are needed by the SAP Cloud SDK implementation of the VDM.
- Gson
-