List conditionRuleReflectMethods = new ArrayList();
Method[] pojoMethods = pojo.getClass().getMethods();
for (int i = 0; i < pojoMethods.length; i++) {
Method pojoMethod = pojoMethods[i];
MethodMetadata methodMetadata = methodMetadataSource.getMethodMetadata(pojoMethod);
if (methodMetadata == null) {
if (log.isDebugEnabled()) {
log.debug("No metadata for method " + pojoMethod.toString());
}
continue;
}
ArgumentMetadata[] argumentsMetadata = getArgumentMetadata(pojoMethod);
Argument[] arguments = getArguments(rule, argumentsMetadata);
if (methodMetadata.getMethodType() == MethodMetadata.METHOD_CONDITION) {
assertReturnType(pojoMethod, boolean.class);
rule.addCondition(
new PojoCondition(new RuleReflectMethod(rule, pojo, pojoMethod, arguments)));
log.info("Condition method added to rule: " + pojoMethod.toString());
} else if (methodMetadata.getMethodType() == MethodMetadata.METHOD_CONSEQUENCE) {
conditionRuleReflectMethods.add(
new RuleReflectMethod(rule, pojo, pojoMethod, arguments));
log.info("Consequence method added to rule: " + pojoMethod.toString());
} else if (methodMetadata.getMethodType() == MethodMetadata.OBJECT_CONDITION) {
if (arguments.length != 0) {
throw new InvalidPojoConditionException("Rule pojo condition must not have arguments"
+ ": method = " + pojoMethod + ", arguments = " + arguments);
}
try {