Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
PropertyNotFoundException |
|
| 0.0;0 |
1 | /* | |
2 | * Copyright 2004-2009 the Seasar Foundation and the Others. | |
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 | * http://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, | |
13 | * either express or implied. See the License for the specific language | |
14 | * governing permissions and limitations under the License. | |
15 | */ | |
16 | package org.seasar.cubby.spi.beans; | |
17 | ||
18 | import static org.seasar.cubby.internal.util.LogMessages.format; | |
19 | ||
20 | /** | |
21 | * プロパティが見つからなかったことを表す例外です。 | |
22 | * | |
23 | * @author baba | |
24 | * @since 2.0.0 | |
25 | */ | |
26 | public class PropertyNotFoundException extends RuntimeException { | |
27 | ||
28 | /** シリアルバージョン UID。 */ | |
29 | private static final long serialVersionUID = 1L; | |
30 | ||
31 | /** 対象のクラス。 */ | |
32 | private final Class<?> targetClass; | |
33 | ||
34 | /** プロパティ名。 */ | |
35 | private final String propertyName; | |
36 | ||
37 | /** | |
38 | * {@link PropertyNotFoundException}を返します。 | |
39 | * | |
40 | * @param targetClass | |
41 | * 対象のクラス | |
42 | * @param propertyName | |
43 | * プロパティ名 | |
44 | */ | |
45 | public PropertyNotFoundException(final Class<?> targetClass, | |
46 | final String propertyName) { | |
47 | 2 | super(format("ECUB0052", targetClass.getName(), propertyName)); |
48 | 2 | this.targetClass = targetClass; |
49 | 2 | this.propertyName = propertyName; |
50 | 2 | } |
51 | ||
52 | /** | |
53 | * 対象のクラスを返します。 | |
54 | * | |
55 | * @return 対象のクラス | |
56 | */ | |
57 | public Class<?> getTargetClass() { | |
58 | 0 | return targetClass; |
59 | } | |
60 | ||
61 | /** | |
62 | * プロパティ名を返します。 | |
63 | * | |
64 | * @return プロパティ名 | |
65 | */ | |
66 | public String getPropertyName() { | |
67 | 0 | return propertyName; |
68 | } | |
69 | } |