コード例 #1
0
 @Override
 public Object get(Object object) {
   try {
     property.getReadMethod().setAccessible(true); // issue 50
     return property.getReadMethod().invoke(object);
   } catch (Exception e) {
     throw new YAMLException(
         "Unable to find getter for property '"
             + property.getName()
             + "' on object "
             + object
             + ":"
             + e);
   }
 }
コード例 #2
0
 public MethodProperty(PropertyDescriptor property) {
   super(
       property.getName(),
       property.getPropertyType(),
       property.getReadMethod() == null ? null : property.getReadMethod().getGenericReturnType());
   this.property = property;
   this.readable = property.getReadMethod() != null;
   this.writable = property.getWriteMethod() != null;
 }
コード例 #3
0
 @Override
 public void set(Object object, Object value) throws Exception {
   property.getWriteMethod().invoke(object, value);
 }