|
23 | 23 | import org.codelibs.core.beans.factory.BeanDescFactory;
|
24 | 24 |
|
25 | 25 | /**
|
26 |
| - * JavaBeansのメタデータを扱うためのインターフェースです。 |
| 26 | + * Interface for handling JavaBeans metadata. |
27 | 27 | * <p>
|
28 |
| - * {@link BeanDesc}のインスタンスは{@link BeanDescFactory}から取得します。 |
| 28 | + * Instances of {@link BeanDesc} are obtained from {@link BeanDescFactory}. |
29 | 29 | * </p>
|
30 | 30 | *
|
31 | 31 | * <pre>
|
32 | 32 | * BeanDesc beanDesc = BeanDescFactory.getBeanDesc(Foo.class);
|
33 | 33 | * </pre>
|
34 | 34 | * <p>
|
35 |
| - * 取得した{@link BeanDesc}から,対象となるJavaBeansのプロパティやフィールド、コンストラクタ、メソッドのメタデータを取得できます。 |
| 35 | + * From the obtained {@link BeanDesc}, you can retrieve metadata of the properties, fields, constructors, and methods of the target JavaBeans. |
36 | 36 | * </p>
|
37 | 37 | *
|
38 | 38 | * <pre>
|
39 | 39 | * for (PropertyDesc propertyDesc : beanDesc.getPropertyDescs()) {
|
40 |
| - * propertyDesc.getValue(foo); // Foo のプロパティの値を取得 |
| 40 | + * propertyDesc.getValue(foo); // Retrieve the value of Foo's property |
41 | 41 | * }
|
42 | 42 | *
|
43 | 43 | * for (FieldDesc fieldDesc : beanDesc.getFieldDescs()) {
|
44 |
| - * fieldDesc.getFileldValue(foo); // Foo のフィールドの値を取得 |
| 44 | + * fieldDesc.getFieldValue(foo); // Retrieve the value of Foo's field |
45 | 45 | * }
|
46 | 46 | *
|
47 | 47 | * for (ConstructorDesc constructorDesc : beanDesc.getConstructorDescs()) {
|
48 |
| - * constructorDesc.newInstance(...); // Foo のインスタンスを生成 |
| 48 | + * constructorDesc.newInstance(...); // Create an instance of Foo |
49 | 49 | * }
|
50 | 50 | *
|
51 | 51 | * for (String methodName : beanDesc.getMethodNames()) {
|
52 | 52 | * for (MethodDesc methodDesc : beanDesc.getMethodDescs(methodName)) {
|
53 |
| - * methodDesc.invoke(foo, ...); // Foo のメソッドを起動 |
| 53 | + * methodDesc.invoke(foo, ...); // Invoke Foo's method |
54 | 54 | * }
|
55 | 55 | * }
|
56 | 56 | * </pre>
|
|
61 | 61 | public interface BeanDesc {
|
62 | 62 |
|
63 | 63 | /**
|
64 |
| - * Beanのクラスを返します。 |
| 64 | + * Returns the class of the Bean. |
65 | 65 | *
|
66 | 66 | * @param <T>
|
67 |
| - * Beanのクラス |
68 |
| - * @return Beanのクラス |
| 67 | + * The class of the Bean |
| 68 | + * @return The class of the Bean |
69 | 69 | */
|
70 | 70 | <T> Class<T> getBeanClass();
|
71 | 71 |
|
72 | 72 | /**
|
73 |
| - * 型変数から型引数へのマップを返します。 |
| 73 | + * Returns a map from type variables to type arguments. |
74 | 74 | *
|
75 |
| - * @return 型変数から型引数へのマップ |
| 75 | + * @return A map from type variables to type arguments |
76 | 76 | */
|
77 | 77 | Map<TypeVariable<?>, Type> getTypeVariables();
|
78 | 78 |
|
79 | 79 | /**
|
80 |
| - * {@link PropertyDesc}を持っているかどうかを返します。 |
| 80 | + * Returns whether the {@link PropertyDesc} exists. |
81 | 81 | *
|
82 | 82 | * @param propertyName
|
83 |
| - * プロパティ名。{@literal null}や空文字列であってはいけません |
84 |
| - * @return {@link PropertyDesc}を持っているかどうか |
| 83 | + * The property name. Must not be {@literal null} or empty string |
| 84 | + * @return Whether the {@link PropertyDesc} exists |
85 | 85 | */
|
86 | 86 | boolean hasPropertyDesc(String propertyName);
|
87 | 87 |
|
88 | 88 | /**
|
89 |
| - * {@link PropertyDesc}を返します。 |
| 89 | + * Returns the {@link PropertyDesc}. |
90 | 90 | *
|
91 | 91 | * @param propertyName
|
92 |
| - * プロパティ名。{@literal null}や空文字列であってはいけません |
| 92 | + * The property name. Must not be {@literal null} or empty string |
93 | 93 | * @return {@link PropertyDesc}
|
94 | 94 | */
|
95 | 95 | PropertyDesc getPropertyDesc(String propertyName);
|
96 | 96 |
|
97 | 97 | /**
|
98 |
| - * {@link PropertyDesc}を返します。 |
| 98 | + * Returns the {@link PropertyDesc}. |
99 | 99 | *
|
100 | 100 | * @param index
|
101 |
| - * {@link PropertyDesc}のインデックス |
| 101 | + * The index of the {@link PropertyDesc} |
102 | 102 | * @return {@link PropertyDesc}
|
103 | 103 | */
|
104 | 104 | PropertyDesc getPropertyDesc(int index);
|
105 | 105 |
|
106 | 106 | /**
|
107 |
| - * {@link PropertyDesc}の数を返します。 |
| 107 | + * Returns the number of {@link PropertyDesc}. |
108 | 108 | *
|
109 |
| - * @return {@link PropertyDesc}の数 |
| 109 | + * @return The number of {@link PropertyDesc} |
110 | 110 | */
|
111 | 111 | int getPropertyDescSize();
|
112 | 112 |
|
113 | 113 | /**
|
114 |
| - * {@link PropertyDesc}の{@link Iterable}を返します。 |
| 114 | + * Returns an {@link Iterable} of {@link PropertyDesc}. |
115 | 115 | *
|
116 |
| - * @return {@link PropertyDesc}の{@link Iterable} |
| 116 | + * @return An {@link Iterable} of {@link PropertyDesc} |
117 | 117 | */
|
118 | 118 | Iterable<PropertyDesc> getPropertyDescs();
|
119 | 119 |
|
120 | 120 | /**
|
121 |
| - * {@link FieldDesc}を持っているかどうかを返します。 |
| 121 | + * Returns whether the {@link FieldDesc} exists. |
122 | 122 | *
|
123 | 123 | * @param fieldName
|
124 |
| - * フィールド名。{@literal null}や空文字列であってはいけません |
125 |
| - * @return {@link FieldDesc}を持っているかどうか |
| 124 | + * The field name. Must not be {@literal null} or empty string |
| 125 | + * @return Whether the {@link FieldDesc} exists |
126 | 126 | */
|
127 | 127 | boolean hasFieldDesc(String fieldName);
|
128 | 128 |
|
129 | 129 | /**
|
130 |
| - * {@link FieldDesc}を返します。 |
| 130 | + * Returns the {@link FieldDesc}. |
131 | 131 | *
|
132 | 132 | * @param fieldName
|
133 |
| - * フィールド名。{@literal null}や空文字列であってはいけません |
| 133 | + * The field name. Must not be {@literal null} or empty string |
134 | 134 | * @return {@link FieldDesc}
|
135 | 135 | */
|
136 | 136 | FieldDesc getFieldDesc(String fieldName);
|
137 | 137 |
|
138 | 138 | /**
|
139 |
| - * {@link FieldDesc}を返します。 |
| 139 | + * Returns the {@link FieldDesc}. |
140 | 140 | *
|
141 | 141 | * @param index
|
142 |
| - * {@link FieldDesc}のインデックス |
| 142 | + * The index of the {@link FieldDesc} |
143 | 143 | * @return {@link FieldDesc}
|
144 | 144 | */
|
145 | 145 | FieldDesc getFieldDesc(int index);
|
146 | 146 |
|
147 | 147 | /**
|
148 |
| - * {@link FieldDesc}の数を返します。 |
| 148 | + * Returns the number of {@link FieldDesc}. |
149 | 149 | *
|
150 |
| - * @return {@link FieldDesc}の数 |
| 150 | + * @return The number of {@link FieldDesc} |
151 | 151 | */
|
152 | 152 | int getFieldDescSize();
|
153 | 153 |
|
154 | 154 | /**
|
155 |
| - * {@link FieldDesc}の{@link Iterable}を返します。 |
| 155 | + * Returns an {@link Iterable} of {@link FieldDesc}. |
156 | 156 | *
|
157 |
| - * @return {@link FieldDesc}の{@link Iterable} |
| 157 | + * @return An {@link Iterable} of {@link FieldDesc} |
158 | 158 | */
|
159 | 159 | Iterable<FieldDesc> getFieldDescs();
|
160 | 160 |
|
161 | 161 | /**
|
162 |
| - * 新しいインスタンスを作成します。 |
| 162 | + * Creates a new instance. |
163 | 163 | *
|
164 | 164 | * @param <T>
|
165 |
| - * Beanクラスの型 |
| 165 | + * The type of the Bean class |
166 | 166 | * @param args
|
167 |
| - * コンストラクタに渡す引数の並び |
168 |
| - * @return 新しいインスタンス |
| 167 | + * The arguments to pass to the constructor |
| 168 | + * @return A new instance |
169 | 169 | */
|
170 | 170 | <T> T newInstance(Object... args);
|
171 | 171 |
|
172 | 172 | /**
|
173 |
| - * 引数の型に応じた{@link ConstructorDesc}を返します。 |
| 173 | + * Returns the {@link ConstructorDesc} for the given parameter types. |
174 | 174 | *
|
175 | 175 | * @param paramTypes
|
176 |
| - * コンストラクタに渡す引数型の並び |
177 |
| - * @return 引数の型に応じた{@link ConstructorDesc} |
| 176 | + * The array of parameter types for the constructor |
| 177 | + * @return The {@link ConstructorDesc} for the given parameter types |
178 | 178 | */
|
179 | 179 | ConstructorDesc getConstructorDesc(Class<?>... paramTypes);
|
180 | 180 |
|
181 | 181 | /**
|
182 |
| - * 引数に適合する{@link ConstructorDesc}を返します。 |
| 182 | + * Returns the {@link ConstructorDesc} that matches the given arguments. |
183 | 183 | *
|
184 | 184 | * @param args
|
185 |
| - * コンストラクタに渡す引数の並び |
186 |
| - * @return 引数に適合する{@link Constructor} |
| 185 | + * The arguments to pass to the constructor |
| 186 | + * @return The {@link ConstructorDesc} that matches the given arguments |
187 | 187 | */
|
188 | 188 | ConstructorDesc getSuitableConstructorDesc(Object... args);
|
189 | 189 |
|
190 | 190 | /**
|
191 |
| - * {@link ConstructorDesc}を返します。 |
| 191 | + * Returns the {@link ConstructorDesc}. |
192 | 192 | *
|
193 | 193 | * @param index
|
194 |
| - * {@link ConstructorDesc}のインデックス |
| 194 | + * The index of the {@link ConstructorDesc} |
195 | 195 | * @return {@link ConstructorDesc}
|
196 | 196 | */
|
197 | 197 | ConstructorDesc getConstructorDesc(int index);
|
198 | 198 |
|
199 | 199 | /**
|
200 |
| - * {@link ConstructorDesc}の数を返します。 |
| 200 | + * Returns the number of {@link ConstructorDesc}. |
201 | 201 | *
|
202 |
| - * @return {@link ConstructorDesc}の数 |
| 202 | + * @return The number of {@link ConstructorDesc} |
203 | 203 | */
|
204 | 204 | int getConstructorDescSize();
|
205 | 205 |
|
206 | 206 | /**
|
207 |
| - * {@link ConstructorDesc}の{@link Iterable}を返します。 |
| 207 | + * Returns an {@link Iterable} of {@link ConstructorDesc}. |
208 | 208 | *
|
209 |
| - * @return {@link ConstructorDesc}の{@link Iterable} |
| 209 | + * @return An {@link Iterable} of {@link ConstructorDesc} |
210 | 210 | */
|
211 | 211 | Iterable<ConstructorDesc> getConstructorDescs();
|
212 | 212 |
|
213 | 213 | /**
|
214 |
| - * 引数の型に応じた{@link MethodDesc}を返します。 |
| 214 | + * Returns the {@link MethodDesc} for the given parameter types. |
215 | 215 | *
|
216 | 216 | * @param methodName
|
217 |
| - * メソッド名。{@literal null}や空文字列であってはいけません |
| 217 | + * The method name. Must not be {@literal null} or empty string |
218 | 218 | * @param paramTypes
|
219 |
| - * メソッドの引数型の並び |
220 |
| - * @return 引数の型に応じた{@link MethodDesc} メソッド |
| 219 | + * The array of parameter types for the method |
| 220 | + * @return The {@link MethodDesc} for the given parameter types |
221 | 221 | */
|
222 | 222 | MethodDesc getMethodDesc(String methodName, Class<?>... paramTypes);
|
223 | 223 |
|
224 | 224 | /**
|
225 |
| - * 引数の型に応じた{@link MethodDesc}を返します。見つからない場合は、{@literal null}を返します。 |
| 225 | + * Returns the {@link MethodDesc} that matches the given parameter types. If not found, returns {@literal null}. |
226 | 226 | *
|
227 | 227 | * @param methodName
|
228 |
| - * メソッド名。{@literal null}や空文字列であってはいけません |
| 228 | + * The method name. Must not be {@literal null} or empty string |
229 | 229 | * @param paramTypes
|
230 |
| - * メソッドの引数型の並び |
231 |
| - * @return 引数の型に応じた{@link MethodDesc} |
| 230 | + * The array of parameter types for the method |
| 231 | + * @return The {@link MethodDesc} that matches the given parameter types |
232 | 232 | */
|
233 | 233 | MethodDesc getMethodDescNoException(String methodName, Class<?>... paramTypes);
|
234 | 234 |
|
235 | 235 | /**
|
236 |
| - * 引数に適合する{@link MethodDesc}を返します。 |
| 236 | + * Returns the {@link MethodDesc} that matches the given arguments. |
237 | 237 | *
|
238 | 238 | * @param methodName
|
239 |
| - * メソッド名。{@literal null}や空文字列であってはいけません |
| 239 | + * The method name. Must not be {@literal null} or empty string |
240 | 240 | * @param args
|
241 |
| - * メソッドの引数の並び |
242 |
| - * @return 引数に適合する{@link MethodDesc} メソッド |
| 241 | + * The array of arguments for the method |
| 242 | + * @return The {@link MethodDesc} that matches the given arguments |
243 | 243 | */
|
244 | 244 | MethodDesc getSuitableMethodDesc(String methodName, Object... args);
|
245 | 245 |
|
246 | 246 | /**
|
247 |
| - * {@link MethodDesc}があるかどうか返します。 |
| 247 | + * Returns whether the {@link MethodDesc} exists. |
248 | 248 | *
|
249 | 249 | * @param methodName
|
250 |
| - * メソッド名。{@literal null}や空文字列であってはいけません |
251 |
| - * @return {@link MethodDesc}があるかどうか |
| 250 | + * The method name. Must not be {@literal null} or empty string |
| 251 | + * @return Whether the {@link MethodDesc} exists |
252 | 252 | */
|
253 | 253 | boolean hasMethodDesc(String methodName);
|
254 | 254 |
|
255 | 255 | /**
|
256 |
| - * {@link MethodDesc}の配列を返します。 |
| 256 | + * Returns an array of {@link MethodDesc}. |
257 | 257 | *
|
258 | 258 | * @param methodName
|
259 |
| - * メソッド名。{@literal null}や空文字列であってはいけません |
260 |
| - * @return {@link MethodDesc}の配列 |
| 259 | + * The method name. Must not be {@literal null} or empty string |
| 260 | + * @return An array of {@link MethodDesc} |
261 | 261 | */
|
262 | 262 | MethodDesc[] getMethodDescs(String methodName);
|
263 | 263 |
|
264 | 264 | /**
|
265 |
| - * メソッド名の配列を返します。 |
| 265 | + * Returns an array of method names. |
266 | 266 | *
|
267 |
| - * @return メソッド名の配列 |
| 267 | + * @return An array of method names |
268 | 268 | */
|
269 | 269 | String[] getMethodNames();
|
270 | 270 |
|
|
0 commit comments