Spring注解有哪些核心概念及用法简析?

2026-05-22 23:000阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计4789个文字,预计阅读时间需要20分钟。

包含:1、Java注解:元注解和内置注解;2、Spring(Boot)注解:包括声明Bean、注入Bean、配置类、Web、AOP等。Java元注解:@Documented、@Inherited、@Retention、@Target、@Repeatable、@Native。

包含:1、java注解:元注解和内置注解 2、Spring(boot)注解:包括声明bean、注入bean、配置类、web、aop等。 JAVA 元注解
  • @Documented
  • @Inherited
  • @Retention
  • @Target
  • @Repeatable
  • @Native

在java.lang.annotation包下,除了@Native之外都为元注解

元注解:是一种基础注解(根注解),可以注解其他的注解上。

作用:用来解释说明其他的注解。

@Documented
  • 源码:

@Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface Documented { }

  • 说明:

​ Document:文档。

阅读全文

本文共计4789个文字,预计阅读时间需要20分钟。

包含:1、Java注解:元注解和内置注解;2、Spring(Boot)注解:包括声明Bean、注入Bean、配置类、Web、AOP等。Java元注解:@Documented、@Inherited、@Retention、@Target、@Repeatable、@Native。

包含:1、java注解:元注解和内置注解 2、Spring(boot)注解:包括声明bean、注入bean、配置类、web、aop等。 JAVA 元注解
  • @Documented
  • @Inherited
  • @Retention
  • @Target
  • @Repeatable
  • @Native

在java.lang.annotation包下,除了@Native之外都为元注解

元注解:是一种基础注解(根注解),可以注解其他的注解上。

作用:用来解释说明其他的注解。

@Documented
  • 源码:

@Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface Documented { }

  • 说明:

​ Document:文档。

阅读全文