[JIRA] Closed: (JAXB-981) Customize default local name for XML element, type and property

  • From: "Iaroslav Savytskyi (JIRA)" <jira-no-reply@...>
  • To: issues@...
  • Subject: [JIRA] Closed: (JAXB-981) Customize default local name for XML element, type and property
  • Date: Thu, 10 Oct 2013 07:56:28 +0000 (UTC)
  • Auto-submitted: auto-generated


     [ 
https://java.net/jira/browse/JAXB-981?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Iaroslav Savytskyi closed JAXB-981.
-----------------------------------

    Resolution: Invalid

It's possible to customize mapping names with "name" attribute of annotations.
e.g. @XmlRootElement (name="CALCULATOR_INPUT")
Fields can be annotated as @XmlElement(name="LeftOperand")

> Customize default local name for XML element, type and property
> ---------------------------------------------------------------
>
>                 Key: JAXB-981
>                 URL: https://java.net/jira/browse/JAXB-981
>             Project: jaxb
>          Issue Type: Improvement
>    Affects Versions: 2.2.7
>            Reporter: Przemyslaw Bielicki
>            Assignee: Iaroslav Savytskyi
>
> The following class:
> {code:title=CalculatorInput.java|borderStyle=solid}
> @XmlRootElement
> public class CalculatorInput {
>   BigDecimal leftOperand;
>   BigDecimal rightOperand;
>   Operation operation;
>   // setters and getters omitted for brevity
> {code}
> will be serialized by JAXB to the following XML:
> {code:title=CalculatorInput.xml|borderStyle=solid}
> <calculatorInput>
> <operation>MULTIPLY</operation>
> <leftOperand>150</leftOperand>
> <rightOperand>7</rightOperand>
> </calculatorInput>
> {code}
> It is desirable to change the default element, type and property naming 
> convention by the user e.g. one would like to have one of the following 
> outputs (without touching {{CalculatorInput.java}}):
> {code:title=CalculatorInput.xml|borderStyle=solid}
> <CALCULATOR_INPUT>
> <OPERATION>MULTIPLY</OPERATION>
> <LEFT_OPERAND>150</LEFT_OPERAND>
> <RIGHT_OPERAND>7</RIGHT_OPERAND>
> </CALCULATOR_INPUT>
> {code}
> or
> {code:title=CalculatorInput.xml|borderStyle=solid}
> <CalculatorInput>
> <Operation>MULTIPLY</Operation>
> <LeftOperand>150</LeftOperand>
> <RightOperand>7</RightOperand>
> </CalculatorInput>
> {code}
> At this moment JAXB does not allow to customize default behavior to obtain 
> results above.
> The same problem applies when you annotate your class as {{@XmlType}}.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[JIRA] Created: (JAXB-981) Customize default local name for XML element, type and property

Przemyslaw Bielicki (JIRA) 10/10/2013

[JIRA] Commented: (JAXB-981) Customize default local name for XML element, type and property

Przemyslaw Bielicki (JIRA) 10/10/2013

[JIRA] Closed: (JAXB-981) Customize default local name for XML element, type and property

Iaroslav Savytskyi (JIRA) 10/10/2013

[JIRA] Commented: (JAXB-981) Customize default local name for XML element, type and property

laune (JIRA) 10/10/2013

[JIRA] Commented: (JAXB-981) Customize default local name for XML element, type and property

Przemyslaw Bielicki (JIRA) 10/10/2013

[JIRA] Commented: (JAXB-981) Customize default local name for XML element, type and property

Przemyslaw Bielicki (JIRA) 10/10/2013

[JIRA] Commented: (JAXB-981) Customize default local name for XML element, type and property

Przemyslaw Bielicki (JIRA) 10/10/2013

[JIRA] Reopened: (JAXB-981) Customize default local name for XML element, type and property

Iaroslav Savytskyi (JIRA) 10/10/2013
Terms of Use; Privacy Policy; Copyright ©2013-2015 (revision 20150626.29986a4)
 
 
Close
loading
Please Confirm
Close