How can I build from this model xml as below?
@Root
class Vertex {
@Attribute(name = "id")
private String _id;
@Element(name = "x")
private Expression _x;
@Element(name = "y")
private Expression _y;
}
@Root
class Expression {
@Element(name = "param", type = ParamReference.class, required = false)
private ParamReferenceInterface _value;
@Element(name = "sum", type = Sum.class, required = false)
private SumInterface _sumValue;
@Element(name = "fixed", type = FixedValue.class, required = false)
private FixedValue _fixedValue;
}
<vertex id="someId">
<x>
<fixed>0.0</fixed>
</x>
<y>
<sum>
<param name="startPostion"/>
<param name="height"/>
<sum>
</y>
</vertex>
Now I have XML like this:
<vertex id="someId">
<x>
<expression>
<fixed>
<fixed>0.0</fixed>
</fixed>
</expression>
</x>
<y>
<sum>
<expression>
<param name="startPostion"/>
</expression>
<expression>
<param name="height"/>
</expression>
</sum>
</y>
</vertex>
It contains excess tags. I tried used Converter, I remove all annotations from Expression.class and I create ExpressionConverter, but I can't deal how write/read List values.
How can I hide 'expression' tags?
No comments:
Post a Comment