ma.glasnost.orika.impl.generator.specification
Class MultiOccurrenceToMultiOccurrence

java.lang.Object
  extended by ma.glasnost.orika.impl.generator.specification.MultiOccurrenceToMultiOccurrence
All Implemented Interfaces:
AggregateSpecification

public class MultiOccurrenceToMultiOccurrence
extends Object
implements AggregateSpecification

Author:
mattdeboer

Field Summary
protected  MapperFactory mapperFactory
           
 
Constructor Summary
MultiOccurrenceToMultiOccurrence()
           
 
Method Summary
 boolean appliesTo(FieldMap fieldMap)
          Tests whether this Specification applies to the specified MappedTypePair
 String fromMultiOccurrenceToMultiOccurrence(List<FieldMap> fieldMappings, SourceCodeContext code)
          Generates the code to support a (potentially parallel) mapping from one or more multi-occurrence fields in the source type to one or more multi-occurrence fields in the destination type.
 String generateMappingCode(List<FieldMap> fieldMappings, SourceCodeContext code)
           
 String generateMultiOccurrenceMapping(Node.NodeList sourceNodes, Node.NodeList destNodes, Set<FieldMap> subFields, SourceCodeContext code)
          Generates the code to support a (potentially parallel) mapping from one or more multi-occurrence fields in the source type to one or more multi-occurrence fields in the destination type.
 void setMapperFactory(MapperFactory mapperFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapperFactory

protected MapperFactory mapperFactory
Constructor Detail

MultiOccurrenceToMultiOccurrence

public MultiOccurrenceToMultiOccurrence()
Method Detail

fromMultiOccurrenceToMultiOccurrence

public String fromMultiOccurrenceToMultiOccurrence(List<FieldMap> fieldMappings,
                                                   SourceCodeContext code)
Generates the code to support a (potentially parallel) mapping from one or more multi-occurrence fields in the source type to one or more multi-occurrence fields in the destination type.

Parameters:
fieldMappings - the field mappings to be applied
code -
logDetails - a StringBuilder to accept debug logging information
Returns:
a reference to this SourceCodeBuilder

generateMultiOccurrenceMapping

public String generateMultiOccurrenceMapping(Node.NodeList sourceNodes,
                                             Node.NodeList destNodes,
                                             Set<FieldMap> subFields,
                                             SourceCodeContext code)
Generates the code to support a (potentially parallel) mapping from one or more multi-occurrence fields in the source type to one or more multi-occurrence fields in the destination type.

Parameters:
sourceNodes -
destNodes -
sources - the associated source variables
destinations - the associated destination variables
subFields - the nested properties of the individual field maps
code -
logDetails - a StringBuilder to accept debug logging information
Returns:
a reference to this CodeSourceBuilder

appliesTo

public boolean appliesTo(FieldMap fieldMap)
Description copied from interface: AggregateSpecification
Tests whether this Specification applies to the specified MappedTypePair

Specified by:
appliesTo in interface AggregateSpecification
Returns:
true if this specification applies to the given MappedTypePair

generateMappingCode

public String generateMappingCode(List<FieldMap> fieldMappings,
                                  SourceCodeContext code)
Specified by:
generateMappingCode in interface AggregateSpecification
Returns:

setMapperFactory

public void setMapperFactory(MapperFactory mapperFactory)
Specified by:
setMapperFactory in interface AggregateSpecification


Copyright © 2013 Glasnost. All Rights Reserved.