View Javadoc
1   /*
2    *    Copyright 2009-2022 the original author or authors.
3    *
4    *    Licensed under the Apache License, Version 2.0 (the "License");
5    *    you may not use this file except in compliance with the License.
6    *    You may obtain a copy of the License at
7    *
8    *       https://www.apache.org/licenses/LICENSE-2.0
9    *
10   *    Unless required by applicable law or agreed to in writing, software
11   *    distributed under the License is distributed on an "AS IS" BASIS,
12   *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *    See the License for the specific language governing permissions and
14   *    limitations under the License.
15   */
16  package org.apache.ibatis.reflection.wrapper;
17  
18  import java.util.List;
19  
20  import org.apache.ibatis.reflection.MetaObject;
21  import org.apache.ibatis.reflection.factory.ObjectFactory;
22  import org.apache.ibatis.reflection.property.PropertyTokenizer;
23  
24  /**
25   * @author Clinton Begin
26   */
27  public interface ObjectWrapper {
28  
29    Object get(PropertyTokenizer prop);
30  
31    void set(PropertyTokenizer prop, Object value);
32  
33    String findProperty(String name, boolean useCamelCaseMapping);
34  
35    String[] getGetterNames();
36  
37    String[] getSetterNames();
38  
39    Class<?> getSetterType(String name);
40  
41    Class<?> getGetterType(String name);
42  
43    boolean hasSetter(String name);
44  
45    boolean hasGetter(String name);
46  
47    MetaObject instantiatePropertyValue(String name, PropertyTokenizer prop, ObjectFactory objectFactory);
48  
49    boolean isCollection();
50  
51    void add(Object element);
52  
53    <E> void addAll(List<E> element);
54  
55  }