|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectma.glasnost.orika.metadata.ClassMapBuilder<A,B>
ma.glasnost.orika.metadata.ScoringClassMapBuilder<A,B>
A - B - public class ScoringClassMapBuilder<A,B>
ScoringClassMapBuilder is an extension of the basic ClassMapBuilder that
attempts to compute a best-fit matching of all properties (at every level
of nesting) of one type to another, based on various metrics used to measure
a given property match.
Since this builder generates mappings based on scoring matches, it cannot always
guess the correct mappings; be sure to test and double-check the mappings
generated to assure they match expectations.
Note: levenshtein distance implementation is pulled from code found in
Apache Commons Lang org.apache.commons.lang.StringUtils, which is based on
the implementation provided by Chas Emerick
http://www.merriampark.com/ldjava.htm
| Nested Class Summary | |
|---|---|
static class |
ScoringClassMapBuilder.Factory
|
static class |
ScoringClassMapBuilder.FieldMatchScore
FieldMatchScore is used to score the match of a pair of property expressions |
static class |
ScoringClassMapBuilder.PropertyMatchingWeights
PropertyMatchingWeights is a class used to describe how different matching scenarios should be weighted when computing a match score for a set of properties. |
| Constructor Summary | |
|---|---|
protected |
ScoringClassMapBuilder(Type<A> aType,
Type<B> bType,
MapperFactory mapperFactory,
PropertyResolverStrategy propertyResolver,
DefaultFieldMapper[] defaults,
ScoringClassMapBuilder.PropertyMatchingWeights matchingWeights)
Constructs a new instance of ScoringClassMapBuilder, using the provided PropertyMatchingWeights to adjust the overall scoring of how properties are matched. |
| Method Summary | |
|---|---|
ClassMapBuilder<A,B> |
byDefault(DefaultFieldMapper... withDefaults)
Configures this class-map builder to employ the default property mapping behavior to any properties that have not already been mapped or excluded; if any DefaultFieldMapper instances are passed, they will be used (instead of those configured on the builder) to attempt a property name match if a direct match is not found. |
protected Map<String,Property> |
getPropertyExpressions(Type<?> type)
Gets all of the property expressions for a given type, including all nested properties. |
| Methods inherited from class ma.glasnost.orika.metadata.ClassMapBuilder |
|---|
addFieldMap, byDefault, byDefault, constructorA, constructorB, customize, customize, describeClassMap, exclude, field, field, field, field, field, field, field, fieldAToB, fieldBToA, fieldMap, fieldMap, fieldMap, fieldMap, fieldMap, fieldMap, fieldMap, fieldMap, fieldMap, fieldMap, getAType, getBType, getDefaultFieldMappers, getMappedFields, getMappedPropertiesForTypeA, getMappedPropertiesForTypeB, getPropertiesForTypeA, getPropertiesForTypeB, getPropertyResolver, isNestedPropertyExpression, map, map, map, map, mapNulls, mapNullsInReverse, register, resolveProperty, resolvePropertyForA, resolvePropertyForB, toClassMap, toString, use, use |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected ScoringClassMapBuilder(Type<A> aType,
Type<B> bType,
MapperFactory mapperFactory,
PropertyResolverStrategy propertyResolver,
DefaultFieldMapper[] defaults,
ScoringClassMapBuilder.PropertyMatchingWeights matchingWeights)
aType - bType - propertyResolver - defaults - | Method Detail |
|---|
protected Map<String,Property> getPropertyExpressions(Type<?> type)
type - the type for which to gather properties
public ClassMapBuilder<A,B> byDefault(DefaultFieldMapper... withDefaults)
ClassMapBuilder
byDefault in class ClassMapBuilder<A,B>withDefaults - zero or more DefaultFieldMapper instances to apply during the default mapping;
if none are supplied, the configured DefaultFieldMappers for the builder (if any) should be used.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||