01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.stereotype;
18:
19: import java.lang.annotation.Documented;
20: import java.lang.annotation.ElementType;
21: import java.lang.annotation.Retention;
22: import java.lang.annotation.RetentionPolicy;
23: import java.lang.annotation.Target;
24:
25: /**
26: * Indicates that an annotated class is a "component".
27: * Such classes are considered as candidates for auto-detection
28: * when using annotation-based configuration and classpath scanning.
29: *
30: * <p>Other class-level annotations may be considered as identifying
31: * a component as well, typically a special kind of component:
32: * e.g. the {@link Repository @Repository} annotation or AspectJ's
33: * {@link org.aspectj.lang.annotation.Aspect @Aspect} annotation.
34: *
35: * @author Mark Fisher
36: * @since 2.5
37: * @see Repository
38: * @see Service
39: * @see Controller
40: * @see org.springframework.context.annotation.ClassPathBeanDefinitionScanner
41: */
42: @Target(ElementType.TYPE)
43: @Retention(RetentionPolicy.RUNTIME)
44: @Documented
45: public @interface Component {
46:
47: /**
48: * The value may indicate a suggestion for a logical component name,
49: * to be turned into a Spring bean in case of an autodetected component.
50: * @return the suggested component name, if any
51: */
52: String value() default "";
53:
54: }
|