Examples of MappingException


Examples of org.dozer.MappingException

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

Examples of org.dozer.MappingException

      }
      dest.setTestObject((TestObject) testCustomConverterHashMapPrimeObject.getTestObjects().get("object1"));
      dest.setTestObjectPrime((TestObjectPrime) testCustomConverterHashMapPrimeObject.getTestObjects().get("object2"));
      return dest;
    } else {
      throw new MappingException("Converter TestCustomHashMapConverter used incorrectly. Arguments passed in were:" + destination
          + " and " + source);
    }
  }
View Full Code Here

Examples of org.dozer.MappingException

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

Examples of org.dozer.MappingException

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

Examples of org.dozer.MappingException

  private static DatatypeFactory dataTypeFactory() {
    if (dataTypeFactory == null) {
      try {
        dataTypeFactory = DatatypeFactory.newInstance();
      } catch (DatatypeConfigurationException e) {
        throw new MappingException(e);
      }
    }
    return dataTypeFactory;
  }
View Full Code Here

Examples of org.dozer.MappingException

    classMap.addFieldMapping(fieldMap);
  }

  private static void validate(Mapping annotation, Member member) {
    if (annotation.value().trim().equals("")) {
      throw new MappingException("Mapping annotation value missing at "
              + member.getDeclaringClass().getName() + "." + member.getName());
    }
  }
View Full Code Here

Examples of org.dozer.MappingException

    if (returnType != null) {
      return returnType;
    }

    if (readMethod == null && writeMethod == null) {
      throw new MappingException("No read or write method found for field (" + fieldName
          + ") in class (" + clazz + ")");
    }

    if (readMethod == null) {
      return determineByWriteMethod(writeMethod);
View Full Code Here

Examples of org.dozer.MappingException

  private Class determineByWriteMethod(Method writeMethod) {
    try {
      return writeMethod.getParameterTypes()[0];
    } catch (Exception e) {
      throw new MappingException(e);
    }
  }
View Full Code Here

Examples of org.dozer.MappingException

    public Object create(BeanCreationDirective directive) {
      DatatypeFactory dataTypeFactory;
      try {
        dataTypeFactory = DatatypeFactory.newInstance();
      } catch (DatatypeConfigurationException e) {
        throw new MappingException(e);
      }
      return dataTypeFactory.newXMLGregorianCalendar();
    }
View Full Code Here

Examples of org.dozer.MappingException

  }

  @Override
  public Method getWriteMethod() throws NoSuchMethodException {
    if (MappingUtils.isBlankOrNull(setMethodName)) {
      throw new MappingException("Custom Map set method not specified for field mapping to class: " + clazz
          + ".  Perhaps the map-set-method wasn't specified in the dozer mapping file?");
    }
    if (writeMethod == null || writeMethod.get() == null) {
      Method method = findMapMethod(clazz, setMethodName, 2);
      writeMethod = new SoftReference<Method>(method);
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.