BeanFilter

使用BeanFilter来处理JavaBean类型。etag代表JavaBean属性,value为对应值。

连接配置

在bin\cfg\etc\commons.xml文件中完成配置

<filter id="beanFilter" class="BeanFilter"/><!-- SQL执行类 -->

组装JavaBean报文

<root>
    <interface id="demo"
        basePackage="com.brilliance.eibs.core.service.instance.impl" version="1">
        <transaction id="4">
            <step id="handle">
                <filter ref="beanFilter" type="out">
                    <field etag="tag" type="String" value="abc" />
                    <field etag="value" type="String" value="def" />
                </filter>
            </step>
        </transaction>
    </interface>
    <filters>
        <filter id="beanFilter" class="BeanFilter">
            <parameter name="classname"
                value="com.brilliance.eibs.core.model.impl.FieldDef" /> <!-- JavaBean类型 -->
        </filter>
    </filters>
</root>

控制台打印结果如下:

image-20221024164821867

解析JavaBean报文

<root>
    <interface id="demo"
        basePackage="com.brilliance.eibs.core.service.instance.impl" version="1">
        <transaction id="5">
            <step id="handle">
                <filter ref="beanFilter" type="in">
                    <field tag="tag" type="String" value="${this.tag}" />
                    <field tag="value" type="String" value="${this.value}" />
                </filter>
            </step>
        </transaction>
    </interface>
    <filters>
        <filter id="beanFilter" class="BeanFilter">
            <parameter name="classname"
                value="com.brilliance.eibs.core.model.impl.FieldDef" /><!-- JavaBean类型 -->
        </filter>
    </filters>
</root>

results matching ""

    No results matching ""