注解
注解
如何创建注解
- 添加元注解
- @Target:注解添加的位置
- @Retention:注解运行的时间
- @Documented:是否记录为javadoc
- @Inherited:子类是否可以继承父类的注解
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface Controller {
/**
* The value may indicate a suggestion for a logical component name,
* to be turned into a Spring bean in case of an autodetected component.
* @return the suggested component name, if any (or empty String otherwise)
*/
String value() default "";
}