Package org.springframework.data.repository.query.spi

Examples of org.springframework.data.repository.query.spi.Function


    public Map<String, Function> getFunctions() {

      Map<String, Function> functions = new HashMap<String, Function>(super.getFunctions());

      try {
        functions.put("aliasedMethod", new Function(getClass().getMethod("extensionMethod")));
        return functions;
      } catch (Exception o_O) {
        throw new RuntimeException(o_O);
      }
    }
View Full Code Here


      if (!functions.containsKey(name)) {
        return null;
      }

      Function function = functions.get(name);

      if (!function.supports(argumentTypes)) {
        return null;
      }

      return new FunctionMethodExecutor(function);
    }
View Full Code Here

      if (!(value instanceof Function)) {
        return new TypedValue(value);
      }

      Function function = (Function) value;

      try {
        return new TypedValue(function.invoke(new Object[0]));
      } catch (Exception e) {
        throw new SpelEvaluationException(e, SpelMessage.FUNCTION_REFERENCE_CANNOT_BE_INVOKED, name,
            function.getDeclaringClass());
      }
    }
View Full Code Here

      ReflectionUtils.doWithMethods(type, new MethodCallback() {

        @Override
        public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
          if (Modifier.isPublic(method.getModifiers()) && Modifier.isStatic(method.getModifiers())) {
            map.put(method.getName(), new Function(method, null));
          }
        }
      });

      return map.isEmpty() ? Collections.<String, Function> emptyMap() : Collections.unmodifiableMap(map);
View Full Code Here

      }

      Map<String, Function> functions = new HashMap<String, Function>(methods.size());

      for (Method method : methods) {
        functions.put(method.getName(), new Function(method, target));
      }

      return Collections.unmodifiableMap(functions);

    }
View Full Code Here

      }

      Map<String, Object> properties = new HashMap<String, Object>();

      for (Entry<String, Method> method : accessors.entrySet()) {
        properties.put(method.getKey(), new Function(method.getValue(), target));
      }

      for (Field field : fields) {
        properties.put(field.getName(), ReflectionUtils.getField(field, target));
      }
View Full Code Here

TOP

Related Classes of org.springframework.data.repository.query.spi.Function

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.