1 package org.opendaylight.controller.northbound.commons.query;
3 import java.util.ArrayList;
6 import javax.xml.bind.annotation.XmlElement;
7 import javax.xml.bind.annotation.XmlElementWrapper;
8 import javax.xml.bind.annotation.XmlRootElement;
10 import org.opendaylight.controller.northbound.commons.types.StringList;
15 @XmlRootElement(name="book")
16 public class BookBean {
18 @XmlElement(name="name")
19 private String _name; // simple type
21 private String _isbn; // method annotation
23 @XmlElement(name="author")
24 private PersonBean _author; // composite type
26 @XmlElementWrapper//for XMLWrapper iterative composite types
27 @XmlElement(name="review")
28 private final List<ReviewBean> reviews = new ArrayList<ReviewBean>();
31 private List<String> soldBy; //Iterative Type
33 @XmlElementWrapper(name="test")
35 private final List<StringList> testList = new ArrayList<StringList>(); //XMLWrapper list of list
37 @XmlElementWrapper(name="parent")
38 @XmlElement(name="child")
39 private final List<WrapperList> wrapperList = new ArrayList<WrapperList>(); // XMLWrapper of XMLWrapper
43 public BookBean(String name, String id, PersonBean person) {
47 soldBy = new ArrayList<String>();
50 public BookBean addReview(ReviewBean review) {
55 public void setSellerInfo(List<String> sellers) {
56 soldBy = new ArrayList<String>(sellers);
59 public void addWrapperList(WrapperList list){
60 wrapperList.add(list);
63 public void addToTestList(StringList testList){
64 this.testList.add(testList);
66 public String getName() {
70 @XmlElement(name="isbn")
71 public String get_isbn() {
75 public PersonBean getauthor() {
80 public String toString() {
81 return "BookBean [_name=" + _name + ", _isbn=" + _isbn + ", _author="
82 + _author + ", reviews=" + reviews + ", soldBy=" + soldBy
83 + ", testList=" + testList + ", wrapperList=" + wrapperList + "]";
89 @XmlElementWrapper(name="items")
91 public List<String> item = new ArrayList<String>();