1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.reflection.wrapper;
17
18 import java.lang.reflect.Type;
19 import java.util.List;
20 import java.util.Map.Entry;
21
22 import org.apache.ibatis.reflection.MetaObject;
23 import org.apache.ibatis.reflection.factory.ObjectFactory;
24 import org.apache.ibatis.reflection.property.PropertyTokenizer;
25
26
27
28
29 public interface ObjectWrapper {
30
31 Object get(PropertyTokenizer prop);
32
33 void set(PropertyTokenizer prop, Object value);
34
35 String findProperty(String name, boolean useCamelCaseMapping);
36
37 String[] getGetterNames();
38
39 String[] getSetterNames();
40
41 Class<?> getSetterType(String name);
42
43 Class<?> getGetterType(String name);
44
45 default Entry<Type, Class<?>> getGenericSetterType(String name) {
46 throw new UnsupportedOperationException(
47 "'" + this.getClass() + "' must override the default method 'getGenericSetterType()'.");
48 }
49
50 default Entry<Type, Class<?>> getGenericGetterType(String name) {
51 throw new UnsupportedOperationException(
52 "'" + this.getClass() + "' must override the default method 'getGenericGetterType()'.");
53 }
54
55 boolean hasSetter(String name);
56
57 boolean hasGetter(String name);
58
59 MetaObject instantiatePropertyValue(String name, PropertyTokenizer prop, ObjectFactory objectFactory);
60
61 boolean isCollection();
62
63 void add(Object element);
64
65 <E> void addAll(List<E> element);
66
67 }