Examples of MethodMatcher


Examples of org.springframework.aop.MethodMatcher

   * @return a composable pointcut that builds on the original AspectJ expression pointcut
   * @see #getPointcut()
   */
  public final Pointcut buildSafePointcut() {
    Pointcut pc = getPointcut();
    MethodMatcher safeMethodMatcher = MethodMatchers.intersection(
        new AdviceExcludingMethodMatcher(this.aspectJAdviceMethod), pc.getMethodMatcher());
    return new ComposablePointcut(pc.getClassFilter(), safeMethodMatcher);
  }
View Full Code Here

Examples of org.springframework.roo.classpath.customdata.taggers.MethodMatcher

                JPA_ONE_TO_MANY_FIELD_MATCHER,
                JPA_ONE_TO_ONE_FIELD_MATCHER,
                JPA_TRANSIENT_FIELD_MATCHER,
                JPA_VERSION_FIELD_MATCHER,
                // Method matchers
                new MethodMatcher(Arrays
                        .asList(JPA_ID_AND_EMBEDDED_ID_FIELD_MATCHER),
                        IDENTIFIER_ACCESSOR_METHOD, true), new MethodMatcher(
                        Arrays.asList(JPA_ID_AND_EMBEDDED_ID_FIELD_MATCHER),
                        IDENTIFIER_MUTATOR_METHOD, false), new MethodMatcher(
                        Arrays.asList(JPA_VERSION_FIELD_MATCHER),
                        VERSION_ACCESSOR_METHOD, true), new MethodMatcher(
                        Arrays.asList(JPA_VERSION_FIELD_MATCHER),
                        VERSION_MUTATOR_METHOD, false));
    }
View Full Code Here

Examples of org.springframework.roo.classpath.customdata.taggers.MethodMatcher

    @SuppressWarnings("unchecked")
    private void registerMatchers() {
        customDataKeyDecorator
                .registerMatchers(getClass(),
                        new MethodMatcher(CLEAR_METHOD, ROO_JPA_ACTIVE_RECORD,
                                new JavaSymbolName("clearMethod"),
                                CLEAR_METHOD_DEFAULT), new MethodMatcher(
                                COUNT_ALL_METHOD, ROO_JPA_ACTIVE_RECORD,
                                new JavaSymbolName("countMethod"),
                                COUNT_METHOD_DEFAULT, true, false),
                        new MethodMatcher(FIND_ALL_METHOD,
                                ROO_JPA_ACTIVE_RECORD, new JavaSymbolName(
                                        "findAllMethod"),
                                FIND_ALL_METHOD_DEFAULT, true, false),
                        new MethodMatcher(FIND_ENTRIES_METHOD,
                                ROO_JPA_ACTIVE_RECORD, new JavaSymbolName(
                                        "findEntriesMethod"), "find", false,
                                true, "Entries"),
                        new MethodMatcher(FIND_ALL_SORTED_METHOD,
                                 ROO_JPA_ACTIVE_RECORD, new JavaSymbolName(
                                 "findAllSortedMethod"),
                                 FIND_ALL_METHOD_DEFAULT, true, false, "Sorted"),
                        new MethodMatcher(FIND_ENTRIES_SORTED_METHOD,
                                  ROO_JPA_ACTIVE_RECORD, new JavaSymbolName(
                                  "findEntriesSortedMethod"), "find", false,
                                  true, "EntriesSorted"),                                
                        new MethodMatcher(
                                FIND_METHOD, ROO_JPA_ACTIVE_RECORD,
                                new JavaSymbolName("findMethod"),
                                FIND_METHOD_DEFAULT, false, true),
                        new MethodMatcher(FLUSH_METHOD, ROO_JPA_ACTIVE_RECORD,
                                new JavaSymbolName("flushMethod"),
                                FLUSH_METHOD_DEFAULT), new MethodMatcher(
                                MERGE_METHOD, ROO_JPA_ACTIVE_RECORD,
                                new JavaSymbolName("mergeMethod"),
                                MERGE_METHOD_DEFAULT), new MethodMatcher(
                                PERSIST_METHOD, ROO_JPA_ACTIVE_RECORD,
                                new JavaSymbolName("persistMethod"),
                                PERSIST_METHOD_DEFAULT), new MethodMatcher(
                                REMOVE_METHOD, ROO_JPA_ACTIVE_RECORD,
                                new JavaSymbolName("removeMethod"),
                                REMOVE_METHOD_DEFAULT));
    }
View Full Code Here

Examples of rocket.beans.rebind.aop.MethodMatcher

    Checker.notNull("parameter:aspect", aspect);

    final String id = aspect.getTarget();
    final Bean bean = this.getBean(id);
    final Type type = bean.getType();
    final MethodMatcher matcher = aspect.getMethodMatcher();

    final GeneratorContext context = this.getGeneratorContext();
    context.branch();
    context.debug("Discovering methods that match: " + matcher + " against " + type);

    final List<Method> matchedMethods = new ArrayList<Method>();
    final Type object = context.getObject();

    final VirtualMethodVisitor visitor = new VirtualMethodVisitor() {

      @Override
      protected boolean visit(final Method method) {
        while (true) {
          if (method.isFinal()) {
            if (false == method.getEnclosingType().equals(object)) {
              BeanFactoryGenerator.this.throwTargetMethodIsFinal(method);
            }
          }
          break;
        }

        if (method.getVisibility() == Visibility.PUBLIC && matcher.matches(method)) {
          matchedMethods.add(method);
          context.debug(method.toString());
        }
        return false;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.