public final class TypeRegistry extends Object
TypeRegistry class.
| Modifier and Type | Class and Description |
|---|---|
static class |
TypeRegistry.ClassMapper |
| Constructor and Description |
|---|
TypeRegistry() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsDeserializer(String typeName)
containsDeserializer.
|
static boolean |
containsDeserializer(TypeMirror typeMirror)
containsDeserializer.
|
static boolean |
containsSerializer(String typeName)
containsSerializer.
|
static boolean |
containsSerializer(TypeMirror typeMirror)
containsSerializer.
|
static TypeRegistry.ClassMapper |
get(String typeName)
get.
|
static Class<?> |
getCollectionDeserializer(TypeMirror typeMirror)
getCollectionDeserializer.
|
static com.squareup.javapoet.TypeName |
getCustomDeserializer(String type)
getCustomDeserializer.
|
static com.squareup.javapoet.TypeName |
getCustomDeserializer(TypeMirror typeMirror)
getCustomDeserializer.
|
static com.squareup.javapoet.TypeName |
getCustomSerializer(String type)
getCustomSerializer.
|
static com.squareup.javapoet.TypeName |
getCustomSerializer(TypeMirror typeMirror)
getCustomSerializer.
|
static com.squareup.javapoet.TypeName |
getDeserializer(TypeMirror typeMirror)
getDeserializer.
|
static com.squareup.javapoet.TypeName |
getKeyDeserializer(String typeName)
getKeyDeserializer.
|
static com.squareup.javapoet.TypeName |
getKeySerializer(String typeName)
getKeySerializer.
|
static Class<?> |
getMapDeserializer(TypeMirror typeMirror)
getMapDeserializer.
|
static com.squareup.javapoet.TypeName |
getSerializer(TypeMirror typeMirror)
getSerializer.
|
static boolean |
isBasicType(String type)
isBasicType.
|
static void |
register(TypeRegistry.ClassMapper mapper)
register.
|
static void |
registerDeserializer(String type,
com.squareup.javapoet.TypeName deserializer)
registerDeserializer.
|
static void |
registerSerializer(String type,
com.squareup.javapoet.TypeName serializer)
registerSerializer.
|
static void |
resetTypeRegistry()
resetTypeRegistry
|
public static void resetTypeRegistry()
resetTypeRegistry
Helper method to clean (reset) state of TypeRegistry. This action should be performed on every APT run, since in some environments (such as Eclipse), the processor is instantiated once and used multiple times. Without some cleanup we may end up with some serializer/deserializers not generated due to TypeRegistry internal state saying that they already exists.public static void register(TypeRegistry.ClassMapper mapper)
register.
mapper - a TypeRegistry.ClassMapper object.public static boolean isBasicType(String type)
isBasicType.
type - a String object.public static void registerSerializer(String type, com.squareup.javapoet.TypeName serializer)
registerSerializer.
type - a String object.serializer - a TypeName object.public static void registerDeserializer(String type, com.squareup.javapoet.TypeName deserializer)
registerDeserializer.
type - a String object.deserializer - a TypeName object.public static com.squareup.javapoet.TypeName getCustomSerializer(TypeMirror typeMirror)
getCustomSerializer.
typeMirror - a TypeMirror object.TypeName object.public static com.squareup.javapoet.TypeName getCustomSerializer(String type)
getCustomSerializer.
type - a String object.TypeName object.public static com.squareup.javapoet.TypeName getCustomDeserializer(TypeMirror typeMirror)
getCustomDeserializer.
typeMirror - a TypeMirror object.TypeName object.public static com.squareup.javapoet.TypeName getCustomDeserializer(String type)
getCustomDeserializer.
type - a String object.TypeName object.public static TypeRegistry.ClassMapper get(String typeName)
get.
typeName - a String object.TypeRegistry.ClassMapper object.public static com.squareup.javapoet.TypeName getSerializer(TypeMirror typeMirror)
getSerializer.
typeMirror - a TypeMirror object.TypeName object.public static com.squareup.javapoet.TypeName getKeySerializer(String typeName)
getKeySerializer.
typeName - a String object.TypeName object.public static com.squareup.javapoet.TypeName getKeyDeserializer(String typeName)
getKeyDeserializer.
typeName - a String object.TypeName object.public static com.squareup.javapoet.TypeName getDeserializer(TypeMirror typeMirror)
getDeserializer.
typeMirror - a TypeMirror object.TypeName object.public static Class<?> getCollectionDeserializer(TypeMirror typeMirror)
getCollectionDeserializer.
typeMirror - a TypeMirror object.Class object.public static Class<?> getMapDeserializer(TypeMirror typeMirror)
getMapDeserializer.
typeMirror - a TypeMirror object.Class object.public static boolean containsDeserializer(String typeName)
containsDeserializer.
typeName - a String object.public static boolean containsSerializer(String typeName)
containsSerializer.
typeName - a String object.public static boolean containsSerializer(TypeMirror typeMirror)
containsSerializer.
typeMirror - a TypeMirror object.public static boolean containsDeserializer(TypeMirror typeMirror)
containsDeserializer.
typeMirror - a TypeMirror object.Copyright © 2020. All rights reserved.