KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > beans > factory > parsing > AbstractComponentDefinition


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.beans.factory.parsing;
18
19 import org.springframework.beans.factory.config.BeanDefinition;
20 import org.springframework.beans.factory.config.BeanReference;
21
22 /**
23  * Base implementation of {@link ComponentDefinition} that provides a basic implementation of
24  * {@link #getDescription} which delegates to {@link #getName}. Also provides a base implementation
25  * of {@link #toString} which delegates to {@link #getDescription} in keeping with the recommended
26  * implementation strategy. Also provides default implementations of {@link #getInnerBeanDefinitions}
27  * and {@link #getBeanReferences} that return an empty array.
28  *
29  * @author Rob Harrop
30  * @author Juergen Hoeller
31  * @since 2.0
32  */

33 public abstract class AbstractComponentDefinition implements ComponentDefinition {
34
35     /**
36      * Delegates to {@link #getName}.
37      */

38     public String JavaDoc getDescription() {
39         return getName();
40     }
41
42     /**
43      * Returns an empty array.
44      */

45     public BeanDefinition[] getBeanDefinitions() {
46         return new BeanDefinition[0];
47     }
48
49     /**
50      * Returns an empty array.
51      */

52     public BeanDefinition[] getInnerBeanDefinitions() {
53         return new BeanDefinition[0];
54     }
55
56     /**
57      * Returns an empty array.
58      */

59     public BeanReference[] getBeanReferences() {
60         return new BeanReference[0];
61     }
62
63     /**
64      * Delegates to {@link #getDescription}.
65      */

66     public String JavaDoc toString() {
67         return getDescription();
68     }
69
70 }
71
Popular Tags