public abstract class AbstractSpecification extends Object implements Specification
| Modifier and Type | Field and Description |
|---|---|
protected MapperFactory |
mapperFactory |
| Constructor and Description |
|---|
AbstractSpecification() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
appliesTo(FieldMap fieldMap)
Tests whether this Specification applies to the specified MappedTypePair
|
String |
generateEqualityTestCode(FieldMap fieldMap,
VariableRef source,
VariableRef destination,
SourceCodeContext code)
Generates code for a boolean equality test between the two variable types,
where are potentially unrelated.
|
abstract String |
generateMappingCode(FieldMap fieldMap,
VariableRef source,
VariableRef destination,
SourceCodeContext code)
Generates code to map the provided field map
|
void |
setMapperFactory(MapperFactory mapperFactory) |
static boolean |
shouldMapNulls(FieldMap fieldMap,
SourceCodeContext context)
Tests whether this fieldMap should map nulls;
|
protected MapperFactory mapperFactory
public void setMapperFactory(MapperFactory mapperFactory)
setMapperFactory in interface Specificationpublic static boolean shouldMapNulls(FieldMap fieldMap, SourceCodeContext context)
fieldMap - context - public abstract boolean appliesTo(FieldMap fieldMap)
BaseSpecificationappliesTo in interface BaseSpecificationpublic String generateEqualityTestCode(FieldMap fieldMap, VariableRef source, VariableRef destination, SourceCodeContext code)
SpecificationgenerateEqualityTestCode in interface Specificationpublic abstract String generateMappingCode(FieldMap fieldMap, VariableRef source, VariableRef destination, SourceCodeContext code)
SpecificationgenerateMappingCode in interface SpecificationfieldMap - the fieldMap for which source code should be generatedsource - a convenience wrapper around the source field which can be used facilitate code generationdestination - a convenience wrapper around the destination field which can be used facilitate code generationCopyright © 2017 Glasnost. All Rights Reserved.