View Javadoc
1   package org.apache.commons.beanutils2;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.beans.IndexedPropertyDescriptor;
23  import java.beans.PropertyDescriptor;
24  import java.lang.reflect.Method;
25  import java.util.Map;
26  
27  public interface BeanProperties<B>
28  {
29  
30      /**
31       * Checks if the current bean type has a property identified by the input name.
32       *
33       * @param propertyName the name of the property to be checked.
34       * @return true if the current bean type has a property identified by the input name,
35       *         false otherwise.
36       */
37      boolean hasProperty( String propertyName );
38  
39      /**
40       * Checks if the specified property name identifies a readable property.
41       *
42       * @param propertyName the name of the property to be checked.
43       * @return {@code true}, if the property is readable.
44       */
45      boolean isReadable( String propertyName );
46  
47      /**
48       * Checks if the specified property name identifies a writable property.
49       *
50       * @param propertyName the name of the property to be checked.
51       * @return {@code true}, if the property is writable.
52       */
53      boolean isWritable( String propertyName );
54  
55      /**
56       *
57       * @param propertyName
58       * @return
59       */
60      PropertyDescriptor getPropertyDescriptor( String propertyName );
61  
62      /**
63       *
64       * @param propertyName
65       * @return
66       */
67      Method getReadPropertyMethod( String propertyName );
68  
69      /**
70       *
71       * @param name
72       * @return
73       */
74      Method getWriteMethod( String name );
75  
76      /**
77       *
78       * @param propertyName
79       * @return
80       */
81      IndexedPropertyDescriptor getIndexedPropertyDescriptor( String propertyName );
82  
83      /**
84       *
85       * @param propertyName
86       * @return
87       */
88      Method getIndexedReadMethod( String propertyName );
89  
90      /**
91       *
92       * @param propertyName
93       * @return
94       */
95      Method getIndexedWriteMethod( String propertyName );
96  
97      MappedPropertyDescriptor getMappedPropertyDescriptor( String propertyName );
98  
99      Method getMappedReadMethod( String propertyName );
100 
101     /**
102      *
103      * @return
104      */
105     Map<String, PropertyDescriptor> getPropertiesIndex();
106 
107     Method getMappedWriteMethod( String propertyName );
108 }