title: What is the use of access modifiers in Spring AOP expression?
body: <p>From the <a href="http://static.springsource.org/spring/docs/2.5.x/reference/aop.html" rel="nofollow">Spring doc</a>:</p>
  
  <blockquote>
    <p><em>6.2.3.4. Examples</em> </p>
    
    <p>Spring AOP users are likely to use the execution pointcut designator the most often. The format of an execution
    expression is: </p>
    
    <p>execution(<strong>modifiers-pattern?</strong> ret-type-pattern
    declaring-type-pattern? name-pattern(param-pattern)
              throws-pattern?)</p>
  </blockquote>
  
  <p>I can see the modifiers-pattern? where you can say public, private, protected. And on the same document it says:</p>
  
  <blockquote>
    <p><em>6.2.3.1. Supported Pointcut Designators</em> </p>
    
    <p>Due to the proxy-based nature of Spring's AOP framework, protected methods are by definition not
    intercepted, neither for JDK proxies (where this isn't applicable) nor
    for CGLIB proxies (where this is technically possible but not
    recommendable for AOP purposes). <strong>As a consequence, any given pointcut
    will be matched against public methods only!</strong></p>
  </blockquote>
  
  <p>I'm abit confused, what is the point of using the modifiers-pattern?, please give an example?</p>