Examples of SuperCSVReflectionException


Examples of org.supercsv.exception.SuperCSVReflectionException

        }
      }
      return resultBean;
    }
    catch(final InstantiationException e) {
      throw new SuperCSVReflectionException("Error while filling an object", e);
    }
    catch(final IllegalAccessException e) {
      throw new SuperCSVReflectionException("Error while filling an object", e);
    }
    catch(final InvocationTargetException e) {
      throw new SuperCSVReflectionException("Error while filling an object", e);
    }
  }
View Full Code Here

Examples of org.supercsv.exception.SuperCSVReflectionException

  if( method.getName().startsWith("set") ) {
    if( args.length == 1 ) {
      beanState.put(method.getName().substring(3), args[0]);
      return proxy;
    } else {
      throw new SuperCSVReflectionException("Method should only take 1 argument");
    }
  }
  throw new SuperCSVReflectionException("Can only understand method calls starting with 'get' or 'set'. Got method '"
    + method.getName() + "'");
}
View Full Code Here

Examples of org.supercsv.exception.SuperCSVReflectionException

      && meth.getParameterTypes().length == requiredNumberOfArgs ) {
      // System.out.println("found method " + meth.toString());
      return meth;
    }
  }
  throw new SuperCSVReflectionException(String.format(//
    "Can't find method '%s' in class '%s'", methodName, destinationObject.getClass().getName()));
}
View Full Code Here

Examples of org.supercsv.exception.SuperCSVReflectionException

      && meth.getParameterTypes()[0].isPrimitive() == false ) {
      // System.out.println("found method " + meth.toString());
      return meth;
    }
  }
  throw new SuperCSVReflectionException(String.format(//
    "Can't find method '%s' in class '%s'", methodName, destinationObject.getClass().getName()));
}
View Full Code Here

Examples of org.supercsv.exception.SuperCSVReflectionException

* @throws SuperCSVReflectionException
*/
private void throwException(final Object destinationObject, final Class variableType, final String methodName,
  final Exception e) throws SuperCSVReflectionException {
  e.printStackTrace();
  throw new SuperCSVReflectionException(String.format("Can't find method '%s(%s)' in class '%s'. "
    + "Is the name correctly spelled in the NameMapping? "
    + "Have you forgot to convert the data so that a wrong set method is called?", methodName, variableType,
    destinationObject.getClass().getName()), e);
}
View Full Code Here

Examples of org.supercsv.exception.SuperCSVReflectionException

      }
    }
    return resultBean;
  }
  catch(final InstantiationException e) {
    throw new SuperCSVReflectionException("Error while filling an object", e);
  }
  catch(final IllegalAccessException e) {
    throw new SuperCSVReflectionException("Error while filling an object", e);
  }
  catch(final InvocationTargetException e) {
    throw new SuperCSVReflectionException("Error while filling an object", e);
  }
}
View Full Code Here

Examples of org.supercsv.exception.SuperCSVReflectionException

    for( final String methodName : nameMapping ) {
      result.add(cache.getGetMethod(source, methodName).invoke(source));
    }
  }
  catch(final IllegalAccessException e) {
    throw new SuperCSVReflectionException("Error accessing object " + source, e);
  }
  catch(final InvocationTargetException e) {
    throw new SuperCSVReflectionException("Error accessing object " + source, e);
  }
}
View Full Code Here

Examples of org.supercsv.exception.SuperCsvReflectionException

            bean = BeanInterfaceProxy.createProxy(clazz);
        } else {
            try {
                bean = clazz.newInstance();
            } catch (InstantiationException e) {
                throw new SuperCsvReflectionException(String.format(
                        "error instantiating bean, check that %s has a default no-args constructor", clazz.getName()), e);
            } catch (IllegalAccessException e) {
                throw new SuperCsvReflectionException("error instantiating bean", e);
            }
        }

        return bean;
    }
View Full Code Here

Examples of org.supercsv.exception.SuperCsvReflectionException

     */
    private static void invokeSetter(final Object bean, final Method setMethod, final Object fieldValue) {
        try {
            setMethod.invoke(bean, fieldValue);
        } catch (final Exception e) {
            throw new SuperCsvReflectionException(String.format("error invoking method %s()", setMethod.getName()), e);
        }
    }
View Full Code Here

Examples of org.supercsv.exception.SuperCsvReflectionException

            bean = BeanInterfaceProxy.createProxy(clazz);
        } else {
            try {
                bean = clazz.newInstance();
            } catch (InstantiationException e) {
                throw new SuperCsvReflectionException(String.format(
                        "error instantiating bean, check that %s has a default no-args constructor", clazz.getName()), e);
            } catch (IllegalAccessException e) {
                throw new SuperCsvReflectionException("error instantiating bean", e);
            }
        }

        return bean;
    }
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.