Package com.jsoniter.spi
Class Config
- java.lang.Object
-
- com.jsoniter.spi.EmptyExtension
-
- com.jsoniter.spi.Config
-
- All Implemented Interfaces:
Extension
- Direct Known Subclasses:
GsonCompatibilityMode
,JacksonCompatibilityMode
public class Config extends EmptyExtension
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Config.Builder
-
Field Summary
Fields Modifier and Type Field Description private Config.Builder
builder
private java.lang.String
configName
private static java.util.Map<java.lang.String,Config>
configs
private java.util.Map<java.lang.reflect.Type,java.lang.String>
decoderCacheKeys
private java.util.Map<java.lang.reflect.Type,java.lang.String>
encoderCacheKeys
static Config
INSTANCE
private static java.util.Map<java.lang.Class,OmitValue>
primitiveOmitValues
-
Constructor Summary
Constructors Modifier Constructor Description protected
Config(java.lang.String configName, Config.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Config.Builder
builder()
java.lang.String
configName()
Config.Builder
copyBuilder()
protected OmitValue
createOmitValue(java.lang.reflect.Type valueType)
DecodingMode
decodingMode()
private void
detectCtor(ClassDescriptor desc)
private void
detectStaticFactory(ClassDescriptor desc, java.util.List<java.lang.reflect.Method> allMethods)
private void
detectUnwrappers(ClassDescriptor desc, java.util.List<java.lang.reflect.Method> allMethods)
private void
detectWrappers(ClassDescriptor desc, java.util.List<java.lang.reflect.Method> allMethods)
EncodingMode
encodingMode()
boolean
escapeUnicode()
protected static <T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.annotation.Annotation[] annotations, java.lang.Class<T> annotationClass)
java.lang.String
getDecoderCacheKey(java.lang.reflect.Type type)
java.lang.String
getEncoderCacheKey(java.lang.reflect.Type type)
protected JsonCreator
getJsonCreator(java.lang.annotation.Annotation[] annotations)
protected JsonIgnore
getJsonIgnore(java.lang.annotation.Annotation[] annotations)
protected JsonProperty
getJsonProperty(java.lang.annotation.Annotation[] annotations)
protected JsonUnwrapper
getJsonUnwrapper(java.lang.annotation.Annotation[] annotations)
protected JsonWrapper
getJsonWrapper(java.lang.annotation.Annotation[] annotations)
private java.lang.String[]
getParamNames(java.lang.Object obj, int paramCount)
int
indentionStep()
boolean
omitDefaultValue()
private java.lang.Object
reflectCall(java.lang.Object obj, java.lang.String methodName, java.lang.Object... args)
private void
updateBindings(ClassDescriptor desc)
private void
updateBindingWithJsonProperty(Binding binding, JsonProperty jsonProperty)
void
updateClassDescriptor(ClassDescriptor desc)
Update how binding is done for the class-
Methods inherited from class com.jsoniter.spi.EmptyExtension
canCreate, chooseImplementation, create, createDecoder, createEncoder
-
-
-
-
Field Detail
-
configName
private final java.lang.String configName
-
builder
private final Config.Builder builder
-
configs
private static volatile java.util.Map<java.lang.String,Config> configs
-
decoderCacheKeys
private volatile java.util.Map<java.lang.reflect.Type,java.lang.String> decoderCacheKeys
-
encoderCacheKeys
private volatile java.util.Map<java.lang.reflect.Type,java.lang.String> encoderCacheKeys
-
primitiveOmitValues
private static final java.util.Map<java.lang.Class,OmitValue> primitiveOmitValues
-
INSTANCE
public static final Config INSTANCE
-
-
Constructor Detail
-
Config
protected Config(java.lang.String configName, Config.Builder builder)
-
-
Method Detail
-
configName
public java.lang.String configName()
-
getDecoderCacheKey
public java.lang.String getDecoderCacheKey(java.lang.reflect.Type type)
-
getEncoderCacheKey
public java.lang.String getEncoderCacheKey(java.lang.reflect.Type type)
-
decodingMode
public DecodingMode decodingMode()
-
builder
protected Config.Builder builder()
-
copyBuilder
public Config.Builder copyBuilder()
-
indentionStep
public int indentionStep()
-
omitDefaultValue
public boolean omitDefaultValue()
-
escapeUnicode
public boolean escapeUnicode()
-
encodingMode
public EncodingMode encodingMode()
-
updateClassDescriptor
public void updateClassDescriptor(ClassDescriptor desc)
Description copied from interface:Extension
Update how binding is done for the class- Specified by:
updateClassDescriptor
in interfaceExtension
- Overrides:
updateClassDescriptor
in classEmptyExtension
- Parameters:
desc
- binding information
-
detectUnwrappers
private void detectUnwrappers(ClassDescriptor desc, java.util.List<java.lang.reflect.Method> allMethods)
-
detectWrappers
private void detectWrappers(ClassDescriptor desc, java.util.List<java.lang.reflect.Method> allMethods)
-
getParamNames
private java.lang.String[] getParamNames(java.lang.Object obj, int paramCount)
-
reflectCall
private java.lang.Object reflectCall(java.lang.Object obj, java.lang.String methodName, java.lang.Object... args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
detectStaticFactory
private void detectStaticFactory(ClassDescriptor desc, java.util.List<java.lang.reflect.Method> allMethods)
-
detectCtor
private void detectCtor(ClassDescriptor desc)
-
updateBindings
private void updateBindings(ClassDescriptor desc)
-
updateBindingWithJsonProperty
private void updateBindingWithJsonProperty(Binding binding, JsonProperty jsonProperty)
-
createOmitValue
protected OmitValue createOmitValue(java.lang.reflect.Type valueType)
-
getJsonWrapper
protected JsonWrapper getJsonWrapper(java.lang.annotation.Annotation[] annotations)
-
getJsonUnwrapper
protected JsonUnwrapper getJsonUnwrapper(java.lang.annotation.Annotation[] annotations)
-
getJsonCreator
protected JsonCreator getJsonCreator(java.lang.annotation.Annotation[] annotations)
-
getJsonProperty
protected JsonProperty getJsonProperty(java.lang.annotation.Annotation[] annotations)
-
getJsonIgnore
protected JsonIgnore getJsonIgnore(java.lang.annotation.Annotation[] annotations)
-
getAnnotation
protected static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.annotation.Annotation[] annotations, java.lang.Class<T> annotationClass)
-
-