org.apache.tinkerpop.gremlin.structure.io.graphson

## Class AbstractGraphSONTypeSerializer

- java.lang.Object
- - org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer
  - - org.apache.tinkerpop.gremlin.structure.io.graphson.AbstractGraphSONTypeSerializer

- Direct Known Subclasses:
    GraphSONTypeSerializerV2d0, GraphSONTypeSerializerV3d0

      public abstract class AbstractGraphSONTypeSerializer
      extends org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer

  Extension of the Jackson's default TypeSerializer. An instance of this object will be passed to the serializers on which they can safely call the utility methods to serialize types and making it compatible with the version 2.0+ of GraphSON.
  Author:
    Kevin Gallardo (https://kgdo.me), Stephen Mallette (http://stephen.genoprime.com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<Class,Class>` | `classMap`
    `protected org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeIdResolver` | `idRes`
    `protected String` | `propertyName`
    `protected TypeInfo` | `typeInfo`
    `protected String` | `valuePropertyName`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `canWriteTypeId()`
    `org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer` | `forProperty(org.apache.tinkerpop.shaded.jackson.databind.BeanProperty beanProperty)`
    `protected abstract Class` | `getClassFromObject(Object o)` We force only **one** translation of a Java object to a domain specific object.
    `String` | `getPropertyName()`
    `org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeIdResolver` | `getTypeIdResolver()`
    `org.apache.tinkerpop.shaded.jackson.annotation.JsonTypeInfo.As` | `getTypeInclusion()`
    `protected void` | `writeTypePrefix(org.apache.tinkerpop.shaded.jackson.core.JsonGenerator jsonGenerator, String s)`
    `protected void` | `writeTypeSuffix(org.apache.tinkerpop.shaded.jackson.core.JsonGenerator jsonGenerator)`

    - ### Methods inherited from class org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer

      `_writeLegacySuffix, typeId, typeId, typeId, writeCustomTypePrefixForArray, writeCustomTypePrefixForObject, writeCustomTypePrefixForScalar, writeCustomTypeSuffixForArray, writeCustomTypeSuffixForObject, writeCustomTypeSuffixForScalar, writeTypePrefix, writeTypePrefixForArray, writeTypePrefixForArray, writeTypePrefixForObject, writeTypePrefixForObject, writeTypePrefixForScalar, writeTypePrefixForScalar, writeTypeSuffix, writeTypeSuffixForArray, writeTypeSuffixForObject, writeTypeSuffixForScalar`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### idRes

          protected final org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeIdResolver idRes

    - #### propertyName

          protected final String propertyName

    - #### typeInfo

          protected final TypeInfo typeInfo

    - #### valuePropertyName

          protected final String valuePropertyName

    - #### classMap

          protected final Map<Class,Class> classMap

  - ### Method Detail

    - #### forProperty

          public org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer forProperty(org.apache.tinkerpop.shaded.jackson.databind.BeanProperty beanProperty)

      Specified by:
        `forProperty` in class `org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer`

    - #### getTypeInclusion

          public org.apache.tinkerpop.shaded.jackson.annotation.JsonTypeInfo.As getTypeInclusion()

      Specified by:
        `getTypeInclusion` in class `org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer`

    - #### getPropertyName

          public String getPropertyName()

      Specified by:
        `getPropertyName` in class `org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer`

    - #### getTypeIdResolver

          public org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeIdResolver getTypeIdResolver()

      Specified by:
        `getTypeIdResolver` in class `org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer`

    - #### canWriteTypeId

          protected boolean canWriteTypeId()

    - #### writeTypePrefix

          protected void writeTypePrefix(org.apache.tinkerpop.shaded.jackson.core.JsonGenerator jsonGenerator,
                                         String s)
                                  throws IOException

      Throws:
        `IOException`

    - #### writeTypeSuffix

          protected void writeTypeSuffix(org.apache.tinkerpop.shaded.jackson.core.JsonGenerator jsonGenerator)
                                  throws IOException

      Throws:
        `IOException`

    - #### getClassFromObject

          protected abstract Class getClassFromObject(Object o)

      We force only **one** translation of a Java object to a domain specific object. i.e. users register typeIDs and serializers/deserializers for the predefined types we have in the spec. Graph, Vertex, Edge, VertexProperty, etc... And **not** their implementations (TinkerGraph, DetachedVertex, TinkerEdge, etc..)

Copyright © 2013–2022 Apache Software Foundation. All rights reserved.