Package ma.glasnost.orika.impl.mapping.strategy

Examples of ma.glasnost.orika.impl.mapping.strategy.MappingStrategy.map()


            }
           
            D existingResult = (D) context.getMappedObject(sourceObject, destinationType);
            if (existingResult == null) {
                MappingStrategy strategy = resolveMappingStrategy(sourceObject, sourceType, destinationType, false, context);
                existingResult = (D) strategy.map(sourceObject, null, context);
            }
            return existingResult;
           
        } catch (MappingException e) {
            /* don't wrap our own exceptions */
 
View Full Code Here


                throw new MappingException("[sourceObject] can not be null.");
            }
           
            if (context.getMappedObject(sourceObject, destinationType) == null) {
                MappingStrategy strategy = resolveMappingStrategy(sourceObject, sourceType, destinationType, true, context);
                strategy.map(sourceObject, destinationObject, context);
            }

        } catch (MappingException e) {
            /* don't wrap our own exceptions */
            throw e;
View Full Code Here

                throw new MappingException("[sourceObject] can not be null.");
            }
           
            if (context.getMappedObject(sourceObject, destinationObject.getClass()) == null) {
                MappingStrategy strategy = resolveMappingStrategy(sourceObject, null, destinationObject.getClass(), true, context);
                strategy.map(sourceObject, destinationObject, context);
            }

        } catch (MappingException e) {
            /* don't wrap our own exceptions */
            throw e;
View Full Code Here

                strategy = resolveMappingStrategy(item, sourceType, destinationType, false, context);
                sourceClass = item.getClass();
            }
            D mappedItem = (D) context.getMappedObject(item, destinationType);
            if (mappedItem == null) {
                mappedItem = (D) strategy.map(item, null, context);
            }
            destination.add(mappedItem);
        }
        return destination;
    }
View Full Code Here

            }
           
            D result = (D) context.getMappedObject(sourceObject, destinationClass);
            if (result == null) {
                MappingStrategy strategy = resolveMappingStrategy(sourceObject, null, destinationClass, false, context);
                result = (D) strategy.map(sourceObject, null, context);
            }
            return result;
           
        } catch (MappingException e) {
            /* don't wrap our own exceptions */
 
View Full Code Here

                    valueClass = entry.getValue().getClass();
                }
               
                Dv mappedValue = (Dv) context.getMappedObject(entry.getValue(), destinationType.<Dv> getNestedType(1));
                if (mappedValue == null) {
                    mappedValue = (Dv) (Dv) valueStrategy.map(entry.getValue(), null, context);
                }
               
                value = mappedValue;
            }
           
View Full Code Here

                entryClass = element.getClass();
            }
           
            Map.Entry<Dk, Dv> entry = context.getMappedObject(element, entryType);
            if (entry == null) {
                entry = (Map.Entry<Dk, Dv>) strategy.map(element, null, context);
            }
            destination.put(entry.getKey(), entry.getValue());
        }
       
        return destination;
View Full Code Here

                entryClass = element.getClass();
            }
           
            MapEntry<Dk, Dv> entry = context.getMappedObject(element, entryType);
            if (entry == null) {
                entry = (MapEntry<Dk, Dv>) strategy.map(element, null, context);
            }
            destination.put(entry.getKey(), entry.getValue());
        }
       
        return destination;
View Full Code Here

        for (final Object s : source) {
            if (strategy == null || !s.getClass().equals(entryClass)) {
                strategy = mapperFacade.resolveMappingStrategy(s, null, clazz, false, mappingContext);
                entryClass = s.getClass();
            }
            destination[i++] = (Long) strategy.map(s, null, mappingContext);
        }
       
    }
   
    protected void mapArray(float[] destination, List<Object> source, Class<?> clazz, MappingContext mappingContext) {
View Full Code Here

        for (final Object s : source) {
            if (strategy == null || !s.getClass().equals(entryClass)) {
                strategy = mapperFacade.resolveMappingStrategy(s, null, clazz, false, mappingContext);
                entryClass = s.getClass();
            }
            destination[i++] = (Float) strategy.map(s, null, mappingContext);
        }
       
    }
   
    protected void mapArray(double[] destination, List<Object> source, Class<?> clazz, MappingContext mappingContext) {
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.