Class ScriptItemProcessorBuilder<I,O>
- java.lang.Object
- org.springframework.batch.item.support.builder.ScriptItemProcessorBuilder<I,O>
public class ScriptItemProcessorBuilder<I,O> extends java.lang.Object
Creates a fully qualified ScriptItemProcessor.- Since:
- 4.0
- Author:
- Glenn Renfro
Constructor Summary
Constructors Constructor Description ScriptItemProcessorBuilder()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScriptItemProcessor<I,O>
build()
Returns a fully constructedScriptItemProcessor
.ScriptItemProcessorBuilder<I,O>
itemBindingVariableName(java.lang.String itemBindingVariableName)
Provides the ability to change the key name that scripts use to obtain the current item to process if the variable represented by:ScriptItemProcessor.ITEM_BINDING_VARIABLE_NAME
is not suitable ("item").ScriptItemProcessorBuilder<I,O>
language(java.lang.String language)
Establishes the language of the script.ScriptItemProcessorBuilder<I,O>
scriptResource(org.springframework.core.io.Resource resource)
Sets theResource
location of the script to use.ScriptItemProcessorBuilder<I,O>
scriptSource(java.lang.String scriptSource)
Sets the providedString
as the script source code to use.
Method Detail
scriptResource
public ScriptItemProcessorBuilder<I,O> scriptResource(org.springframework.core.io.Resource resource)
Sets theResource
location of the script to use. The script language will be deduced from the filename extension.- Parameters:
resource
- theResource
location of the script to use.- Returns:
- this instance for method chaining
- See Also:
ScriptItemProcessor.setScript(Resource)
language
public ScriptItemProcessorBuilder<I,O> language(java.lang.String language)
Establishes the language of the script.- Parameters:
language
- the language of the script.- Returns:
- this instance for method chaining
- See Also:
ScriptItemProcessor.setScriptSource(String, String)
scriptSource
public ScriptItemProcessorBuilder<I,O> scriptSource(java.lang.String scriptSource)
Sets the providedString
as the script source code to use. Language must not be null nor empty when using script.- Parameters:
scriptSource
- theString
form of the script source code to use.- Returns:
- this instance for method chaining
- See Also:
ScriptItemProcessor.setScriptSource(String, String)
itemBindingVariableName
public ScriptItemProcessorBuilder<I,O> itemBindingVariableName(java.lang.String itemBindingVariableName)
Provides the ability to change the key name that scripts use to obtain the current item to process if the variable represented by:ScriptItemProcessor.ITEM_BINDING_VARIABLE_NAME
is not suitable ("item").- Parameters:
itemBindingVariableName
- the desired binding variable name- Returns:
- this instance for method chaining
- See Also:
ScriptItemProcessor.setItemBindingVariableName(String)
build
public ScriptItemProcessor<I,O> build()
Returns a fully constructedScriptItemProcessor
.- Returns:
- a new
ScriptItemProcessor