Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <request>
- <model> text </model>
- <file name = aFileName> file contents</file>
- </request>
- import javax.xml.bind.annotation.XmlAccessType;
- import javax.xml.bind.annotation.XmlAccessorType;
- import javax.xml.bind.annotation.XmlElement;
- import javax.xml.bind.annotation.XmlRootElement;
- import javax.xml.bind.annotation.XmlType;
- import org.eclipse.persistence.oxm.annotations.XmlPath;
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(propOrder = { "model", "file",})
- @XmlRootElement(name = "request")
- public class RequestMsg implements Serializable {
- private static final long serialVersionUID = -5003915336631618163L;
- @XmlElement()
- private String model;
- private ElemWithAttr file;
- @XmlPath("file/@myAttr")
- private String myAttr;
- // CLASS GETTERS & SETTERS
- public ElemWithAttr getFile(){
- return file;
- }
- public String getModel() {
- return model;
- }
- public void setFile(ElemWithAttr file) {
- this.file = file;
- }
- public void setModel(String model) {
- this.model = model;
- }
- }
- import javax.xml.bind.annotation.XmlAttribute;
- import javax.xml.bind.annotation.XmlValue;
- public class ElemWithAttr {
- @XmlValue
- public String content;
- @XmlAttribute
- public String myAttr;
- // CLASS GETTERS & SETTERS
- public String getContent() {
- return content;
- }
- public String getMyAttr() {
- return myAttr;
- }
- public void setContent(String audioString) {
- this.content = audioString;
- }
- public void setMyAttr(String myAttr) {
- this.myAttr = myAttr;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement