View Javadoc

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 java.lang.annotation.Annotation;
19  import java.util.Set;
20  
21  /**
22   * Java Beans を扱うためのインターフェースです。
23   * 
24   * @author baba
25   */
26  public interface BeanDesc {
27  
28  	/**
29  	 * 指定された名前のプロパティへアクセスする属性があるかどうかを示します。
30  	 * 
31  	 * @param name
32  	 *            属性名
33  	 * @return 指定された名前のプロパティへアクセスする属性がある場合は <code>true</code>、そうでない場合は
34  	 *         <code>false</code>
35  	 */
36  	boolean hasPropertyAttribute(String name);
37  
38  	/**
39  	 * 指定された名前のプロパティへアクセスする属性を返します。
40  	 * 
41  	 * @param name
42  	 *            属性名
43  	 * @return {@link Attribute}
44  	 * @throws AttributeNotFoundException
45  	 *             {@link Attribute} が見つからない場合
46  	 */
47  	Attribute getPropertyAttribute(String name)
48  			throws AttributeNotFoundException;
49  
50  	/**
51  	 * 指定された名前のフィールドへアクセスする属性があるかどうかを示します。
52  	 * 
53  	 * @param name
54  	 *            属性名
55  	 * @return 指定された名前のフィールドへアクセスする属性がある場合は <code>true</code>、そうでない場合は
56  	 *         <code>false</code>
57  	 */
58  	boolean hasFieldAttribute(String name);
59  
60  	/**
61  	 * 指定された名前のフィールドへアクセスする属性を返します。
62  	 * 
63  	 * @param name
64  	 *            属性名
65  	 * @return {@link Attribute} のコレクション
66  	 * @throws AttributeNotFoundException
67  	 *             {@link Attribute} が見つからない場合
68  	 */
69  	Attribute getFieldAttribute(String name);
70  
71  	/**
72  	 * すべてのプロパティへアクセスする検索します。
73  	 * 
74  	 * @return {@link Attribute} のコレクション
75  	 */
76  	Set<Attribute> findtPropertyAttributes();
77  
78  	/**
79  	 * すべてのフィールドへアクセスする属性を検索します。
80  	 * 
81  	 * @return {@link Attribute} のコレクション
82  	 */
83  	Set<Attribute> findFieldAttributes();
84  
85  	/**
86  	 * すべてのプロパティとフィールドへアクセスする属性を返します。
87  	 * 
88  	 * @return {@link Attribute} のコレクション
89  	 */
90  	Set<Attribute> findAllAttributes();
91  
92  	/**
93  	 * 指定されたアノテーションで修飾された、プロパティまたはフィールドへアクセスする属性を返します。
94  	 * 
95  	 * @param annotationClass
96  	 *            アノテーションの型
97  	 * @return {@link Attribute} のコレクション
98  	 */
99  	Set<Attribute> findAttributesAnnotatedWith(
100 			Class<? extends Annotation> annotationClass);
101 
102 }