Examples of MethodCallback


Examples of com.googlecode.gwt.test.utils.GwtReflectionUtils.MethodCallback

    * @param list List of methods that should not be mocked
    */
   protected <T> T createMockAndKeepMethods(Class<T> clazz, final boolean keepSetters,
            final Method... list) {
      final List<Method> l = new ArrayList<Method>();
      GwtReflectionUtils.doWithMethods(clazz, new MethodCallback() {

         public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
            if (!ArrayUtils.contains(list, method)) {
               if (!keepSetters || !method.getName().startsWith("set")
                        || method.getReturnType() != void.class) {
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

    private static Map<String, Function> discoverDeclaredFunctions(Class<?> type) {

      final Map<String, Function> map = new HashMap<String, Function>();

      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));
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

        return;
      }

      final PropertyDescriptor[] descriptors = BeanUtils.getPropertyDescriptors(type);

      ReflectionUtils.doWithMethods(type, new MethodCallback() {

        @Override
        public void doWith(Method method) {

          RootObjectInformation.this.methods.add(method);
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

    final Map<Class<?>, HandlerMethod> candidateMethods = new HashMap<Class<?>, HandlerMethod>();
    final Map<Class<?>, HandlerMethod> candidateMessageMethods = new HashMap<Class<?>, HandlerMethod>();
    final Class<?> targetClass = this.getTargetClass(targetObject);
    MethodFilter methodFilter = new UniqueMethodFilter(targetClass);
    ReflectionUtils.doWithMethods(targetClass, new MethodCallback() {
      @Override
      public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
        boolean matchesAnnotation = false;
        if (method.isBridge()) {
          return;
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

    return bean;
  }

  public Object postProcessAfterInitialization(final Object bean, String beanName) {
    final Class<?> targetClass = AopUtils.getTargetClass(bean);
    ReflectionUtils.doWithMethods(targetClass, new MethodCallback() {
      public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
        Scheduled annotation = AnnotationUtils.getAnnotation(method, Scheduled.class);
        if (annotation != null) {
          Assert.isTrue(void.class.equals(method.getReturnType()),
              "Only void-returning methods may be annotated with @Scheduled.");
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

    return bean;
  }

  public Object postProcessAfterInitialization(final Object bean, String beanName) {
    final Class<?> targetClass = AopUtils.getTargetClass(bean);
    ReflectionUtils.doWithMethods(targetClass, new MethodCallback() {
      public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
        Scheduled annotation = AnnotationUtils.getAnnotation(method, Scheduled.class);
        if (annotation != null) {
          Assert.isTrue(void.class.equals(method.getReturnType()),
              "Only void-returning methods may be annotated with @Scheduled.");
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

            Method setResultsMethod = ReflectionUtils.findMethod(returnTypeClass, setterMethodName, resultReturnTypeClass);
            final AtomicReference<Method> altSetResultsMethod = new AtomicReference<Method>();

            // issue with ReflectionUtils, setterResultsMethod sometimes null from the command line (not getter?)
            if (setResultsMethod == null) {
                ReflectionUtils.doWithMethods(returnTypeClass, new MethodCallback() {
                    @Override
                    public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
                        if (setterMethodName.equals(method.getName())) {
                            altSetResultsMethod.set(method);
                        logger.debug("Unable to use ReflectionUtils to find setter. returnTypeClass={}  method={} resultReturnTypeClass={}",
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

    }

    if (clazz.isInterface()) {
      final List<Method> methods = new ArrayList<Method>();

      ReflectionUtils.doWithMethods(clazz, new MethodCallback() {
        @Override
        public void doWith(Method method) throws IllegalArgumentException,
            IllegalAccessException {
          methods.add(method);
        }
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

    }

    if (clazz.isInterface()) {
      final List<Method> methods = new ArrayList<Method>();

      ReflectionUtils.doWithMethods(clazz, new MethodCallback() {
        @Override
        public void doWith(Method method)
            throws IllegalArgumentException, IllegalAccessException {
          methods.add(method);
        }
View Full Code Here

Examples of org.springframework.util.ReflectionUtils.MethodCallback

    final List<ModelFieldBean> modelFields = new ArrayList<ModelFieldBean>();
    final List<AbstractAssociation> associations = new ArrayList<AbstractAssociation>();

    if (clazz.isInterface()) {
      ReflectionUtils.doWithMethods(clazz, new MethodCallback() {
        @Override
        public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
         
          Class<?> javaType = method.getReturnType();   
          if (javaType.equals(Void.TYPE)) {
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.