Can view the tutorials best in Google Chrome, Mozilla Firefox, Opera, higher version of Internet Explorer

RegularExpressionMethodPointcut Class In Spring AOP

Spring » On Sep 21, 2012 1 Comment

RegularExpressionMethodPointcut class is going to verify whether the method name of the class is matching with the given regular expression or not.  If matches then those methods are eligible to get Advices.  While configuring these classes into xml file, we are going to configure any one of following 2 properties..

  • pattern
  • patterns

some thing…

According to above configuration, a method name should start with get, and between get and letter N there should be one or more characters and finally that should end with a digit.  If method name satisfies this pattern then it is eligible for getting advices.

While working with regular expressions, we have following indications..
  – matches for single character
.* – matches for zero [or] more characters
.+ – matches for 1 [or] more characters
.? – matches for zero [or] 1 character
[A-Z] – matches for an upper case alphabet
[abc] – matches for either a or b or c
[0-9] – matches for a digit

If we want to configure multiple regular expressions then we need to configure patterns property with list as NameMatchMethodPointcut, will see the example in the next article.

 

What you are thinkig....

One Response to “RegularExpressionMethodPointcut Class In Spring AOP”
  1. sridhar says:

    Thanks to java4s for giving the wonderful tutorial.But where is the rest of the topics in Spring AOP i.e., Dynamic PointCut etc..???Am excepting you to finish this AOP Tutorial ASAP.

If you want a pic to show with your comment, go get a gravatar !
Please post your questions on Java4s Answers forum

Name*
Ask a Question ?
or
Mail*
Website



By posting your answer, you agree to our comments policy.
Most Recent Tutorials
Hibernate Recent Posts
Spring Recent Posts
Struts Recent Posts
Recomandded Links Current & UpComing Tutorials Java4s.com
Tutorials Online :
spring Hibernate struts Json Ajax Log4j Log4j
coreJava Servlets


UpComing :
Jsps,Web Services
Java4s is optimized for learning java technologies, all the examples in this site are constantly reviewed to avoid errors. While using this site you agree to have read and accepted our terms of use and privacy policy
Especially i have prepared this blog by keeping fresher's in mind, however it will be very useful for real time developers too.


© 2014 Java4s All rights reserved. | strPro4Tut v(2.0) Theme designed by Team Java4s.