1 17 18 package org.apache.commons.digester.xmlrules; 19 20 21 import java.util.ArrayList ; 22 import java.util.HashMap ; 23 import java.util.Iterator ; 24 25 26 33 public class TestObject { 34 35 private ArrayList children = new ArrayList (); 36 private String value = ""; 37 private Long longValue = new Long (-1L); 38 39 private String property = ""; 40 41 private HashMap mapValue = new HashMap (); 42 43 private boolean pushed = false; 44 45 public TestObject() { 46 } 47 48 private static int idx = 0; 49 50 public String toString() { 51 String str = value; 52 for (Iterator i = children.iterator(); i.hasNext();) { 53 str += " " + i.next(); 54 } 55 return str; 56 } 57 58 public void add(Object o) { 59 children.add(o); 60 } 61 62 public void setValue(String val) { 63 value = val; 64 } 65 66 public void setLongValue(Long val) { 67 longValue = val; 68 } 69 70 public Long getLongValue() { 71 return longValue; 72 } 73 74 public void setStringValue(String val) { 75 } 76 77 public boolean isPushed() { 78 return pushed; 79 } 80 81 public void push() { 82 pushed = true; 83 } 84 85 public void setMapValue( String name, String value ) { 86 this.mapValue.put( name, value ); 87 } 88 89 public String getMapValue( String name ) { 90 return (String ) this.mapValue.get( name ); 91 } 92 93 public String getProperty() { 94 return property; 95 } 96 97 public void setProperty(String pProperty) { 98 property = pProperty; 99 } 100 } 101 | Popular Tags |