Guest User

Untitled

a guest
Feb 21st, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. @XmlRootElement(name = "ApplicatorUnits")
  2. @XmlAccessorType(XmlAccessType.FIELD)
  3. public class EHDTOApplicatorUnits
  4. {
  5. @XmlElement(name = "UnitGroup")
  6. private List<EHDTOUnitGroup> ehdtoUnitGroups;
  7.  
  8. public List<EHDTOUnitGroup> getEhdtoUnitGroups()
  9. {
  10. return ehdtoUnitGroups;
  11. }
  12.  
  13. public void setEhdtoUnitGroups(List<EHDTOUnitGroup> ehdtoUnitGroups)
  14. {
  15. this.ehdtoUnitGroups = ehdtoUnitGroups;
  16. }
  17. }
  18.  
  19. @XmlRootElement(name = "UnitGroup")
  20. @XmlAccessorType(XmlAccessType.FIELD)
  21. public class EHDTOUnitGroup
  22. {
  23. @XmlAttribute(name = "name")
  24. private String name;
  25.  
  26. @XmlElement(name = "unit")
  27. private List<EHDTOUnit> ehdtoUnits;
  28.  
  29. public String getName()
  30. {
  31. return name;
  32. }
  33.  
  34. public void setName(String name)
  35. {
  36. this.name = name;
  37. }
  38.  
  39. public List<EHDTOUnit> getEhdtoUnits()
  40. {
  41. return ehdtoUnits;
  42. }
  43.  
  44. public void setEhdtoUnits(List<EHDTOUnit> ehdtoUnits)
  45. {
  46. this.ehdtoUnits = ehdtoUnits;
  47. }
  48. }
  49.  
  50. JaxbAnnotationModule jaxbAnnotationModule = new JaxbAnnotationModule();
  51. jaxbAnnotationModule.setPriority(Priority.PRIMARY);
  52. mapper.registerModule(jaxbAnnotationModule);
  53. /*AnnotationIntrospector primary = new JacksonAnnotationIntrospector();
  54. AnnotationIntrospector secondary = new XmlJaxbAnnotationIntrospector(mapper.getTypeFactory()); //new JaxbAnnotationIntrospector(mapper.getTypeFactory());
  55. AnnotationIntrospector pair = new AnnotationIntrospectorPair(primary,secondary);
  56. mapper.setAnnotationIntrospector(pair);*/
  57.  
  58. <?xml version="1.0"?>
  59. <EHDTOApplicatorUnits>
  60. <UnitGroup>
  61. <name>string</name>
  62. <unit>
  63. <id>1</id>
  64. <name>string</name>
  65. <unitSystem>string</unitSystem>
  66. </unit>
  67. </UnitGroup>
  68. </EHDTOApplicatorUnits>
  69.  
  70. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  71. <ApplicatorUnits>
  72. <UnitGroup name="coefTempErrorSpan">
  73. <unit>
  74. <id>1</id>
  75. <name>% span /10K</name>
  76. <unitSystem>SI</unitSystem>
  77. </unit>
  78. <unit>
  79. <id>2</id>
  80. <name>% span /50F</name>
  81. <unitSystem>SI</unitSystem>
  82. </unit>
  83. </UnitGroup>
  84. ...
  85. </ApplicatorUnits>
Add Comment
Please, Sign In to add comment