1   
2   /*
3    * Licensed to the Apache Software Foundation (ASF) under one or more
4    * contributor license agreements.  See the NOTICE file distributed with
5    * this work for additional information regarding copyright ownership.
6    * The ASF licenses this file to You under the Apache License, Version 2.0
7    * (the "License"); you may not use this file except in compliance with
8    * the License.  You may obtain a copy of the License at
9    * 
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   * 
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */ 
18  package org.apache.commons.betwixt.digester;
19  
20  import java.util.ArrayList;
21  import java.util.List;
22  
23  import org.apache.commons.logging.Log;
24  import org.apache.commons.logging.LogFactory;
25  
26  /** Bean for testing ID-IDRef reading.
27    *
28    * @author Robert Burrell Donkin
29    * @version $Revision: 438373 $
30    */
31  public class IDBean {
32      
33      static Log log = LogFactory.getLog( IDBean.class );
34      
35      private String id;
36      private String name;
37      
38      private IDBean child;
39      
40      private List children = new ArrayList();
41      
42      public IDBean() { log.debug("Created"); }
43      
44      public IDBean(String id, String name) {
45          setId(id);
46          setName(name);
47      }
48      
49      public String getId() {
50          return id;
51      }
52      
53      public void setId(String id) {
54          this.id = id;
55      }
56      
57      public String getName() {
58          return name;
59      }	
60      
61      public void setName(String name) {
62          log.debug("Set name: " + name);
63          this.name = name;
64      }
65  
66      public List getChildren() {
67          return children;
68      }
69      
70      public void addChild(IDBean child) {
71          log.debug("Added child " + child + " to bean " + this);
72          children.add(child);
73      }
74      
75      public String toString() {
76          return "IDBean[name=" + getName() + ",id=" + getId() + ", children=" + children.size() + "] " + super.toString();
77      }
78  }