Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <request>
  2. <model> text </model>
  3. <file name = aFileName> file contents</file>
  4. </request>
  5.  
  6. import javax.xml.bind.annotation.XmlAccessType;
  7. import javax.xml.bind.annotation.XmlAccessorType;
  8. import javax.xml.bind.annotation.XmlElement;
  9. import javax.xml.bind.annotation.XmlRootElement;
  10. import javax.xml.bind.annotation.XmlType;
  11. import org.eclipse.persistence.oxm.annotations.XmlPath;
  12.  
  13. @XmlAccessorType(XmlAccessType.FIELD)
  14. @XmlType(propOrder = { "model", "file",})
  15. @XmlRootElement(name = "request")
  16.  
  17. public class RequestMsg implements Serializable {
  18. private static final long serialVersionUID = -5003915336631618163L;
  19.  
  20. @XmlElement()
  21. private String model;
  22.  
  23. private ElemWithAttr file;
  24.  
  25. @XmlPath("file/@myAttr")
  26. private String myAttr;
  27.  
  28. // CLASS GETTERS & SETTERS
  29. public ElemWithAttr getFile(){
  30. return file;
  31. }
  32.  
  33. public String getModel() {
  34. return model;
  35. }
  36.  
  37. public void setFile(ElemWithAttr file) {
  38. this.file = file;
  39. }
  40.  
  41. public void setModel(String model) {
  42. this.model = model;
  43. }
  44. }
  45.  
  46. import javax.xml.bind.annotation.XmlAttribute;
  47. import javax.xml.bind.annotation.XmlValue;
  48.  
  49.  
  50. public class ElemWithAttr {
  51.  
  52. @XmlValue
  53. public String content;
  54.  
  55. @XmlAttribute
  56. public String myAttr;
  57.  
  58.  
  59. // CLASS GETTERS & SETTERS
  60. public String getContent() {
  61. return content;
  62. }
  63.  
  64. public String getMyAttr() {
  65. return myAttr;
  66. }
  67.  
  68. public void setContent(String audioString) {
  69. this.content = audioString;
  70. }
  71.  
  72. public void setMyAttr(String myAttr) {
  73. this.myAttr = myAttr;
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement