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.util.Collection;
19 import java.util.List;
20
21 import org.apache.ibatis.reflection.MetaObject;
22 import org.apache.ibatis.reflection.factory.ObjectFactory;
23 import org.apache.ibatis.reflection.property.PropertyTokenizer;
24
25
26
27
28 public class CollectionWrapper implements ObjectWrapper {
29
30 private Collection<Object> object;
31
32 public CollectionWrapper(MetaObject metaObject, Collection<Object> object) {
33 this.object = object;
34 }
35
36 @Override
37 public Object get(PropertyTokenizer prop) {
38 throw new UnsupportedOperationException();
39 }
40
41 @Override
42 public void set(PropertyTokenizer prop, Object value) {
43 throw new UnsupportedOperationException();
44 }
45
46 @Override
47 public String findProperty(String name, boolean useCamelCaseMapping) {
48 throw new UnsupportedOperationException();
49 }
50
51 @Override
52 public String[] getGetterNames() {
53 throw new UnsupportedOperationException();
54 }
55
56 @Override
57 public String[] getSetterNames() {
58 throw new UnsupportedOperationException();
59 }
60
61 @Override
62 public Class<?> getSetterType(String name) {
63 throw new UnsupportedOperationException();
64 }
65
66 @Override
67 public Class<?> getGetterType(String name) {
68 throw new UnsupportedOperationException();
69 }
70
71 @Override
72 public boolean hasSetter(String name) {
73 throw new UnsupportedOperationException();
74 }
75
76 @Override
77 public boolean hasGetter(String name) {
78 throw new UnsupportedOperationException();
79 }
80
81 @Override
82 public MetaObject instantiatePropertyValue(String name, PropertyTokenizer prop, ObjectFactory objectFactory) {
83 throw new UnsupportedOperationException();
84 }
85
86 @Override
87 public boolean isCollection() {
88 return true;
89 }
90
91 @Override
92 public void add(Object element) {
93 object.add(element);
94 }
95
96 @Override
97 public <E> void addAll(List<E> element) {
98 object.addAll(element);
99 }
100
101 }