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
47 lines (41 loc) · 1.29 KB
/
Extension.java
File metadata and controls
47 lines (41 loc) · 1.29 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
41
42
43
44
45
46
47
package com.jsoniter;
import java.lang.reflect.Type;
import java.util.List;
public interface Extension {
/**
* Customize type decoding
*
* @param type change how to decode the type
* @param typeArgs for generic type
* @return null, if no special customization needed
*/
Decoder createDecoder(Type type, Type... typeArgs);
/**
* Customize field of certain kind, for example having certain annotation
*
* @param field the field reflection object
* @return null, if no special customization needed
*/
Decoder createDecoder(Binding field);
/**
* Customize the binding source
*
* @param field the field reflection object
* @return null, if fallback to default behavior. empty array to disable this binding
*/
String[] getBindFrom(Binding field);
/**
* Customize which constructor to call
*
* @param clazz the instance class 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);
}