forked from json-iterator/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtension.java
More file actions
40 lines (35 loc) · 1.03 KB
/
Extension.java
File metadata and controls
40 lines (35 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.jsoniter;
import java.lang.reflect.Type;
import java.util.List;
public interface Extension {
/**
* Customize type decoding
*
*
* @param cacheKey
* @param type change how to decode the type
* @return null, if no special customization needed
*/
Decoder createDecoder(String cacheKey, Type type);
/**
* Customize the binding source or decoder
*
* @param field binding information
* @return true, if stops other extension from customizing same field
*/
boolean updateBinding(Binding field);
/**
* Customize which constructor to call
*
* @param clazz the class of instance to create
* @return null, if fallback to default behavior
*/
CustomizedConstructor getConstructor(Class clazz);
/**
* Customize setters to call after instance is created and fields set
*
* @param clazz the class that is binding
* @return null, if fallback to default behavior
*/
List<CustomizedSetter> getSetters(Class clazz);
}