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 classConfig.Builder
-
Field Summary
Fields Modifier and Type Field Description private Config.Builderbuilderprivate java.lang.StringconfigNameprivate static java.util.Map<java.lang.String,Config>configsprivate java.util.Map<java.lang.reflect.Type,java.lang.String>decoderCacheKeysprivate java.util.Map<java.lang.reflect.Type,java.lang.String>encoderCacheKeysstatic ConfigINSTANCEprivate static java.util.Map<java.lang.Class,OmitValue>primitiveOmitValues
-
Constructor Summary
Constructors Modifier Constructor Description protectedConfig(java.lang.String configName, Config.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Config.Builderbuilder()java.lang.StringconfigName()Config.BuildercopyBuilder()protected OmitValuecreateOmitValue(java.lang.reflect.Type valueType)DecodingModedecodingMode()private voiddetectCtor(ClassDescriptor desc)private voiddetectStaticFactory(ClassDescriptor desc, java.util.List<java.lang.reflect.Method> allMethods)private voiddetectUnwrappers(ClassDescriptor desc, java.util.List<java.lang.reflect.Method> allMethods)private voiddetectWrappers(ClassDescriptor desc, java.util.List<java.lang.reflect.Method> allMethods)EncodingModeencodingMode()booleanescapeUnicode()protected static <T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.annotation.Annotation[] annotations, java.lang.Class<T> annotationClass)java.lang.StringgetDecoderCacheKey(java.lang.reflect.Type type)java.lang.StringgetEncoderCacheKey(java.lang.reflect.Type type)protected JsonCreatorgetJsonCreator(java.lang.annotation.Annotation[] annotations)protected JsonIgnoregetJsonIgnore(java.lang.annotation.Annotation[] annotations)protected JsonPropertygetJsonProperty(java.lang.annotation.Annotation[] annotations)protected JsonUnwrappergetJsonUnwrapper(java.lang.annotation.Annotation[] annotations)protected JsonWrappergetJsonWrapper(java.lang.annotation.Annotation[] annotations)private java.lang.String[]getParamNames(java.lang.Object obj, int paramCount)intindentionStep()booleanomitDefaultValue()private java.lang.ObjectreflectCall(java.lang.Object obj, java.lang.String methodName, java.lang.Object... args)private voidupdateBindings(ClassDescriptor desc)private voidupdateBindingWithJsonProperty(Binding binding, JsonProperty jsonProperty)voidupdateClassDescriptor(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:ExtensionUpdate how binding is done for the class- Specified by:
updateClassDescriptorin interfaceExtension- Overrides:
updateClassDescriptorin 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)
-
-