All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nyla.solutions.global.patterns.command.ScriptingExecutable Maven / Gradle / Ivy

Go to download

Nyla Solutions Global Java API provides support for basic application utilities (application configuration, data encryption, debugger and text processing).

The newest version!
package nyla.solutions.global.patterns.command;

import nyla.solutions.global.exception.RequiredException;
import nyla.solutions.global.patterns.scripting.Scripting;

/**
 * Executable wrapper to execute a scripting expression
 * @author Gregory Green
 *
 */
public class ScriptingExecutable implements Executable
{

	/**
	 * @return scripting.interpret(expression, input)
	 * @see nyla.solutions.global.patterns.command.Command#execute(java.lang.Object)
	 */
	@Override
	public Integer execute(Environment input)
	{
		if(scripting == null)
			throw new RequiredException("this.scripting");
		
		return scripting.interpret(expression, input);
	}// --------------------------------------------------------
	
	/**
	 * @return the scripting
	 */
	public Scripting getScripting()
	{
		return scripting;
	}// --------------------------------------------------------
	/**
	 * @param scripting the scripting to set
	 */
	public void setScripting(Scripting scripting)
	{
		this.scripting = scripting;
	}// --------------------------------------------------------
	/**
	 * @return the expression
	 */
	public String getExpression()
	{
		return expression;
	}// --------------------------------------------------------
	/**
	 * @param expression the expression to set
	 */
	public void setExpression(String expression)
	{
		this.expression = expression;
	}// --------------------------------------------------------


	private Scripting scripting;
	private String expression = null;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy