Package org.dozer

Examples of org.dozer.MappingException


  }

  @Override
  protected void invokeWriteMethod(Object target, Object value) {
    if (key == null) {
      throw new MappingException("key must be specified");
    }
    try {
      ReflectionUtils.invoke(getWriteMethod(), target, new Object[]{key, value});
    } catch (NoSuchMethodException e) {
      MappingUtils.throwMappingException(e);
View Full Code Here


  }

  @Override
  protected Object invokeReadMethod(Object target) {
    if (key == null) {
      throw new MappingException("key must be specified");
    }
    Object result = null;
    try {
      result = ReflectionUtils.invoke(getReadMethod(), target, new Object[]{key});
    } catch (NoSuchMethodException e) {
View Full Code Here

      throw (MappingException) e;
    } else if (e instanceof RuntimeException) {
      // feature request 1561837. Dont wrap any runtime exceptions in a MappingException
      throw (RuntimeException) e;
    } else {
      throw new MappingException(e);
    }
  }
View Full Code Here

      throw new MappingException(e);
    }
  }

  public static void throwMappingException(String msg) throws MappingException {
    throw new MappingException(msg);
  }
View Full Code Here

  public static void throwMappingException(String msg) throws MappingException {
    throw new MappingException(msg);
  }

  public static void throwMappingException(String msg, Throwable cause) throws MappingException {
    throw new MappingException(msg, cause);
  }
View Full Code Here

  public DozerField getSrcFieldCopy() {
    try {
      return (DozerField) srcField.clone();
    } catch (CloneNotSupportedException e) {
      throw new MappingException(e);
    }
  }
View Full Code Here

  public DozerField getDestFieldCopy() {
    try {
      return (DozerField) destField.clone();
    } catch (CloneNotSupportedException e) {
      throw new MappingException(e);
    }
  }
View Full Code Here

  @Override
  public Class<?> loadClass(String className) {
    try {
      return context.getBundle().loadClass(className);
    } catch (ClassNotFoundException e) {
      throw new MappingException(e);
    }
  }
View Full Code Here

    Class newClass = proxiedClass(classToInstantiate);
    Object instance;
    try {
      instance = newClass.newInstance();
    } catch (Exception e) {
      throw new MappingException(e);
    }
    return (T) instance;
  }
View Full Code Here

        argTypes[i] = MappingUtils.getRealClass(args[i].getClass());
      }
      Constructor constructor = newClass.getDeclaredConstructor(argTypes);
      instance = constructor.newInstance(args);
    } catch (Exception e) {
      throw new MappingException(e);
    }
    return (T) instance;
  }
View Full Code Here

TOP

Related Classes of org.dozer.MappingException

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.