1 16 package org.apache.commons.jxpath; 17 18 import java.util.ArrayList ; 19 import java.util.Collections ; 20 import java.util.HashMap ; 21 import java.util.List ; 22 import java.util.Map ; 23 24 import org.apache.commons.jxpath.xml.DocumentContainer; 25 import org.w3c.dom.Document ; 26 import org.w3c.dom.Element ; 27 28 34 public class TestMixedModelBean { 35 private String string; 36 private TestBean bean; 37 private Container container; 38 private Document document; 39 private Element element; 40 41 private Map map; 42 43 private List list; 44 private int[][] matrix; 45 46 public TestMixedModelBean() { 47 string = "string"; 48 bean = new TestBean(); 49 map = new HashMap (); 50 list = new ArrayList (); 51 52 container = new DocumentContainer(getClass().getResource("Vendor.xml")); 53 document = (Document ) container.getValue(); 54 element = document.getDocumentElement(); 55 56 map.put("string", string); 57 map.put("bean", bean); 58 map.put("map", map); 59 map.put("list", list); 60 map.put("document", document); 61 map.put("element", element); 62 map.put("container", container); 63 64 list.add(string); 65 list.add(bean); 66 list.add(map); 67 list.add(new ArrayList (Collections.singletonList("string2"))); 68 list.add(document); 69 list.add(element); 70 list.add(container); 71 72 matrix = new int[1][]; 73 matrix[0] = new int[1]; 74 matrix[0][0] = 3; 75 } 76 77 public String getString() { 78 return string; 79 } 80 81 public TestBean getBean() { 82 return bean; 83 } 84 85 public Map getMap() { 86 return map; 87 } 88 89 public List getList() { 90 return list; 91 } 92 93 public Document getDocument() { 94 return document; 95 } 96 97 public Element getElement() { 98 return element; 99 } 100 101 public Container getContainer() { 102 return container; 103 } 104 105 public int[][] getMatrix() { 106 return matrix; 107 } 108 109 public void setMatrix(int[][] matrix) { 110 this.matrix = matrix; 111 } 112 } 113 | Popular Tags |