How to set 'MODE' in <dataformat> with Bluprint DSL ?
Issue
- We cant see how its possible to set the 'Mode' on xStream via the blueprint/java DSL. If it is, can you point me in the right direction ?
-
If not, is it possible for this to be added ?
i.e.: new property on:
https://github.com/apache/camel/blob/master/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java -
So we can do:
<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, tools, and much more.