1 package jp.ac.aiit.xdf.component.swing.attribute;
4 import java.lang.reflect.Method;
6 import jp.ac.aiit.xdf.utils.Reflections;
8 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory;
15 public class GetterAttributeProcessor implements AttributeGetProcessor {
16 private static final Logger log = LoggerFactory.getLogger(GetterAttributeProcessor.class);
18 private String method;
23 public GetterAttributeProcessor(String method) {
28 public Object invokeGet(Object target, String name) {
29 Class<?> clazz = target.getClass();
32 Method m = clazz.getMethod(method);
33 return Reflections.invokeMethod(target, m);
34 } catch (SecurityException e) {
35 log.warn("ゲッターの適用に失敗: target:"+target+", name:"+name, e);
36 } catch (NoSuchMethodException e) {
37 log.warn("ゲッターの適用に失敗: target:"+target+", name:"+name, e);