Hi!
I have a structure that outputs this:
I use @JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=As.PROPERTY,
property="type") on the common base class.
How could I get the following output:
It does not matter, if it can not be deserialized by Jackson, it is
What is the POJO you are serializing?
-+ Tatu +-
On Mon, Mar 20, 2017 at 5:11 AM, Zsolt Balanyi wrote:
> Hi!
>
> I have a structure that outputs this:
>
>
>
>
>
>
>
>
> I use @JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=As.PROPERTY,
> property="type") on the common base cla
Hi!
public class Page {
public UIElement uiElement;
}
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include =
JsonTypeInfo.As.PROPERTY, property = "type")
public abstract class UIElement {
}
public class StackLayout extends UIElement {
public List uiElements = new ArrayList<>();
}
publi
Have you tried choice of `JsonTypeInfo.As.WRAPPER_OBJECT`?
That does add type id as property-name "wrapper" in JSON, and should
work quite similarly with XML.
The main problem with XML is often, however, that the root value
requires additional extra XML element.
-+ Tatu +-
On Mon, Mar 20, 2017 at
Hi!
That was one of my first attempts :)
The question is how could I ommit the uiElement nodes?
BR, Zsolt
2017. március 20., hétfő 20:16:38 UTC+1 időpontban Tatu Saloranta a
következőt írta:
>
> Have you tried choice of `JsonType
On Tue, Mar 21, 2017 at 12:16 AM, Zsolt Balanyi wrote:
> Hi!
>
> That was one of my first attempts :)
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> The question is how could I ommit the uiElement nodes?
itself matches property `uiElement` so that c
Hi!
The tag name can be easily renamed, by
if (gen instanceof ToXmlGenerator) {
((ToXmlGenerator)gen).setNextName(new
QName(bean.getClass().getSimpleName()));
}
doNormalSerialization();
The only problem is, that I need to serialize all other fields, which I
On Wed, Mar 22, 2017 at 1:31 AM, Zsolt Balanyi wrote:
> Hi!
>
> The tag name can be easily renamed, by
>
> if (gen instanceof ToXmlGenerator) {
> ((ToXmlGenerator)gen).setNextName(new
> QName(bean.getClass().getSimpleName()));
> }
> doNormalSerialization();
Yes
Hi!
Of course my code is related to XML:
ObjectMapper om = new XmlMapper();
om.enable(SerializationFeature.INDENT_OUTPUT);
om.registerModule(new JacksonXmlModule() {
@Override
public void setupModule(SetupContext context) {
super.set
On Wed, Mar 22, 2017 at 10:24 PM, Zsolt Balanyi wrote:
> Hi!
>
> Of course my code is related to XML:
Right, I just meant it regarding general data-binding functionality.
Your code can certainly use its knowledge as necessary.
>
> ObjectMapper om = new XmlMapper();
> om.enable(Se
Hi!
Unfortunately none of the approaches worked... XmlBeanSerializerModifier
has a bug, and does not use the provided modifier, even if I override the
method you mentioned.
Could you help me where to report the bug?
Also where can I find some resources on the architecture of the Jackson
project
On Thu, Mar 23, 2017 at 11:34 AM, Zsolt Balanyi wrote:
> Hi!
>
> Unfortunately none of the approaches worked... XmlBeanSerializerModifier has
> a bug, and does not use the provided modifier, even if I override the method
> you mentioned.
> Could you help me where to report the bug?
If you can rep
Hi Tatu!
After long investigation I found out that the order of operations
in JacksonXmlModule.setupModule matters:
public void setupModule(SetupContext context) {
context.addBeanSerializerModifier(new
UIElementSerializerModifier());
super.setupModule
On Sat, Mar 25, 2017 at 6:07 AM, Zsolt Balanyi wrote:
> Hi Tatu!
>
> After long investigation I found out that the order of operations in
> JacksonXmlModule.setupModule matters:
>
> public void setupModule(SetupContext context) {
> context.addBeanSerializerModifier(new
14 matches
Mail list logo