Class Jackson2Metadata

java.lang.Object
org.springframework.data.rest.webmvc.json.Jackson2Metadata
All Implemented Interfaces:
Iterable<BeanPropertyDefinition>

@Deprecated(since="5.0", forRemoval=true) public class Jackson2Metadata extends Object implements Iterable<BeanPropertyDefinition>
Deprecated, for removal: This API element is subject to removal in a future version.
Value object to abstract Jackson based bean metadata of a given type.
Author:
Oliver Gierke, Greg Turnquist
  • Constructor Details

    • Jackson2Metadata

      public Jackson2Metadata(ObjectMapper mapper, Class<?> type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new Jackson2Metadata instance for the given ObjectMapper and type.
      Parameters:
      mapper - must not be null.
      type - must not be null.
  • Method Details

    • getDefinitionFor

      public @Nullable BeanPropertyDefinition getDefinitionFor(PersistentProperty<?> property)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the BeanPropertyDefinition for the given PersistentProperty.
      Parameters:
      property - must not be null.
      Returns:
      can be null in case there's no Jackson property to be exposed for the given PersistentProperty.
    • getFallbackDescription

      public org.springframework.data.rest.core.mapping.ResourceDescription getFallbackDescription(org.springframework.data.rest.core.mapping.ResourceMetadata ownerMetadata, BeanPropertyDefinition definition)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the fallback ResourceDescription to be used for the given BeanPropertyDefinition.
      Parameters:
      ownerMetadata - must not be null.
      definition - must not be null.
      Returns:
    • isExported

      public boolean isExported(PersistentProperty<?> property)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Check if a given property for a type is available to be exported, i.e. serialized via Jackson.
      Parameters:
      property - must not be null.
      Returns:
    • isValueType

      public boolean isValueType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns whether the backing type is considered a Jackson value type.
      Returns:
      the isValue
    • isReadOnly

      public boolean isReadOnly(PersistentProperty<?> property)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns whether the given PersistentProperty is considered read-only by Jackson.
      Parameters:
      property - must not be null.
      Returns:
    • getTypeSerializer

      public @Nullable JsonSerializer<?> getTypeSerializer(Class<?> type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the JsonSerializer for the given type, or null if none available.
      Parameters:
      type - must not be null.
      Returns:
    • iterator

      public Iterator<BeanPropertyDefinition> iterator()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      iterator in interface Iterable<BeanPropertyDefinition>