1   
2   /*
3    * Copyright 2001-2004 The Apache Software Foundation.
4    * 
5    * Licensed under the Apache License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */ 
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  /*** Bean for testing ID-IDRef reading.
26    *
27    * @author Robert Burrell Donkin
28    * @version $Revision: 1.6 $
29    */
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() + "]";
76      }
77  }