Examples of MappingException


Examples of org.dozer.MappingException

    for (Method method : methods) {
      if (methodName.equals(method.getName()) && method.getParameterTypes().length == parameterCount) {
        return method;
      }
    }
    throw new MappingException("No map method found for class:" + clazz + " and method name:" + methodName);
  }
View Full Code Here

Examples of org.dozer.MappingException

  }

  @Override
  protected Method getReadMethod() throws NoSuchMethodException {
    if (MappingUtils.isBlankOrNull(getMethodName)) {
      throw new MappingException("Custom Map get method not specified for field mapping to class: " + clazz
          + ".  Perhaps the map-get-method wasn't specified in the dozer mapping file?");
    }
    if (readMethod == null || readMethod.get() == null) {
      Method method = findMapMethod(clazz, getMethodName, 1);
      readMethod = new SoftReference<Method>(method);
View Full Code Here

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

Examples of org.dozer.MappingException

  }

  @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

Examples of org.dozer.MappingException

  public DocumentBuilder createParser() {
    DocumentBuilderFactory factory = createDocumentBuilderFactory();
    try {
      return createDocumentBuilder(factory);
    } catch (ParserConfigurationException e) {
      throw new MappingException("Failed to create XML Parser !", e);
    }
  }
View Full Code Here

Examples of org.dozer.MappingException

    assertEquals("invalid result value", "String", result);
  }

  @Test(expected=MappingException.class)
  public void testThrowMappingException_MappingException() {
    MappingException ex = new MappingException(String.valueOf(System.currentTimeMillis()));
      MappingUtils.throwMappingException(ex);
      fail("should have thrown exception");
  }
View Full Code Here

Examples of org.dozer.MappingException

              }
              if (existingPropDescriptor.getWriteMethod() == null) {
                existingPropDescriptor.setWriteMethod(superPropDescriptor.getWriteMethod());
              }
            } catch (IntrospectionException e) {
              throw new MappingException(e);
            }

          }
        }
      }
View Full Code Here

Examples of org.dozer.MappingException

      return field;
    } catch (NoSuchFieldException e) {
      if (clazz.getSuperclass() != null) {
        return getFieldFromBean(clazz.getSuperclass(), fieldName, originalClass);
      }
      throw new MappingException("No such field found " + originalClass.getName() + "." + fieldName, e);
    }
  }
View Full Code Here

Examples of org.dozer.MappingException

      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

Examples of org.dozer.MappingException

      throw new MappingException(e);
    }
  }

  public static void throwMappingException(String msg) throws MappingException {
    throw new MappingException(msg);
  }
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.