示例#1
0
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
      String name = method.getName();

      if (m_accessor.isEligible(m_instance, method, args)) {
        return m_accessor.getValue(m_instance, method, args);
      } else {
        throw new UnsupportedOperationException(
            String.format("No method(%s) defined in %s", name, m_instance.getClass()));
      }
    }
示例#2
0
 @Override
 public boolean isEligible(Object instance, Method method, Object[] args) {
   return m_accessor.isEligible(m_value, method, args);
 }