mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#302 Formatting
This commit is contained in:
parent
b1e184811f
commit
e94acd56a4
@ -18,13 +18,8 @@
|
||||
*/
|
||||
package org.mapstruct.ap.model;
|
||||
|
||||
import static org.mapstruct.ap.model.assignment.Assignment.AssignmentType.DIRECT;
|
||||
import static org.mapstruct.ap.model.assignment.Assignment.AssignmentType.TYPE_CONVERTED;
|
||||
import static org.mapstruct.ap.model.assignment.Assignment.AssignmentType.TYPE_CONVERTED_MAPPED;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.lang.model.element.ExecutableElement;
|
||||
import javax.lang.model.type.TypeMirror;
|
||||
import javax.tools.Diagnostic;
|
||||
@ -44,6 +39,10 @@ import org.mapstruct.ap.model.source.Mapping;
|
||||
import org.mapstruct.ap.model.source.SourceMethod;
|
||||
import org.mapstruct.ap.util.Executables;
|
||||
|
||||
import static org.mapstruct.ap.model.assignment.Assignment.AssignmentType.DIRECT;
|
||||
import static org.mapstruct.ap.model.assignment.Assignment.AssignmentType.TYPE_CONVERTED;
|
||||
import static org.mapstruct.ap.model.assignment.Assignment.AssignmentType.TYPE_CONVERTED_MAPPED;
|
||||
|
||||
|
||||
/**
|
||||
* Represents the mapping between a source and target property, e.g. from
|
||||
@ -75,22 +74,22 @@ public class PropertyMapping extends ModelElement {
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyMappingBuilder souceMethod( SourceMethod sourceMethod ) {
|
||||
public PropertyMappingBuilder souceMethod(SourceMethod sourceMethod) {
|
||||
this.method = sourceMethod;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyMappingBuilder targetAccessor( ExecutableElement targetAccessor ) {
|
||||
public PropertyMappingBuilder targetAccessor(ExecutableElement targetAccessor) {
|
||||
this.targetAccessor = targetAccessor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyMappingBuilder targetPropertyName( String targetPropertyName ) {
|
||||
public PropertyMappingBuilder targetPropertyName(String targetPropertyName) {
|
||||
this.targetPropertyName = targetPropertyName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyMappingBuilder parameter( Parameter parameter ) {
|
||||
public PropertyMappingBuilder parameter(Parameter parameter) {
|
||||
this.parameter = parameter;
|
||||
return this;
|
||||
}
|
||||
@ -140,9 +139,9 @@ public class PropertyMapping extends ModelElement {
|
||||
return null;
|
||||
}
|
||||
|
||||
private PropertyMapping getPropertyMapping( ExecutableElement sourceAccessor,
|
||||
private PropertyMapping getPropertyMapping(ExecutableElement sourceAccessor,
|
||||
String dateFormat,
|
||||
List<TypeMirror> qualifiers ) {
|
||||
List<TypeMirror> qualifiers) {
|
||||
|
||||
Type sourceType;
|
||||
Type targetType;
|
||||
@ -173,7 +172,8 @@ public class PropertyMapping extends ModelElement {
|
||||
String sourcePropertyName = Executables.getPropertyName( sourceAccessor );
|
||||
String mappedElement = "property '" + sourcePropertyName + "'";
|
||||
|
||||
Assignment assignment = ctx.getMappingResolver().getTargetAssignment( method,
|
||||
Assignment assignment = ctx.getMappingResolver().getTargetAssignment(
|
||||
method,
|
||||
mappedElement,
|
||||
sourceType,
|
||||
targetType,
|
||||
@ -286,7 +286,7 @@ public class PropertyMapping extends ModelElement {
|
||||
if ( sourceType.isCollectionType() && targetType.isCollectionType() ) {
|
||||
|
||||
ForgedMethod methodToGenerate = new ForgedMethod( sourceType, targetType, element );
|
||||
IterableMappingMethod.Builder builder = new IterableMappingMethod.Builder( );
|
||||
IterableMappingMethod.Builder builder = new IterableMappingMethod.Builder();
|
||||
|
||||
|
||||
IterableMappingMethod iterableMappingMethod = builder
|
||||
@ -305,7 +305,7 @@ public class PropertyMapping extends ModelElement {
|
||||
|
||||
ForgedMethod methodToGenerate = new ForgedMethod( sourceType, targetType, element );
|
||||
|
||||
MapMappingMethod.Builder builder = new MapMappingMethod.Builder( );
|
||||
MapMappingMethod.Builder builder = new MapMappingMethod.Builder();
|
||||
MapMappingMethod mapMappingMethod = builder
|
||||
.mappingContext( ctx )
|
||||
.method( methodToGenerate )
|
||||
@ -335,27 +335,27 @@ public class PropertyMapping extends ModelElement {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConstantMappingBuilder sourceMethod( SourceMethod sourceMethod ) {
|
||||
public ConstantMappingBuilder sourceMethod(SourceMethod sourceMethod) {
|
||||
this.method = sourceMethod;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConstantMappingBuilder constantExpression( String constantExpression ) {
|
||||
public ConstantMappingBuilder constantExpression(String constantExpression) {
|
||||
this.constantExpression = constantExpression;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConstantMappingBuilder targetAccessor( ExecutableElement targetAccessor ) {
|
||||
public ConstantMappingBuilder targetAccessor(ExecutableElement targetAccessor) {
|
||||
this.targetAccessor = targetAccessor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConstantMappingBuilder dateFormat( String dateFormat ) {
|
||||
public ConstantMappingBuilder dateFormat(String dateFormat) {
|
||||
this.dateFormat = dateFormat;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConstantMappingBuilder qualifiers( List<TypeMirror> qualifiers ) {
|
||||
public ConstantMappingBuilder qualifiers(List<TypeMirror> qualifiers) {
|
||||
this.qualifiers = qualifiers;
|
||||
return this;
|
||||
}
|
||||
@ -377,7 +377,8 @@ public class PropertyMapping extends ModelElement {
|
||||
|
||||
String targetPropertyName = Executables.getPropertyName( targetAccessor );
|
||||
|
||||
Assignment assignment = ctx.getMappingResolver().getTargetAssignment( method,
|
||||
Assignment assignment = ctx.getMappingResolver().getTargetAssignment(
|
||||
method,
|
||||
mappedElement,
|
||||
sourceType,
|
||||
targetType,
|
||||
@ -427,17 +428,17 @@ public class PropertyMapping extends ModelElement {
|
||||
return this;
|
||||
}
|
||||
|
||||
public JavaExpressionMappingBuilder souceMethod( SourceMethod sourceMethod ) {
|
||||
public JavaExpressionMappingBuilder souceMethod(SourceMethod sourceMethod) {
|
||||
this.method = sourceMethod;
|
||||
return this;
|
||||
}
|
||||
|
||||
public JavaExpressionMappingBuilder javaExpression( String javaExpression ) {
|
||||
public JavaExpressionMappingBuilder javaExpression(String javaExpression) {
|
||||
this.javaExpression = javaExpression;
|
||||
return this;
|
||||
}
|
||||
|
||||
public JavaExpressionMappingBuilder targetAccessor( ExecutableElement targetAccessor ) {
|
||||
public JavaExpressionMappingBuilder targetAccessor(ExecutableElement targetAccessor) {
|
||||
this.targetAccessor = targetAccessor;
|
||||
return this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user