Results 1 to 4 of 4

Thread: StaxEventItemWriter using useAttributeFor

  1. #1
    Join Date
    Jun 2008
    Posts
    1

    Default StaxEventItemWriter using useAttributeFor

    Hello,

    I want to make a batch that use a bean org.springframework.batch.item.xml.StaxEventItemWr iter; in the class XStreamMarshaller 'useAttributesFor' property takes either a <String, Class> map or a <Class, String> map,
    and in my config file I don't be able to make a <String, Class> !!!

    Do you have any examples of using useAttributeFor on XStreamMarshaller ?


    This example of code :
    <util:map id="aliases">
    <entry key="trade" value="org.springframework.batch.sample.domain.Tra de" />
    </util:map>

    => return <String,String>


    An other possibility is to use annotation "XStreamAsAttribute" but it seems to me that the annotation not be applied.


    Thanks in advance
    Steph

  2. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    This is really more of a question about Spring OXM than Spring Batch. XStreamMarshaller is just delegated to by the stax writer. You may want to try posting this question in the Spring Web Services forum (oxm spun off of spring WS)

  3. #3
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    It's actually more of a question for the Spring Framework forum. I believe you can change the value-type in the map using an attribute in the <map> element.

  4. #4
    Join Date
    Jul 2005
    Posts
    156

    Arrow

    Didn't knew about this feature, I've tested it and it works with the following spring configuration (returns Map<String,Class>) :
    Code:
    <util:map id="sampleMap">
      <entry key="key1">
        <value type="java.lang.Class">java.lang.Integer</value>
      </entry>
    </util:map>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •