{"id":1553,"date":"2016-09-06T16:32:41","date_gmt":"2016-09-06T16:32:41","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=1553"},"modified":"2016-09-06T16:32:41","modified_gmt":"2016-09-06T16:32:41","slug":"creating-new-annotations","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/creating-new-annotations\/","title":{"rendered":"Creating New Annotations"},"content":{"rendered":"<p><strong>Loggable.java<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage com.mugil.shapes;\r\npublic @interface Loggable {\r\n}\r\n<\/pre>\n<p><strong>.java<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Aspect\r\npublic class LoggingAspect \r\n{\r\n@Around(&quot;@annotation(com.mugil.shapes.Loggable)&quot;)\r\n\tpublic void LoggingAdvice2(ProceedingJoinPoint pjp)\r\n\t{\r\n\t\tObject objObject = null;\t\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\tSystem.out.println(&quot;Code before Method Execution Goes here&quot;);\t\t\t\r\n\t\t\tobjObject = pjp.proceed();\r\n\t\t\tSystem.out.println(&quot;Code after Method Execution Goes here&quot;);\r\n\t\t} catch (Throwable e) {\r\n\t\t\t\/\/ TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<p><strong>Triangle.xml<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic class Triangle \r\n{\r\n   private String name;\r\n\r\n   @Loggable\r\n   public String getName() \r\n   {\r\n     return name;\r\n   }\r\n.\r\n.\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Loggable.java package com.mugil.shapes; public @interface Loggable { } .java @Aspect public class LoggingAspect { @Around(&quot;@annotation(com.mugil.shapes.Loggable)&quot;) public void LoggingAdvice2(ProceedingJoinPoint pjp) { Object objObject = null; try { System.out.println(&quot;Code before Method Execution Goes here&quot;); objObject = pjp.proceed(); System.out.println(&quot;Code after Method Execution Goes here&quot;); } catch (Throwable e) { \/\/ TODO Auto-generated catch block e.printStackTrace(); } } }&hellip; <a href=\"https:\/\/codethataint.com\/blog\/creating-new-annotations\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[191],"tags":[],"class_list":["post-1553","post","type-post","status-publish","format-standard","hentry","category-aop"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=1553"}],"version-history":[{"count":1,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1553\/revisions"}],"predecessor-version":[{"id":1554,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1553\/revisions\/1554"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=1553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=1553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=1553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}