1 2 17 package org.apache.commons.betwixt.digester; 18 19 import java.util.ArrayList ; 20 import java.util.List ; 21 22 import org.apache.commons.logging.Log; 23 import org.apache.commons.logging.LogFactory; 24 25 30 public class IDBean { 31 32 static Log log = LogFactory.getLog( IDBean.class ); 33 34 private String id; 35 private String name; 36 37 private IDBean child; 38 39 private List children = new ArrayList (); 40 41 public IDBean() { log.debug("Created"); } 42 43 public IDBean(String id, String name) { 44 setId(id); 45 setName(name); 46 } 47 48 public String getId() { 49 return id; 50 } 51 52 public void setId(String id) { 53 this.id = id; 54 } 55 56 public String getName() { 57 return name; 58 } 59 60 public void setName(String name) { 61 log.debug("Set name: " + name); 62 this.name = name; 63 } 64 65 public List getChildren() { 66 return children; 67 } 68 69 public void addChild(IDBean child) { 70 log.debug("Added child " + child + " to bean " + this); 71 children.add(child); 72 } 73 74 public String toString() { 75 return "IDBean[name=" + getName() + ",id=" + getId() + ", children=" + children.size() + "] " + super.toString(); 76 } 77 } 78 | Popular Tags |