public abstract class AbstractCreator
extends com.google.gwt.user.rebind.AbstractSourceCreator
Abstract AbstractCreator class.
| Modifier and Type | Field and Description |
|---|---|
protected RebindConfiguration |
configuration |
protected com.google.gwt.core.ext.GeneratorContext |
context |
protected com.google.gwt.core.ext.TreeLogger |
logger |
protected static String |
TYPE_PARAMETER_DESERIALIZER_FIELD_NAME
Constant
TYPE_PARAMETER_DESERIALIZER_FIELD_NAME="deserializer%d" |
protected static String |
TYPE_PARAMETER_SERIALIZER_FIELD_NAME
Constant
TYPE_PARAMETER_SERIALIZER_FIELD_NAME="serializer%d" |
protected JacksonTypeOracle |
typeOracle |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCreator(com.google.gwt.core.ext.TreeLogger logger,
com.google.gwt.core.ext.GeneratorContext context,
RebindConfiguration configuration,
JacksonTypeOracle typeOracle)
Constructor for AbstractCreator.
|
| Modifier and Type | Method and Description |
|---|---|
protected JDeserializerType |
getJsonDeserializerFromType(com.google.gwt.core.ext.typeinfo.JType type)
Build a
JDeserializerType that instantiate a JsonSerializer for the given type. |
protected JDeserializerType |
getJsonDeserializerFromType(com.google.gwt.core.ext.typeinfo.JType type,
boolean subtype)
Build a
JDeserializerType that instantiate a JsonSerializer for the given type. |
protected JSerializerType |
getJsonSerializerFromType(com.google.gwt.core.ext.typeinfo.JType type)
Build a
JSerializerType that instantiate a JsonSerializer for the given type. |
protected JSerializerType |
getJsonSerializerFromType(com.google.gwt.core.ext.typeinfo.JType type,
boolean subtype)
Build a
JSerializerType that instantiate a JsonSerializer for the given type. |
protected JDeserializerType |
getKeyDeserializerFromType(com.google.gwt.core.ext.typeinfo.JType type)
Build the
JDeserializerType that instantiate a KeyDeserializer for the given type. |
protected JDeserializerType |
getKeyDeserializerFromType(com.google.gwt.core.ext.typeinfo.JType type,
boolean subtype,
boolean useDefault)
Build the
JDeserializerType that instantiate a KeyDeserializer for the given type. |
protected JSerializerType |
getKeySerializerFromType(com.google.gwt.core.ext.typeinfo.JType type)
Build the
JSerializerType that instantiate a KeySerializer for the given type. |
protected JSerializerType |
getKeySerializerFromType(com.google.gwt.core.ext.typeinfo.JType type,
boolean subtype,
boolean useDefault)
Build the
JSerializerType that instantiate a KeySerializer for the given type. |
protected abstract com.google.gwt.thirdparty.guava.common.base.Optional<BeanJsonMapperInfo> |
getMapperInfo()
getMapperInfo
|
protected BeanJsonMapperInfo |
getMapperInfo(com.google.gwt.core.ext.typeinfo.JClassType beanType)
Returns the mapper information for the given type.
|
protected PrintWriter |
getPrintWriter(String packageName,
String className)
Creates the
PrintWriter to write the class. |
protected void |
write(String packageName,
com.squareup.javapoet.TypeSpec type,
PrintWriter printWriter)
Writes the given type to the
PrintWriter. |
protected static final String TYPE_PARAMETER_DESERIALIZER_FIELD_NAME
TYPE_PARAMETER_DESERIALIZER_FIELD_NAME="deserializer%d"protected static final String TYPE_PARAMETER_SERIALIZER_FIELD_NAME
TYPE_PARAMETER_SERIALIZER_FIELD_NAME="serializer%d"protected final com.google.gwt.core.ext.TreeLogger logger
protected final com.google.gwt.core.ext.GeneratorContext context
protected final RebindConfiguration configuration
protected final JacksonTypeOracle typeOracle
protected AbstractCreator(com.google.gwt.core.ext.TreeLogger logger,
com.google.gwt.core.ext.GeneratorContext context,
RebindConfiguration configuration,
JacksonTypeOracle typeOracle)
Constructor for AbstractCreator.
logger - a TreeLogger object.context - a GeneratorContext object.configuration - a RebindConfiguration object.typeOracle - a JacksonTypeOracle object.protected final PrintWriter getPrintWriter(String packageName, String className)
PrintWriter to write the class.packageName - the packageclassName - the name of the classPrintWriter or null if the class already exists.protected final void write(String packageName, com.squareup.javapoet.TypeSpec type, PrintWriter printWriter) throws com.google.gwt.core.ext.UnableToCompleteException
PrintWriter.packageName - the package for the typetype - the typeprintWriter - the writercom.google.gwt.core.ext.UnableToCompleteException - if an exception is thrown by the writerprotected final BeanJsonMapperInfo getMapperInfo(com.google.gwt.core.ext.typeinfo.JClassType beanType) throws com.google.gwt.core.ext.UnableToCompleteException
beanType - the typecom.google.gwt.core.ext.UnableToCompleteException - if an exception occured while processing the typeprotected abstract com.google.gwt.thirdparty.guava.common.base.Optional<BeanJsonMapperInfo> getMapperInfo()
getMapperInfo
Optional object.protected final JSerializerType getJsonSerializerFromType(com.google.gwt.core.ext.typeinfo.JType type) throws com.google.gwt.core.ext.UnableToCompleteException, UnsupportedTypeException
JSerializerType that instantiate a JsonSerializer for the given type. If the type is a bean,
the implementation of AbstractBeanJsonSerializer will be created.type - typeJSerializerType. Examples:
com.google.gwt.core.ext.UnableToCompleteException - if any.UnsupportedTypeException - if any.protected final JSerializerType getJsonSerializerFromType(com.google.gwt.core.ext.typeinfo.JType type, boolean subtype) throws com.google.gwt.core.ext.UnableToCompleteException, UnsupportedTypeException
JSerializerType that instantiate a JsonSerializer for the given type. If the type is a bean,
the implementation of AbstractBeanJsonSerializer will be created.type - typesubtype - true if the serializer is for a subtypeJSerializerType. Examples:
com.google.gwt.core.ext.UnableToCompleteException - if any.UnsupportedTypeException - if any.protected final JSerializerType getKeySerializerFromType(com.google.gwt.core.ext.typeinfo.JType type) throws UnsupportedTypeException
JSerializerType that instantiate a KeySerializer for the given type.type - typeJSerializerType.UnsupportedTypeException - if any.protected final JSerializerType getKeySerializerFromType(com.google.gwt.core.ext.typeinfo.JType type, boolean subtype, boolean useDefault) throws UnsupportedTypeException
JSerializerType that instantiate a KeySerializer for the given type.type - typesubtype - true if the serializer is for a subtypeuseDefault - true if it should return ObjectKeySerializer if the type is not supportedJSerializerType.UnsupportedTypeException - if any.protected final JDeserializerType getJsonDeserializerFromType(com.google.gwt.core.ext.typeinfo.JType type) throws com.google.gwt.core.ext.UnableToCompleteException, UnsupportedTypeException
JDeserializerType that instantiate a JsonSerializer for the given type. If the type is a bean,
the implementation of AbstractBeanJsonSerializer will be created.type - typeJDeserializerType. Examples:
com.google.gwt.core.ext.UnableToCompleteException - if any.UnsupportedTypeException - if any.protected final JDeserializerType getJsonDeserializerFromType(com.google.gwt.core.ext.typeinfo.JType type, boolean subtype) throws com.google.gwt.core.ext.UnableToCompleteException, UnsupportedTypeException
JDeserializerType that instantiate a JsonSerializer for the given type. If the type is a bean,
the implementation of AbstractBeanJsonSerializer will be created.type - typesubtype - true if the deserializer is for a subtypeJDeserializerType. Examples:
com.google.gwt.core.ext.UnableToCompleteException - if any.UnsupportedTypeException - if any.protected final JDeserializerType getKeyDeserializerFromType(com.google.gwt.core.ext.typeinfo.JType type) throws UnsupportedTypeException
JDeserializerType that instantiate a KeyDeserializer for the given type.type - typeJDeserializerType.UnsupportedTypeException - if any.protected final JDeserializerType getKeyDeserializerFromType(com.google.gwt.core.ext.typeinfo.JType type, boolean subtype, boolean useDefault) throws UnsupportedTypeException
JDeserializerType that instantiate a KeyDeserializer for the given type.type - typesubtype - true if the deserializer is for a subtypeuseDefault - true if it should return a default deserializer in case the type is not supportedJDeserializerType.UnsupportedTypeException - if any.Copyright © 2017. All Rights Reserved.