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