public class DefaultAnnotationStrategy extends Object implements AnnotationStrategy
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 and Description |
---|
DefaultAnnotationStrategy() |
Modifier and Type | Method and Description |
---|---|
Set<AnnotationDefinition> |
getAnnotationsForAssociatedEntity(NavigationPropertyAnnotationModel 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 navigation property.
Jackson JsonProperty 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..1
|
Set<AnnotationDefinition> |
getAnnotationsForComplexType(EntityAnnotationModel context)
Default implementation for the SAP Cloud SDK which adds the following annotations:
Lombok
Builder , NoArgsConstructor , and AllArgsConstructor . |
Set<AnnotationDefinition> |
getAnnotationsForComplexTypeProperty(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 appropriate TypeAdapter
class. |
Set<AnnotationDefinition> |
getAnnotationsForEntity(EntityAnnotationModel context)
Default implementation for the SAP Cloud SDK which adds the following annotations:
Lombok
Builder , NoArgsConstructor , and AllArgsConstructor . |
Set<AnnotationDefinition> |
getAnnotationsForEntityProperty(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 appropriate TypeAdapter
class. |
@Nonnull public Set<AnnotationDefinition> getAnnotationsForEntity(@Nonnull EntityAnnotationModel context)
Builder
, NoArgsConstructor
, and AllArgsConstructor
. But only if there are less
than 254 properties in the entity (Java constructor limitation).Data
ToString
with parameters doNotUseGetters=true
and callSuper=true
EqualsAndHashCode
with parameters doNotUseGetters=true
and callSuper=true
JsonAdapter
with default parameter set to ODataVdmEntityAdapterFactory.class
, for
deserializing OData responses.getAnnotationsForEntity
in interface AnnotationStrategy
context
- Object representing an OData entity.@Nonnull public Set<AnnotationDefinition> getAnnotationsForEntityProperty(@Nonnull EntityPropertyAnnotationModel context)
SerializedName
with the value set to the OData EDM name of the entity property.JsonProperty
with the value set to the OData EDM name of the entity property.Nullable
JsonAdapter
with default parameter set to an appropriate TypeAdapter
class. The adapter used is based on the OData EDM type of the entity property.getAnnotationsForEntityProperty
in interface AnnotationStrategy
context
- Object representing an OData entity property.@Nonnull public Set<AnnotationDefinition> getAnnotationsForAssociatedEntity(@Nonnull NavigationPropertyAnnotationModel context)
SerializedName
with the value set to the OData EDM name of the navigation property.JsonProperty
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..1getAnnotationsForAssociatedEntity
in interface AnnotationStrategy
context
- Object representing an OData navigation property.@Nonnull public Set<AnnotationDefinition> getAnnotationsForComplexType(@Nonnull EntityAnnotationModel context)
Builder
, NoArgsConstructor
, and AllArgsConstructor
. But only if there are less
than 254 properties in the entity (Java constructor limitation).Data
ToString
with parameters doNotUseGetters=true
and callSuper=true
EqualsAndHashCode
with parameters doNotUseGetters=true
and callSuper=true
JsonAdapter
with default parameter set to ODataVdmEntityAdapterFactory.class
, for
deserializing OData responses.getAnnotationsForComplexType
in interface AnnotationStrategy
context
- Object representing an OData complex type.@Nonnull public Set<AnnotationDefinition> getAnnotationsForComplexTypeProperty(@Nonnull EntityPropertyAnnotationModel context)
SerializedName
with the value set to the OData EDM name of the complex type property.JsonProperty
with the value set to the OData EDM name of the complex type property.Nullable
JsonAdapter
with default parameter set to an appropriate TypeAdapter
class. The adapter used is based on the OData EDM type of the complex type property.getAnnotationsForComplexTypeProperty
in interface AnnotationStrategy
context
- Object representing an OData complex type property.Copyright © 2019 SAP SE. All rights reserved.