-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Using HyphenStyle overrides any name specified in the @Element annotation.
Example
@Root(name = "test")
public class Test {
@Element
public String backgroundColor;
@Element(name = "color1")
public String color1;
public static void main(String[] arg) throws Exception {
Test t = new Test();
t.backgroundColor = "#001122";
t.color1 = "#334455";
Style style = new HyphenStyle();
Format format = new Format(style);
Persister serializer = new Persister(format);
serializer.write(t, System.out);
}
}
Produces:
<test>
<background-color>#001122</background-color>
<color-1>#334455</color-1>
</test>
Desired output:
<test>
<background-color>#001122</background-color>
<color1>#334455</color1>
</test>
Metadata
Metadata
Assignees
Labels
No labels