码迷,mamicode.com
首页 >  
搜索关键字:retention    ( 442个结果
Spring Boot读取配置文件的几种方式
SpringBoot获取文件总的来说有三种方式,分别是@Value注解,@ConfigurationProperties注解和Environment接口。这三种注解可以配合着@PropertySource来使用,@PropertySource主要是用来指定具体的配置文件。@PropertySource解析@Target(ElementType.TYPE)@Retention(RetentionPo
分类:编程语言   时间:2020-07-08 11:41:26    阅读次数:68
注解的定义和使用
1 判断某个注解是否存在 判断某个注解是否存在于Class、Field、Method或Constructor: Class.isAnnotationPresent(Class) Field.isAnnotationPresent(Class) Method.isAnnotationPresent(C ...
分类:其他好文   时间:2020-07-06 19:43:38    阅读次数:63
AOP日志模块搭建
概念 AOP(Aspect-OrientedProgramming,面向切面编程),可以说是OOP(Object-Oriented Programing,面向对象编程)的补充和完善。 (1)Aspect(切面):通常是一个类,里面可以定义切入点和通知 (2)JointPoint(连接点):程序执行过 ...
分类:其他好文   时间:2020-06-24 20:03:55    阅读次数:49
Spring:如何实现注解的组合
Spring中存在很多注解组合的情况,例如**@RestController** @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Controller @ResponseBody public @i ...
分类:编程语言   时间:2020-06-24 00:48:07    阅读次数:78
1.@SpringBootConfiguration注解
@SpringBootConfiguration注解表示Spring Boot配置类。查看@SpringBootConfiguration注解源码,核心代码具体如下。 ```java @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUN ...
分类:编程语言   时间:2020-06-22 10:48:52    阅读次数:71
手写 简易 Spring MVC v2(增加对annotation的支持)
增加对annotation的支持,查找@Controller下的@RequestMapping 代码:https://github.com/kuotian/springmvc_me 1. 注解 @Controller @Target(ElementType.TYPE) @Retention(Rete ...
分类:编程语言   时间:2020-06-18 22:13:41    阅读次数:66
JAXB注解 @XmlRootElement 及XML文件解析详解
【转-整理】 JAXB注解 @XmlRootElement 及XML文件解析详解 Java代码 @Retention(value=RUNTIME) @Target(value=TYPE) public @interface XmlRootElement @Inherited @Retention(v ...
分类:其他好文   时间:2020-06-16 01:18:25    阅读次数:83
深入理解Java中的注解
1. 元注解@Inherited继承 package com.example.demo; import java.lang.annotation.*; import java.util.Arrays; public class Test { public static void main(Strin ...
分类:编程语言   时间:2020-06-13 21:12:40    阅读次数:62
自定义注解
自定义注解基于元注解来定义自己所需要的注解 @Documented@Target(FIELD) @Retention(RUNTIME) public @interface IdcardValidate { String message() default "身份证号不正确"; Class<?>[] ...
分类:其他好文   时间:2020-06-10 23:06:55    阅读次数:98
Spring-AOP之工作实践(一)
案例一、角色校验 项目中,对某些方法需要用户具备指定角色权限才能执行。 /** * 角色校验注解 */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface HasRole { String ...
分类:编程语言   时间:2020-06-09 18:18:54    阅读次数:68
442条   上一页 1 2 3 4 5 ... 45 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!