XPath Header Enricher

XPath 标头丰富器定义了一个标头丰富器消息转换器,该转换器针对消息有效负载评估 XPath 表达式,并将评估结果插入到消息标头中。

The XPath header enricher defines a header enricher message transformer that evaluates an XPath expression against the message payload and inserts the result of the evaluation into a message header.

以下列表显示了所有可用的配置参数:

The following listing shows all the available configuration parameters:

<int-xml:xpath-header-enricher default-overwrite="true"    1
                               id=""                       2
                               input-channel=""            3
                               output-channel=""           4
                               should-skip-nulls="true">   5
    <int:poller></int:poller>                              6
    <int-xml:header name=""                                7
                    evaluation-type="STRING_RESULT"        8
                    header-type="int"                      9
                    overwrite="true"                       10
                    xpath-expression=""                    11
                    xpath-expression-ref=""/>              12
</int-xml:xpath-header-enricher>
1 指定用于覆盖现有标头值的默认布尔值。此值仅对不提供其自己的“覆盖”属性的子元素生效。如果您未设置“default-over write”属性,指定的标头值不会覆盖具有相同标头名称的任何现有值。可选。
2 Specifies the default boolean value for whether to overwrite existing header values. It takes effect only for child elements that do not provide their own 'overwrite' attribute. If you do not set the 'default- overwrite' attribute, the specified header values do not overwrite any existing ones with the same header names. Optional.
3 基础 Bean 定义的 ID。可选。
4 ID for the underlying bean definition. Optional.
5 此端点的接收消息频道。可选。
6 The receiving message channel of this endpoint. Optional.
7 发送已补充消息的信道。可选。
8 Channel to which enriched messages are sent. Optional.
9 指定是否应该跳过空值(例如,表达式评估可能返回的空值)。默认值为 true。如果空值应触发删除相应的标头,请将其设置为 false。可选。
10 Specifies whether null values, such as might be returned from an expression evaluation, should be skipped. The default value is true. If a null value should trigger removal of the corresponding header, set this to false. Optional.
11 与标头填充器一同使用轮询器。可选。
12 A poller to use with the header enricher. Optional.
13 要填充的标头的名称。强制性。
14 The name of the header to be enriched. Mandatory.
15 XPath 评估预期的结果类型。如果您未设置 header-type 属性,则此类型为标头值类型。允许以下值: BOOLEAN_RESULTSTRING_RESULTNUMBER_RESULTNODE_RESULT`和 `NODE_LIST_RESULT。如果未设置,则在内部默认为 XPathEvaluationType.STRING_RESULT。可选。
16 The result type expected from the XPath evaluation. If you did not set a header-type attribute, this is the type of the header value. The following values are allowed: BOOLEAN_RESULT, STRING_RESULT, NUMBER_RESULT, NODE_RESULT, and NODE_LIST_RESULT. If not set, it defaults internally to XPathEvaluationType.STRING_RESULT. Optional.
17 标头值类型的完全限定类名称。XPath 评估结果由此 ConversionService 转换为此类型。例如,这可以使 NUMBER_RESULT(双精度)转换为 Integer。该类型可声明为基本类型(例如 int),但结果始终是等效的包装类(例如 Integer)。在 Payload Type Conversion 中讨论的相同集成 ConversionService 用于转换,因此通过向服务添加自定义转换器,支持转换为自定义类型。可选。
18 The fully qualified class name for the header value type. The result of the XPath evaluation is converted to this type by ConversionService. This allows, for example, a NUMBER_RESULT (a double) to be converted to an Integer. The type can be declared as a primitive (such as int), but the result is always the equivalent wrapper class (such as Integer). The same integration ConversionService discussed in Payload Type Conversion is used for the conversion, so conversion to custom types is supported by adding a custom converter to the service. Optional.
19 布尔值,指示该标头值是否应覆盖输入 Message 上已存在的相同名称的现有标头值。
20 Boolean value to indicate whether this header value should overwrite an existing header value for the same name if already present on the input Message.
21 作为 String 的 XPath 表达式。您必须设置此属性或 xpath-expression-ref,但不能同时设置。
22 The XPath expression as a String. You must set either this attribute or xpath-expression-ref, but not both.
23 XPath 表达式引用。您必须设置此属性或 xpath-expression,但不能同时设置。
24 The XPath expression reference. You must set either this attribute or xpath-expression, but not both.