Package org.dozer

Examples of org.dozer.MappingException


        public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable {
          return proceed.invoke(self, args);
        }
      });
    } catch (Exception e) {
      throw new MappingException(e);
    }
    return instance;
  }
View Full Code Here


      }
      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

      return dest;
    } else if (source instanceof CustomDoubleObject) {
      double sourceObj = ((CustomDoubleObjectIF) source).getTheDouble();
      return new Double(sourceObj);
    } else {
      throw new MappingException("Converter TestCustomConverter used incorrectly. Arguments passed in were:" + destination
          + " and " + source);
    }
  }
View Full Code Here

  public boolean mapField(Object sourceObj, Object destObj, Object sourceFieldValue, ClassMap classMap, FieldMap fieldMapping) {
    boolean result = false;

    if (!(sourceObj instanceof SimpleObj)) {
      throw new MappingException("Unsupported source object type.  Should be of type: SimpleObj");
    }

    if (!(destObj instanceof SimpleObjPrime)) {
      throw new MappingException("Unsupported dest object type.  Should be of type: SimpleObjPrime");
    }

    if (fieldMapping.getSrcFieldName().equals("field1")) {
      ((SimpleObjPrime) destObj).setField1(FIELD_VALUE);
      result = true;
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.