Package org.dozer.factory

Examples of org.dozer.factory.BeanCreationDirective


      if (converterClass != null) {
        return (T) mapUsingCustomConverter(converterClass, srcObj.getClass(), srcObj, destType, result, null, true);
      }

      if (result == null) {
        result = (T) DestBeanCreator.create(new BeanCreationDirective(srcObj, classMap.getSrcClassToMap(), classMap.getDestClassToMap(), destType, classMap
            .getDestClassBeanFactory(), classMap.getDestClassBeanFactoryId(), classMap.getDestClassCreateMethod()));
      }

      // If this is a nested MapperAware conversion this mapping can be already processed
      Object alreadyMappedValue = mappedFields.getMappedValue(srcObj, destClass);
View Full Code Here


        targetClass = destFieldType;
      }
      classMap = getClassMap(srcFieldValue.getClass(), targetClass, mapId);

      result = DestBeanCreator.create(
          new BeanCreationDirective(srcFieldValue, classMap.getSrcClassToMap(), classMap.getDestClassToMap(),
              destFieldType, classMap.getDestClassBeanFactory(), classMap.getDestClassBeanFactoryId(),
              fieldMap.getDestFieldCreateMethod() != null ? fieldMap.getDestFieldCreateMethod() : classMap.getDestClassCreateMethod()));
    }

    map(classMap, srcFieldValue, result, false, fieldMap.getMapId());
View Full Code Here

          try {
            o = DestBeanCreator.create(clazz);
          } catch (Exception e) {
            //lets see if they have a factory we can try as a last ditch. If not...throw the exception:
            if (fieldMap.getClassMap().getDestClassBeanFactory() != null) {
              o = DestBeanCreator.create(new BeanCreationDirective(null, fieldMap.getClassMap().getSrcClassToMap(), clazz, clazz, fieldMap.getClassMap()
                  .getDestClassBeanFactory(), fieldMap.getClassMap().getDestClassBeanFactoryId(), null));
            } else {
              MappingUtils.throwMappingException(e);
            }
          }
View Full Code Here

          try {
            o = DestBeanCreator.create(clazz);
          } catch (Exception e) {
            //lets see if they have a factory we can try as a last ditch. If not...throw the exception:
            if (fieldMap.getClassMap().getDestClassBeanFactory() != null) {
              o = DestBeanCreator.create(new BeanCreationDirective(null, fieldMap.getClassMap().getSrcClassToMap(), clazz, clazz, fieldMap.getClassMap()
                      .getDestClassBeanFactory(), fieldMap.getClassMap().getDestClassBeanFactoryId(), null));
            } else {
              MappingUtils.throwMappingException(e);
            }
          }
View Full Code Here

      if (converterClass != null) {
        return (T) mapUsingCustomConverter(converterClass, srcObj.getClass(), srcObj, destType, result, null, true);
      }

      BeanCreationDirective creationDirective =
              new BeanCreationDirective(srcObj, classMap.getSrcClassToMap(), classMap.getDestClassToMap(), destType,
              classMap.getDestClassBeanFactory(), classMap.getDestClassBeanFactoryId(), classMap.getDestClassCreateMethod());

      result = createByCreationDirectiveAndMap(creationDirective, classMap, srcObj, result, false, null);
    } catch (Throwable e) {
      MappingUtils.throwMappingException(e);
View Full Code Here

      } else {
        targetClass = destFieldType;
      }
      ClassMap classMap = getClassMap(srcFieldValue.getClass(), targetClass, mapId);

      BeanCreationDirective creationDirective = new BeanCreationDirective(srcFieldValue, classMap.getSrcClassToMap(), classMap.getDestClassToMap(),
              destFieldType, classMap.getDestClassBeanFactory(), classMap.getDestClassBeanFactoryId(),
              fieldMap.getDestFieldCreateMethod() != null ? fieldMap.getDestFieldCreateMethod() : classMap.getDestClassCreateMethod());

      result = createByCreationDirectiveAndMap(creationDirective, classMap, srcFieldValue, null, false, fieldMap.getMapId());
    } else {
View Full Code Here

TOP

Related Classes of org.dozer.factory.BeanCreationDirective

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.