Class ScriptItemProcessorBuilder<I,O>
java.lang.Object
org.springframework.batch.item.support.builder.ScriptItemProcessorBuilder<I,O>
Creates a fully qualified ScriptItemProcessor.
- Since:
- 4.0
- Author:
- Glenn Renfro
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a fully constructedScriptItemProcessor.itemBindingVariableName(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_NAMEis not suitable ("item").Establishes the language of the script.scriptResource(org.springframework.core.io.Resource resource) Sets theResourcelocation of the script to use.scriptSource(String scriptSource) Sets the providedStringas the script source code to use.
-
Constructor Details
-
ScriptItemProcessorBuilder
public ScriptItemProcessorBuilder()
-
-
Method Details
-
scriptResource
public ScriptItemProcessorBuilder<I,O> scriptResource(org.springframework.core.io.Resource resource) Sets theResourcelocation of the script to use. The script language will be deduced from the filename extension.- Parameters:
resource- theResourcelocation of the script to use.- Returns:
- this instance for method chaining
- See Also:
-
language
Establishes the language of the script.- Parameters:
language- the language of the script.- Returns:
- this instance for method chaining
- See Also:
-
scriptSource
Sets the providedStringas the script source code to use. Language must not be null nor empty when using script.- Parameters:
scriptSource- theStringform of the script source code to use.- Returns:
- this instance for method chaining
- See Also:
-
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_NAMEis not suitable ("item").- Parameters:
itemBindingVariableName- the desired binding variable name- Returns:
- this instance for method chaining
- See Also:
-
build
Returns a fully constructedScriptItemProcessor.- Returns:
- a new
ScriptItemProcessor
-