How to set 'MODE' in <dataformat> with Bluprint DSL ?

Solution Verified - Updated -

Issue

<dataFormats>
   <xstream driverRef="jsonDriver" encoding="UTF-8" id="jsonConverter" mode="NO_REFERENCES"></xstream>
</dataFormats>

  • The 'Mode' can be set with Java DSL as below,
public void setMode(String mode) {
                if ("NO_REFERENCES".equalsIgnoreCase(mode)) {
                        this.mode = XStream.NO_REFERENCES;
                } else if ("ID_REFERENCES".equalsIgnoreCase(mode)) {
                        this.mode = XStream.ID_REFERENCES;
                } else if ("XPATH_RELATIVE_REFERENCES".equalsIgnoreCase(mode)) {
                        this.mode = XStream.XPATH_RELATIVE_REFERENCES;
                } else if ("XPATH_ABSOLUTE_REFERENCES".equalsIgnoreCase(mode)) {
                        this.mode = XStream.XPATH_ABSOLUTE_REFERENCES;
                } else if ("SINGLE_NODE_XPATH_RELATIVE_REFERENCES".equalsIgnoreCase(mode)) {
                        this.mode = XStream.SINGLE_NODE_XPATH_RELATIVE_REFERENCES;
                } else if ("SINGLE_NODE_XPATH_ABSOLUTE_REFERENCES".equalsIgnoreCase(mode)) {
                        this.mode = XStream.SINGLE_NODE_XPATH_ABSOLUTE_REFERENCES;
                }
        }
  • But with blueprint, there no 'Mode' parameter called as in the Java DSL using the camel-xstream component,
<bean id="jsonDriver"
class="com.redhat.sample.xstream.io.json.JsonHierarchicalStreamDriver"></bean>

<camelContext id="camel" xmlns=";;
  <dataFormats>
    <xstream id="xstream" driverRef="jsonDriver"></xstream>            
  </dataFormats>

  <route>
    <from uri="direct:start"></from>
    <marshal ref="xstream"></marshal>
    <to uri="mock:result"></to>
    </route>
</camelContext>

Environment

  • Red Hat JBoss Fuse
    • 6.x
  • Apache Camel
  • Apache Aries Blueprint

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.