bdi4jade.util

## Class ReflectionUtils

- java.lang.Object
- - bdi4jade.util.ReflectionUtils

-     public abstract class ReflectionUtils
      extends java.lang.Object

  This is a utility class that provides many methods that use reflection for different purposes.
  Author:
    Ingrid Nunes

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReflectionUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addGoalOwner(java.util.Map<java.lang.Class<? extends Capability>,java.util.Set<Capability>> goalOwnersMap, Capability capability)` Adds to the goal owners map the capability classes that owns a goal to the capability instance passed as parameter.
    `static void` | `setPlanBodyInput(PlanBody planBody, Goal goal)` Sets the input parameters of a plan body based on the parameters passed in the goal that triggered its execution.
    `static void` | `setPlanBodyOutput(PlanBody planBody, Goal goal)` Sets the output parameters of a goal based on the output generated by the plan body whose execution was triggered by this goal.
    `static void` | `setupBeliefs(PlanBody planBody)` Sets plan body fields annotated with `Belief`.
    `static void` | `setupParameters(Goal goalOut, Goal goalIn)` Sets the input parameters of goal based on the output parameters of another goal.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ReflectionUtils

          public ReflectionUtils()

  - ### Method Detail

    - #### addGoalOwner

          public static void addGoalOwner(java.util.Map<java.lang.Class<? extends Capability>,java.util.Set<Capability>> goalOwnersMap,
                                          Capability capability)

      Adds to the goal owners map the capability classes that owns a goal to the capability instance passed as parameter.
      Parameters:
        `goalOwnersMap` - the goal owners map to which the owners of the given capability should be added.
        `capability` - the capability that should be added to the map.

    - #### setPlanBodyInput

          public static void setPlanBodyInput(PlanBody planBody,
                                              Goal goal)
                                       throws ParameterException

      Sets the input parameters of a plan body based on the parameters passed in the goal that triggered its execution.
      Parameters:
        `planBody` - the plan body to have its input parameters set.
        `goal` - the goal that has input parameters.
      Throws:
        `ParameterException` - if an exception occurs in this setting process.

    - #### setPlanBodyOutput

          public static void setPlanBodyOutput(PlanBody planBody,
                                               Goal goal)
                                        throws ParameterException

      Sets the output parameters of a goal based on the output generated by the plan body whose execution was triggered by this goal.
      Parameters:
        `planBody` - the plan body generated the output parameters.
        `goal` - the goal to have its output parameters set.
      Throws:
        `ParameterException` - if an exception occurs in this setting process.

    - #### setupBeliefs

          public static void setupBeliefs(PlanBody planBody)

      Sets plan body fields annotated with `Belief`.
      Parameters:
        `planBody` - the plan body to be setup with beliefs.

    - #### setupParameters

          public static void setupParameters(Goal goalOut,
                                             Goal goalIn)
                                      throws ParameterException

      Sets the input parameters of goal based on the output parameters of another goal. This is useful when goals are executed sequentially, and the input of a goal is the output of another.
      Parameters:
        `goalOut` - the goal that has output parameters that are input of the goalIn.
        `goalIn` - the goal to have its input parameters set.
      Throws:
        `ParameterException` - if an exception occurs in this setting process.