Package org.springframework.expression

Examples of org.springframework.expression.MethodFilter


      TypeConverter typeConverter = context.getTypeConverter();
      Class<?> type = (targetObject instanceof Class ? (Class<?>) targetObject : targetObject.getClass());
      Method[] methods = getMethods(type, targetObject);

      // If a filter is registered for this type, call it
      MethodFilter filter = (this.filters != null ? this.filters.get(type) : null);
      if (filter != null) {
        List<Method> methodsForFiltering = new ArrayList<Method>();
        for (Method method: methods) {
          methodsForFiltering.add(method);
        }
        List<Method> methodsFiltered = filter.filter(methodsForFiltering);
        if (CollectionUtils.isEmpty(methodsFiltered)) {
          methods = NO_METHODS;
        }
        else {
          methods = methodsFiltered.toArray(new Method[methodsFiltered.size()]);
View Full Code Here


      TypeConverter typeConverter = context.getTypeConverter();
      Class<?> type = (targetObject instanceof Class ? (Class<?>) targetObject : targetObject.getClass());
      Method[] methods = type.getMethods();
     
      // If a filter is registered for this type, call it
      MethodFilter filter = (this.filters != null ? this.filters.get(type) : null);
      if (filter != null) {
          List<Method> methodsForFiltering = new ArrayList<Method>();
          for (Method method: methods) {
            methodsForFiltering.add(method);
          }
        List<Method> methodsFiltered = filter.filter(methodsForFiltering);
        if (CollectionUtils.isEmpty(methodsFiltered)) {
          methods = NO_METHODS;
        }
        else {
          methods = methodsFiltered.toArray(new Method[methodsFiltered.size()]);
View Full Code Here

    // or simply...
    // context.setMethodResolvers(new ArrayList<MethodResolver>());

    // Register a custom MethodFilter...
    MethodFilter filter = new CustomMethodFilter();
    try {
      context.registerMethodFilter(String.class, filter);
      fail("should have failed");
    } catch (IllegalStateException ise) {
      assertEquals(
View Full Code Here

      TypeConverter typeConverter = context.getTypeConverter();
      Class<?> type = (targetObject instanceof Class ? (Class<?>) targetObject : targetObject.getClass());
      Method[] methods = type.getMethods();
     
      // If a filter is registered for this type, call it
      MethodFilter methodfilter = (filters==null?null:filters.get(type));
      if (methodfilter!=null) {
          List<Method> methodsForFiltering = new ArrayList<Method>();
          for (Method method: methods) {
            methodsForFiltering.add(method);
          }
        List<Method> methodsFiltered = methodfilter.filter(methodsForFiltering);
        if (methodsFiltered == null || methodsFiltered.size()==0) {
          methods = NO_METHODS;
        }
        else {
          methods = methodsFiltered.toArray(new Method[methodsFiltered.size()]);
View Full Code Here

      TypeConverter typeConverter = context.getTypeConverter();
      Class<?> type = (targetObject instanceof Class ? (Class<?>) targetObject : targetObject.getClass());
      List<Method> methods = new ArrayList<Method>(Arrays.asList(getMethods(type, targetObject)));

      // If a filter is registered for this type, call it
      MethodFilter filter = (this.filters != null ? this.filters.get(type) : null);
      if (filter != null) {
        List<Method> filtered = filter.filter(methods);
        methods = (filtered instanceof ArrayList ? filtered : new ArrayList<Method>(filtered));
      }

      // Sort methods into a sensible order
      if (methods.size() > 1) {
View Full Code Here

TOP

Related Classes of org.springframework.expression.MethodFilter

Copyright © 2018 www.massapicom. 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.