// Path: src/main/java/br/unicamp/cst/core/entities/CSTMessages.java
// public class CSTMessages {
// 
// 	// DRIVE MESSAGES.
// 	public static final String MSG_VAR_NAME_NULL = "Drive name is null.";
// 	public static final String MSG_VAR_RELEVANCE = "Drive relevance must be less equal than 1 and greater equal than 0.";
// 	public static final String MSG_VAR_PRIORITY_NULL = "Drive priority is null.";
// 	public static final String MSG_VAR_URGENT_ACTIVATION_RANGE = "Drive urgent activation must be less equal than 1 and greater equal than 0.";
// 	public static final String MSG_VAR_URGENT_ACTIVATION_THRESHOLD_RANGE = "Drive urgent activation threshold must be less equal than 1 and greater equal than 0.";
// 	public static final String MSG_VAR_LOWER_URGENT_ACTIVATION_THRESHOLD_RANGE = "Drive lower urgent activation threshold must be less equal than 1 and greater equal than 0.";
// 	public static final String MSG_VAR_HIGH_PRIORITY = "Drive high priority must be less equal than 1 and greater equal than 0.";
// 
// 	// GOAL MESSAGES.
// 	public static final String MSG_VAR_EMOTIONAL_NAME_NULL = "EmotionalCodelet name is null";
// 	public static final String MSG_VAR_EMOTIONAL_DRIVE_VOTES = "EmotionalCodelet drive votes is null or empty.";
// 	public static final String MSG_VAR_EMOTIONAL_INTERVENTION_THRESHOLD = "Intervention threshold must be less equal than 1 and greater equal than 0.";
// 
// 	// AFFORDANCE MESSAGES.
// 	public static final String MSG_VAR_DETECTOR_OBJECT = "Detector object is null.";
// 	public static final String MSG_VAR_APPLY_OBJECT = "Apply object is null.";
// 
// }


import br.unicamp.cst.core.entities.CSTMessages;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

    public Object detector(String methodName, Object... args) {
        try {
            if (getDetectorObject() == null) {
                throw new Exception(CSTMessages.MSG_VAR_DETECTOR_OBJECT);
            } else {
                return CodeBuilder.executeMethod(getDetectorObject(), methodName, args);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }

    public Object apply(String methodName, Object... args) {
        try {
            if (getDetectorObject() == null) {
                throw new Exception(CSTMessages.MSG_VAR_APPLY_OBJECT);
            } else {
                return CodeBuilder.executeMethod(getApplyObject(), methodName, args);
            }
        } catch (Exception e){
            e.printStackTrace();
        }

        return null;
    }


// Path: src/main/java/br/unicamp/cst/core/entities/CSTMessages.java
// public class CSTMessages {
// 
// 	// DRIVE MESSAGES.
// 	public static final String MSG_VAR_NAME_NULL = "Drive name is null.";
// 	public static final String MSG_VAR_RELEVANCE = "Drive relevance must be less equal than 1 and greater equal than 0.";
// 	public static final String MSG_VAR_PRIORITY_NULL = "Drive priority is null.";
// 	public static final String MSG_VAR_URGENT_ACTIVATION_RANGE = "Drive urgent activation must be less equal than 1 and greater equal than 0.";
// 	public static final String MSG_VAR_URGENT_ACTIVATION_THRESHOLD_RANGE = "Drive urgent activation threshold must be less equal than 1 and greater equal than 0.";
// 	public static final String MSG_VAR_LOWER_URGENT_ACTIVATION_THRESHOLD_RANGE = "Drive lower urgent activation threshold must be less equal than 1 and greater equal than 0.";
// 	public static final String MSG_VAR_HIGH_PRIORITY = "Drive high priority must be less equal than 1 and greater equal than 0.";
// 
// 	// GOAL MESSAGES.
// 	public static final String MSG_VAR_EMOTIONAL_NAME_NULL = "EmotionalCodelet name is null";
// 	public static final String MSG_VAR_EMOTIONAL_DRIVE_VOTES = "EmotionalCodelet drive votes is null or empty.";
// 	public static final String MSG_VAR_EMOTIONAL_INTERVENTION_THRESHOLD = "Intervention threshold must be less equal than 1 and greater equal than 0.";
// 
// 	// AFFORDANCE MESSAGES.
// 	public static final String MSG_VAR_DETECTOR_OBJECT = "Detector object is null.";
// 	public static final String MSG_VAR_APPLY_OBJECT = "Apply object is null.";
// 
// }


// Path: src/main/java/br/unicamp/cst/representation/owrl/DynamicAffordance.java
import br.unicamp.cst.core.entities.CSTMessages;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;


    public Object detector(String methodName, Object... args) {
        try {
            if (getDetectorObject() == null) {
                throw new Exception(CSTMessages.MSG_VAR_DETECTOR_OBJECT);
            } else {
                return CodeBuilder.executeMethod(getDetectorObject(), methodName, args);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }

    public Object apply(String methodName, Object... args) {
        try {
            if (getDetectorObject() == null) {
                throw new Exception(CSTMessages.MSG_VAR_APPLY_OBJECT);
            } else {
                return CodeBuilder.executeMethod(getApplyObject(), methodName, args);
            }
        } catch (Exception e){
            e.printStackTrace();
        }

        return null;
    }


    protected String getApplyCode() {