|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectit.avutils.jmapper.JMapper<D,S>
D - Type of the Destination ClassS - Type of Source Classpublic final class JMapper<D,S>
JMapper takes as input two classes, Destination and Source.
For Destination, we mean the instance that will be created or enhanced.
For Source, we mean the instance containing the data.
To execute the mapping, we must before configure one class between Destination and Source.
for example:
class Destination {
@JMap
String id;
@JMap("sourceField")
String destinationField;
String other;
// getter and setter
}
class Source {
String id;
String sourceField;
String other;
// getter and setter
}
then invoke the method GetDestination.
Source source = new Source("id", "sourceField", "other");
JMapper jmapper = new JMapper(Destination.class, Source.class);
// new instance
Destination destination = jmapper.getDestination(source);
// enrichment
jmapper.getDestination(destination, source);
| Constructor Summary | |
|---|---|
JMapper(Class<D> destination,
Class<S> source)
Constructs a JMapper that handles two classes: the class of destination and the class of source. |
|
JMapper(Class<D> destination,
Class<S> source,
ChooseConfig chooseConfig)
Constructs a JMapper that handles two classes: the class of destination and the class of source. |
|
JMapper(Class<D> destination,
Class<S> source,
ChooseConfig config,
String xmlPath)
Constructs a JMapper that handles two classes: the class of destination and the class of source. |
|
JMapper(Class<D> destination,
Class<S> source,
String xmlPath)
Constructs a JMapper that handles two classes: the class of destination and the class of source. |
|
| Method Summary | |
|---|---|
IMapper<D,S> |
createMapper(MapperBuilder mapper)
|
D |
getDestination(D destination,
S source)
This Method returns the destination given in input enriched with data contained in source given in input with this setting: NullPointerControlALL
MappingType of DestinationALL_FIELDS |
D |
getDestination(D destination,
S source,
MappingType mtDestination,
MappingType mtSource)
This Method returns the destination given in input enriched with data contained in source given in input with this setting: NullPointerControlALL
MappingType of DestinationmtDestination
MappingType of SourcemtSource
|
D |
getDestination(D destination,
S source,
NullPointerControl nullPointerControl,
MappingType mtDestination,
MappingType mtSource)
This Method returns the destination given in input enriched with data contained in source given in input with this setting: NullPointerControlnullPointerControl
MappingType of DestinationmtDestination
MappingType of SourcemtSource
|
D |
getDestination(S source)
This method returns a new instance of Destination Class with this setting: NullPointerControlSOURCE
MappingType of DestinationALL_FIELDS |
D |
getDestination(S source,
MappingType mtSource)
This method returns a new instance of Destination Class with this setting: NullPointerControlSOURCE
MappingType of DestinationALL_FIELDS |
D |
getDestination(S source,
NullPointerControl nullPointerControl,
MappingType mtSource)
This method returns a new instance of Destination Class with this setting: NullPointerControlnullPointerControl
MappingType of DestinationALL_FIELDS |
D |
getDestinationWithoutControl(D destination,
S source)
This Method returns the destination given in input enriched with data contained in source given in input with this setting: NullPointerControlNOT_ANY
MappingType of DestinationALL_FIELDS |
D |
getDestinationWithoutControl(S source)
This method returns a new instance of Destination Class with this setting: NullPointerControlNOT_ANY
MappingType of DestinationALL_FIELDS |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JMapper(Class<D> destination,
Class<S> source)
destination - the Destination Classsource - the Source Class
public JMapper(Class<D> destination,
Class<S> source,
ChooseConfig chooseConfig)
destination - the Destination Classsource - the Source ClasschooseConfig - the configuration to loadChooseConfig
public JMapper(Class<D> destination,
Class<S> source,
String xmlPath)
destination - the Destination Classsource - the Source ClassxmlPath - xml configuration pathChooseConfig
public JMapper(Class<D> destination,
Class<S> source,
ChooseConfig config,
String xmlPath)
destination - the Destination Classsource - the Source Classconfig - the configuration to loadxmlPath - xml configuration pathChooseConfig| Method Detail |
|---|
public D getDestination(S source)
NullPointerControl | SOURCE |
MappingType of Destination | ALL_FIELDS |
MappingType of Source | ALL_FIELDS |
getDestination in interface IJMapper<D,S>source - instance that contains the data
NullPointerControl,
MappingTypepublic D getDestinationWithoutControl(S source)
NullPointerControl | NOT_ANY |
MappingType of Destination | ALL_FIELDS |
MappingType of Source | ALL_FIELDS |
getDestinationWithoutControl in interface IJMapper<D,S>source - instance that contains the data
NullPointerControl,
MappingType
public D getDestination(D destination,
S source)
NullPointerControl | ALL |
MappingType of Destination | ALL_FIELDS |
MappingType of Source | ALL_FIELDS |
getDestination in interface IJMapper<D,S>destination - instance to enrichsource - instance that contains the data
NullPointerControl,
MappingType
public D getDestinationWithoutControl(D destination,
S source)
NullPointerControl | NOT_ANY |
MappingType of Destination | ALL_FIELDS |
MappingType of Source | ALL_FIELDS |
getDestinationWithoutControl in interface IJMapper<D,S>destination - instance to enrichsource - instance that contains the data
NullPointerControl,
MappingType
public D getDestination(S source,
MappingType mtSource)
NullPointerControl | SOURCE |
MappingType of Destination | ALL_FIELDS |
MappingType of Source | mtSource |
getDestination in interface IJMapper<D,S>source - instance that contains the datamtSource - type of mapping
NullPointerControl,
MappingType
public D getDestination(S source,
NullPointerControl nullPointerControl,
MappingType mtSource)
NullPointerControl | nullPointerControl |
MappingType of Destination | ALL_FIELDS |
MappingType of Source | mtSource |
getDestination in interface IJMapper<D,S>source - instance that contains the datanullPointerControl - type of controlmtSource - type of mapping
NullPointerControl,
MappingType
public D getDestination(D destination,
S source,
MappingType mtDestination,
MappingType mtSource)
NullPointerControl | ALL |
MappingType of Destination | mtDestination |
MappingType of Source | mtSource |
getDestination in interface IJMapper<D,S>destination - instance to enrichsource - instance that contains the datamtDestination - type of mapping of destination instancemtSource - type of mapping of source instance
NullPointerControl,
MappingType
public D getDestination(D destination,
S source,
NullPointerControl nullPointerControl,
MappingType mtDestination,
MappingType mtSource)
NullPointerControl | nullPointerControl |
MappingType of Destination | mtDestination |
MappingType of Source | mtSource |
getDestination in interface IJMapper<D,S>destination - instance to enrichsource - instance that contains the datanullPointerControl - type of controlmtDestination - type of mapping of destination instancemtSource - type of mapping of source instance
NullPointerControl,
MappingType
public IMapper<D,S> createMapper(MapperBuilder mapper)
throws javassist.NotFoundException,
Exception
javassist.NotFoundException
Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||