it.avutils.jmapper.mapper.generation
Class MappingBuilder

java.lang.Object
  extended by it.avutils.jmapper.mapper.generation.MappingBuilder

public class MappingBuilder
extends Object

MappingBuilder builds all combinations of possible mappings between classes Source and Destination.

Author:
Alessandro Vurro

Constructor Summary
MappingBuilder(Class<?> aDestination, Class<?> aSource, ChooseConfig configChoice, XML xml, Set<Method> methodsToGenerate)
          MappingBuilder takes in input all informations that need to write the mappings.
MappingBuilder(Class<?> aDestination, Class<?> aSource, String aStringOfSetDestination, String aStringOfGetDestination, String aStringOfGetSource, ChooseConfig cc, XML xml, Set<Method> methodsToGenerate)
          MappingBuilder takes in input all informations that need for to write the mappings.
 
Method Summary
 Class<?> getDestination()
           
 String getMapperName()
           
 Map<String,String> getMappings()
          Returns a Map where the keys are the mappings names and relative values are the mappings.
 Class<?> getSource()
           
 StringBuilder mapping(boolean makeDest, MappingType mtd, MappingType mts)
          This method writes the mapping based on the value of the three parameters taken in input.
 Set<Method> methodsToGenerate()
           
 MappingBuilder setMapperName(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingBuilder

public MappingBuilder(Class<?> aDestination,
                      Class<?> aSource,
                      String aStringOfSetDestination,
                      String aStringOfGetDestination,
                      String aStringOfGetSource,
                      ChooseConfig cc,
                      XML xml,
                      Set<Method> methodsToGenerate)
MappingBuilder takes in input all informations that need for to write the mappings.

Parameters:
aDestination - Type of Destination
aSource - Type of Source
aStringOfSetDestination - set destination String
aStringOfGetDestination - get destination String
aStringOfGetSource - get source String
cc - config choosen

MappingBuilder

public MappingBuilder(Class<?> aDestination,
                      Class<?> aSource,
                      ChooseConfig configChoice,
                      XML xml,
                      Set<Method> methodsToGenerate)
MappingBuilder takes in input all informations that need to write the mappings.

Parameters:
aDestination - Type of Destination
aSource - Type of Source
configChoice - configuration chosen from user
xml - xml object
Method Detail

mapping

public StringBuilder mapping(boolean makeDest,
                             MappingType mtd,
                             MappingType mts)
This method writes the mapping based on the value of the three parameters taken in input.

Parameters:
makeDest - true if destination is a new instance, false otherwise
mtd - mapping type of destination
mts - mapping type of source
Returns:
a String that contains the mapping

getMappings

public Map<String,String> getMappings()
Returns a Map where the keys are the mappings names and relative values are the mappings.

Returns:
a Map with all mapping combinations

methodsToGenerate

public Set<Method> methodsToGenerate()
Returns:
the list of methods to generate

getSource

public Class<?> getSource()
Returns:
the source class

getDestination

public Class<?> getDestination()
Returns:
the destination class

getMapperName

public String getMapperName()
Returns:
the mapper class name

setMapperName

public MappingBuilder setMapperName(String name)
Parameters:
name - the mapper class name


Copyright © 2013. All Rights Reserved.