From 246cd6a6b226191717b64ef8eac7cc37403c33f6 Mon Sep 17 00:00:00 2001 From: Neta Cohen Date: Wed, 4 Aug 2021 16:47:09 +0300 Subject: [PATCH] mustache: supporting java XmlSeeAlso annotation --- .../resources/handlebars/Java/xmlAnnotation.mustache | 7 +++++++ .../handlebars/JavaMicronaut/xmlAnnotation.mustache | 9 ++++++++- .../handlebars/JavaSpring/xmlAnnotation.mustache | 9 ++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/main/resources/handlebars/Java/xmlAnnotation.mustache b/src/main/resources/handlebars/Java/xmlAnnotation.mustache index ead6219b13..34ebc70994 100644 --- a/src/main/resources/handlebars/Java/xmlAnnotation.mustache +++ b/src/main/resources/handlebars/Java/xmlAnnotation.mustache @@ -1,4 +1,11 @@ {{#withXml}} @XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") @XmlAccessorType(XmlAccessType.FIELD) +{{#discriminator}} +@XmlSeeAlso({ + {{#children}} + {{classname}}.class, + {{/children}} +}) +{{/discriminator}} {{#jackson}}@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}"){{/jackson}}{{/withXml}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaMicronaut/xmlAnnotation.mustache b/src/main/resources/handlebars/JavaMicronaut/xmlAnnotation.mustache index fd81a4cf5d..dee14d2c8d 100644 --- a/src/main/resources/handlebars/JavaMicronaut/xmlAnnotation.mustache +++ b/src/main/resources/handlebars/JavaMicronaut/xmlAnnotation.mustache @@ -3,4 +3,11 @@ @JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") {{/jackson}} @XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") -@XmlAccessorType(XmlAccessType.FIELD){{/withXml}} \ No newline at end of file +@XmlAccessorType(XmlAccessType.FIELD) +{{#discriminator}} +@XmlSeeAlso({ + {{#children}} + {{classname}}.class, + {{/children}} +}) +{{/discriminator}}{{/withXml}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaSpring/xmlAnnotation.mustache b/src/main/resources/handlebars/JavaSpring/xmlAnnotation.mustache index fd81a4cf5d..dee14d2c8d 100644 --- a/src/main/resources/handlebars/JavaSpring/xmlAnnotation.mustache +++ b/src/main/resources/handlebars/JavaSpring/xmlAnnotation.mustache @@ -3,4 +3,11 @@ @JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") {{/jackson}} @XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") -@XmlAccessorType(XmlAccessType.FIELD){{/withXml}} \ No newline at end of file +@XmlAccessorType(XmlAccessType.FIELD) +{{#discriminator}} +@XmlSeeAlso({ + {{#children}} + {{classname}}.class, + {{/children}} +}) +{{/discriminator}}{{/withXml}} \ No newline at end of file