
package com.googlecode.aluminumproject.libraries.actions;

import com.googlecode.aluminumproject.AluminumException;
import com.googlecode.aluminumproject.context.Context;

import java.lang.reflect.Type;

/**
 * A parameter of an {@link Action action}.
 */
public interface ActionParameter {
	/**
	 * Returns the text that was used to create this parameter.
	 *
	 * @return this parameter's text
	 */
	String getText();

	/**
	 * Returns the value of this parameter.
	 *
	 * @param type the required type for the parameter value
	 * @param context the context in which the parameter's action is executed
	 * @return the value of this parameter with the given type
	 * @throws AluminumException when the parameter value can't be retrieved or converted to the desired type
	 */
	Object getValue(Type type, Context context) throws AluminumException;
}