001package org.apache.commons.beanutils2; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import java.beans.IndexedPropertyDescriptor; 023import java.beans.PropertyDescriptor; 024import java.lang.reflect.Method; 025import java.util.Map; 026 027public interface BeanProperties<B> 028{ 029 030 /** 031 * Checks if the current bean type has a property identified by the input name. 032 * 033 * @param propertyName the name of the property to be checked. 034 * @return true if the current bean type has a property identified by the input name, 035 * false otherwise. 036 */ 037 boolean hasProperty( String propertyName ); 038 039 /** 040 * Checks if the specified property name identifies a readable property. 041 * 042 * @param propertyName the name of the property to be checked. 043 * @return {@code true}, if the property is readable. 044 */ 045 boolean isReadable( String propertyName ); 046 047 /** 048 * Checks if the specified property name identifies a writable property. 049 * 050 * @param propertyName the name of the property to be checked. 051 * @return {@code true}, if the property is writable. 052 */ 053 boolean isWritable( String propertyName ); 054 055 /** 056 * 057 * @param propertyName 058 * @return 059 */ 060 PropertyDescriptor getPropertyDescriptor( String propertyName ); 061 062 /** 063 * 064 * @param propertyName 065 * @return 066 */ 067 Method getReadPropertyMethod( String propertyName ); 068 069 /** 070 * 071 * @param name 072 * @return 073 */ 074 Method getWriteMethod( String name ); 075 076 /** 077 * 078 * @param propertyName 079 * @return 080 */ 081 IndexedPropertyDescriptor getIndexedPropertyDescriptor( String propertyName ); 082 083 /** 084 * 085 * @param propertyName 086 * @return 087 */ 088 Method getIndexedReadMethod( String propertyName ); 089 090 /** 091 * 092 * @param propertyName 093 * @return 094 */ 095 Method getIndexedWriteMethod( String propertyName ); 096 097 MappedPropertyDescriptor getMappedPropertyDescriptor( String propertyName ); 098 099 Method getMappedReadMethod( String propertyName ); 100 101 /** 102 * 103 * @return 104 */ 105 Map<String, PropertyDescriptor> getPropertiesIndex(); 106 107 Method getMappedWriteMethod( String propertyName ); 108}