01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: 438373 $
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() {
42: log.debug("Created");
43: }
44:
45: public IDBean(String id, String name) {
46: setId(id);
47: setName(name);
48: }
49:
50: public String getId() {
51: return id;
52: }
53:
54: public void setId(String id) {
55: this .id = id;
56: }
57:
58: public String getName() {
59: return name;
60: }
61:
62: public void setName(String name) {
63: log.debug("Set name: " + name);
64: this .name = name;
65: }
66:
67: public List getChildren() {
68: return children;
69: }
70:
71: public void addChild(IDBean child) {
72: log.debug("Added child " + child + " to bean " + this );
73: children.add(child);
74: }
75:
76: public String toString() {
77: return "IDBean[name=" + getName() + ",id=" + getId()
78: + ", children=" + children.size() + "] "
79: + super.toString();
80: }
81: }
|