Hello, I am trying to flatten the xml output of xstream using a converter/marshaling with no luck. For example,
public class A{
public B b;
public int F;
public String G;
}
public class B{
public String C;
public String D;
public int E;
}
is output as
<A>
<B>
<C></C>
<D></D>
<E></E>
</B>
<F></F>
<G></G>
</A>
but I need
<A>
<C></C>
<D></D>
<E></E>
<F></F>
<G></G>
</A>
is this possible? How to get rid of B? (C, D, E are uniquely named). Thanks. My attempt thus far has been
...
public void marshal(Object value, HierarchicalStreamWriter writer,
MarshallingContext context)
{
B b = (B) value;
writer.startNode("C");
writer.setValue(b.getC());
writer.endNode();
writer.startNode("D");
writer.setValue(b.getD());
writer.endNode();
writer.startNode("E");
writer.setValue(b.getE());
writer.endNode();
}