<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Annotation on Margrop Blog</title>
    <link>https://blog.margrop.net/en/tag/annotation/</link>
    <description>Recent content in Annotation on Margrop Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <lastBuildDate>Thu, 14 Jan 2021 15:29:41 +0800</lastBuildDate>
    <atom:link href="https://blog.margrop.net/en/tag/annotation/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>[Transfer] Spring AOP intercepts classes or methods with specified annotation identifiers</title>
      <link>https://blog.margrop.net/en/post/spring-aop-annotation-and-within/</link>
      <pubDate>Thu, 14 Jan 2021 15:29:41 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/spring-aop-annotation-and-within/</guid>
      <description>Instructions for scanning specific annotations in AOP: (1) @annotation: intercepts all methods annotated with the target annotation. (2) @within: intercepts all classes annotated with the target annotation. (3) within: limits the package scope to scan.&#xA;Code Demo @Aspect @Component @Order(10) public class BidAuthorityProxy { /** * Scan classes under the specified package that are annotated with `@EnableRoleAuthority`. */ @Around(&amp;#34;@within(com.core.annotation.EnableRoleAuthority) &amp;amp;&amp;amp; within(com.bid..*)&amp;#34;) public Object verifyRoleExecuteCommand(ProceedingJoinPoint pjp) throws Throwable { // Get the intercepted method MethodSignature msig = (MethodSignature) pjp.</description>
    </item>
  </channel>
</rss>
