001/*
002 * Copyright 2002-2014 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.beans;
018
019/**
020 * Exception thrown on an attempt to get the value of a property
021 * that isn't readable, because there's no getter method.
022 *
023 * @author Juergen Hoeller
024 * @since 1.0.2
025 */
026@SuppressWarnings("serial")
027public class NotReadablePropertyException extends InvalidPropertyException {
028
029        /**
030         * Create a new NotReadablePropertyException.
031         * @param beanClass the offending bean class
032         * @param propertyName the offending property
033         */
034        public NotReadablePropertyException(Class<?> beanClass, String propertyName) {
035                super(beanClass, propertyName,
036                                "Bean property '" + propertyName + "' is not readable or has an invalid getter method: " +
037                                "Does the return type of the getter match the parameter type of the setter?");
038        }
039
040        /**
041         * Create a new NotReadablePropertyException.
042         * @param beanClass the offending bean class
043         * @param propertyName the offending property
044         * @param msg the detail message
045         */
046        public NotReadablePropertyException(Class<?> beanClass, String propertyName, String msg) {
047                super(beanClass, propertyName, msg);
048        }
049
050        /**
051         * Create a new NotReadablePropertyException.
052         * @param beanClass the offending bean class
053         * @param propertyName the offending property
054         * @param msg the detail message
055         * @param cause the root cause
056         * @since 4.0.9
057         */
058        public NotReadablePropertyException(Class<?> beanClass, String propertyName, String msg, Throwable cause) {
059                super(beanClass, propertyName, msg, cause);
060        }
061
062}