类 ScriptItemProcessor<I,​O>

    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      voidafterPropertiesSet() 
      Oprocess​(I item)
      Process the provided item, returning a potentially modified or new item for continued processing.
      voidsetItemBindingVariableName​(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: ITEM_BINDING_VARIABLE_NAME is not suitable ("item").
      voidsetScript​(org.springframework.core.io.Resource resource)
      Sets the Resource location of the script to use.
      voidsetScriptEvaluator​(org.springframework.scripting.ScriptEvaluator scriptEvaluator)
      Provides the ability to set a custom ScriptEvaluator implementation.
      voidsetScriptSource​(java.lang.String scriptSource, java.lang.String language)
      Sets the provided String as the script source code to use.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • process

        public O process​(I item)
                  throws java.lang.Exception
        从接口复制的说明: ItemProcessor
        Process the provided item, returning a potentially modified or new item for continued processing. If the returned result is null, it is assumed that processing of the item should not continue.
        指定者:
        process 在接口中 ItemProcessor<I,​O>
        参数:
        item - to be processed
        返回:
        potentially modified or new item for continued processing, null if processing of the provided item should not continue.
        抛出:
        java.lang.Exception - thrown if exception occurs during processing.
      • setScript

        public void setScript​(org.springframework.core.io.Resource resource)

        Sets the Resource location of the script to use. The script language will be deduced from the filename extension.

        参数:
        resource - the Resource location of the script to use.
      • setScriptSource

        public void setScriptSource​(java.lang.String scriptSource,
                                    java.lang.String language)

        Sets the provided String as the script source code to use.

        参数:
        scriptSource - the String form of the script source code to use.
        language - the language of the script.
      • setItemBindingVariableName

        public void setItemBindingVariableName​(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: ITEM_BINDING_VARIABLE_NAME is not suitable ("item").

        参数:
        itemBindingVariableName - the desired binding variable name
      • setScriptEvaluator

        public void setScriptEvaluator​(org.springframework.scripting.ScriptEvaluator scriptEvaluator)

        Provides the ability to set a custom ScriptEvaluator implementation. If not set, a StandardScriptEvaluator will be used by default.

        参数:
        scriptEvaluator - the ScriptEvaluator to use
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        指定者:
        afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean
        抛出:
        java.lang.Exception