org.apache.myfaces.extensions.cdi.scripting.api
Interface ScriptBuilder

All Superinterfaces:
Serializable

public interface ScriptBuilder
extends Serializable

Helper for building scripts


Method Summary
 ScriptBuilder bindings(javax.script.Bindings bindings)
          Adds a Bindings instance to the current builder instance
 Object eval()
          Evaluates the script built with the current ScriptBuilder
<T> T
eval(Class<T> returnType)
          Evaluates the script built with the current ScriptBuilder
 ScriptBuilder namedArgument(String name, Object value)
          Adds an argument with a specific nam to the current builder instance
 ScriptBuilder script(String script)
          Adds a script to the current builder instance
 

Method Detail

script

ScriptBuilder script(String script)
Adds a script to the current builder instance

Parameters:
script - target script
Returns:
current builder

namedArgument

ScriptBuilder namedArgument(String name,
                            Object value)
Adds an argument with a specific nam to the current builder instance

Parameters:
name - name of the argument
value - value of the argument
Returns:
current builder

bindings

ScriptBuilder bindings(javax.script.Bindings bindings)
Adds a Bindings instance to the current builder instance

Parameters:
bindings - bindings which should be used
Returns:
current builder

eval

Object eval()
Evaluates the script built with the current ScriptBuilder

Returns:
result of the evaluated script

eval

<T> T eval(Class<T> returnType)
Evaluates the script built with the current ScriptBuilder

Parameters:
returnType - target type of the result
Returns:
result of the evaluated script


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.