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

## Class AbstractGraphSONTypeSerializer

- java.lang.Object
- - TypeSerializer
  - - org.apache.tinkerpop.gremlin.structure.io.graphson.AbstractGraphSONTypeSerializer

- Direct Known Subclasses:
    GraphSONTypeSerializerV2d0, GraphSONTypeSerializerV3d0

      public abstract class AbstractGraphSONTypeSerializer
      extends 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 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()`
    `TypeSerializer` | `forProperty(BeanProperty beanProperty)`
    `protected abstract Class` | `getClassFromObject(Object o)` We force only **one** translation of a Java object to a domain specific object.
    `String` | `getPropertyName()`
    `TypeIdResolver` | `getTypeIdResolver()`
    `JsonTypeInfo.As` | `getTypeInclusion()`
    `protected void` | `writeTypePrefix(JsonGenerator jsonGenerator, String s)`
    `protected void` | `writeTypeSuffix(JsonGenerator jsonGenerator)`

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

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

- - ### Field Detail

    - #### idRes

          protected final 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 TypeSerializer forProperty(BeanProperty beanProperty)

    - #### getTypeInclusion

          public JsonTypeInfo.As getTypeInclusion()

    - #### getPropertyName

          public String getPropertyName()

    - #### getTypeIdResolver

          public TypeIdResolver getTypeIdResolver()

    - #### canWriteTypeId

          protected boolean canWriteTypeId()

    - #### writeTypePrefix

          protected void writeTypePrefix(JsonGenerator jsonGenerator,
                                         String s)
                                  throws IOException

      Throws:
        `IOException`

    - #### writeTypeSuffix

          protected void writeTypeSuffix(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–2020 Apache Software Foundation. All rights reserved.