Package com.jsoniter.spi
Interface Extension
- All Known Implementing Classes:
Config
,EmptyExtension
,GsonCompatibilityMode
,JacksonCompatibilityMode
public interface Extension
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Can this extension create object instance for given interface typechooseImplementation
(Type type) Choose the implementation class for interface typesCreate object instance for given interface typecreateDecoder
(String cacheKey, Type type) Customize type decodingcreateEncoder
(String cacheKey, Type type) Customize type encodingvoid
Update how binding is done for the class
-
Method Details
-
chooseImplementation
Choose the implementation class for interface types- Parameters:
type
- the type to decode to, could be class or parameterized type- Returns:
- the implementation type to use
-
canCreate
Can this extension create object instance for given interface type- Parameters:
clazz
- the interface- Returns:
- true if can create, false if can not
-
create
Create object instance for given interface type- Parameters:
clazz
- the interface- Returns:
- the object instance, throw exception if can not create
-
createDecoder
Customize type decoding- Parameters:
cacheKey
- name of the decodertype
- change how to decode the type- Returns:
- null, if no special customization needed
-
createEncoder
Customize type encoding- Parameters:
cacheKey
- name of the encodertype
- change how to encode the type- Returns:
- null, if not special customization needed
-
updateClassDescriptor
Update how binding is done for the class- Parameters:
desc
- binding information
-