com.fasterxml.jackson.dataformat.avro

## Class AvroTypeIdResolver

- java.lang.Object
- - com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
  - - com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver
    - - com.fasterxml.jackson.dataformat.avro.AvroTypeIdResolver

- All Implemented Interfaces:
    com.fasterxml.jackson.databind.jsontype.TypeIdResolver

      public class AvroTypeIdResolver
      extends com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver

  `TypeIdResolver` for Avro type IDs embedded in schemas. Avro generally uses class names, but we want to also support named subtypes so that developers can easily remap the embedded type IDs to a different runtime class.
  Since:
    2.9

- - ### Field Summary

    - ### Fields inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase

      `_baseType, _typeFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AvroTypeIdResolver(com.fasterxml.jackson.databind.JavaType baseType, com.fasterxml.jackson.databind.type.TypeFactory typeFactory)`
    `AvroTypeIdResolver(com.fasterxml.jackson.databind.JavaType baseType, com.fasterxml.jackson.databind.type.TypeFactory typeFactory, Collection<com.fasterxml.jackson.databind.jsontype.NamedType> subTypes)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected com.fasterxml.jackson.databind.JavaType` | `_typeFromId(String id, com.fasterxml.jackson.databind.DatabindContext ctxt)`
    `void` | `registerSubtype(Class<?> type, String name)`

    - ### Methods inherited from class com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver

      `_idFrom, getDescForKnownTypeIds, getMechanism, idFromValue, idFromValueAndType, typeFromId`

    - ### Methods inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase

      `idFromBaseType, init`

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

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

- - ### Constructor Detail

    - #### AvroTypeIdResolver

          public AvroTypeIdResolver(com.fasterxml.jackson.databind.JavaType baseType,
                            com.fasterxml.jackson.databind.type.TypeFactory typeFactory,
                            Collection<com.fasterxml.jackson.databind.jsontype.NamedType> subTypes)

    - #### AvroTypeIdResolver

          public AvroTypeIdResolver(com.fasterxml.jackson.databind.JavaType baseType,
                            com.fasterxml.jackson.databind.type.TypeFactory typeFactory)

  - ### Method Detail

    - #### registerSubtype

          public void registerSubtype(Class<?> type,
                             String name)

      Overrides:
        `registerSubtype` in class `com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver`

    - #### _typeFromId

          protected com.fasterxml.jackson.databind.JavaType _typeFromId(String id,
                                                            com.fasterxml.jackson.databind.DatabindContext ctxt)
                                                                 throws IOException

      Overrides:
        `_typeFromId` in class `com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver`
      Throws:
        `IOException`

Copyright © 2017 FasterXML. All rights reserved.