Ejemplo n.º 1
0
 public int addAccessibleMethod(Method method) {
   if (accessibleMethods == null) {
     accessibleMethods = new ArrayList<Method>();
   }
   int index = accessibleMethods.size();
   accessibleMethods.add(method);
   return index;
 }
Ejemplo n.º 2
0
 public int addAccessibleField(Field field) {
   if (accessibleFields == null) {
     accessibleFields = new ArrayList<Field>();
   }
   int index = accessibleFields.size();
   accessibleFields.add(field);
   return index;
 }
Ejemplo n.º 3
0
 public Object invokeAccessibleMethod(Object target, Object[] args, int methodIndex) {
   try {
     Method method = accessibleMethods.get(methodIndex);
     return method.invoke(target, args);
   } catch (Exception e) {
     throw new ExecuteException(
         "Rule.invokeAccessibleMethod : unexpected error invoking non-public method in rule "
             + getName(),
         e);
   }
 }
Ejemplo n.º 4
0
 public Object getAccessibleField(Object owner, int fieldIndex) throws ExecuteException {
   try {
     Field field = accessibleFields.get(fieldIndex);
     return field.get(owner);
   } catch (Exception e) {
     throw new ExecuteException(
         "Rule.getAccessibleField : unexpected error getting non-public field in rule "
             + getName(),
         e);
   }
 }
Ejemplo n.º 5
0
 public void setAccessibleField(Object owner, Object value, int fieldIndex)
     throws ExecuteException {
   try {
     Field field = accessibleFields.get(fieldIndex);
     field.set(owner, value);
   } catch (Exception e) {
     throw new ExecuteException(
         "Rule.setAccessibleField : unexpected error setting non-public field in rule "
             + getName(),
         e);
   }
 }