From 213d0a77d3061676ea401258f1b8079442e4fc25 Mon Sep 17 00:00:00 2001 From: Gareth Healy Date: Sat, 9 Jun 2018 22:21:14 +0100 Subject: [PATCH] Removed dead method and minor cleanup (#646) --- .../model/elengine/ELAllowedExceptionsDefinition.java | 3 +++ .../core/builder/model/elengine/ELClassDefinition.java | 3 +++ .../model/elengine/ELConfigurationDefinition.java | 3 +++ .../model/elengine/ELConverterTypeDefinition.java | 3 +++ .../model/elengine/ELCopyByReferencesDefinition.java | 3 +++ .../model/elengine/ELCustomConvertersDefinition.java | 3 +++ .../core/builder/model/elengine/ELFieldDefinition.java | 10 ++++++---- .../builder/model/elengine/ELMappingDefinition.java | 5 ++++- .../builder/model/elengine/ELMappingsDefinition.java | 3 +++ .../builder/model/elengine/ELVariableDefinition.java | 3 +++ .../builder/model/elengine/ELVariablesDefinition.java | 3 +++ .../core/builder/model/jaxb/FieldDefinition.java | 10 +++------- .../core/builder/model/jaxb/MappingDefinition.java | 2 +- .../builder/fluent/BeanMappingsFluentBuilderTest.java | 7 ++++--- 14 files changed, 45 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELAllowedExceptionsDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELAllowedExceptionsDefinition.java index 936c30f34..c84bb818d 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELAllowedExceptionsDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELAllowedExceptionsDefinition.java @@ -23,6 +23,9 @@ import com.github.dozermapper.core.config.BeanContainer; import com.github.dozermapper.core.el.ELEngine; +/** + * {@inheritDoc} + */ public class ELAllowedExceptionsDefinition extends AllowedExceptionsDefinition { private final ELEngine elEngine; diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELClassDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELClassDefinition.java index 38c4f38ca..d82e1c738 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELClassDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELClassDefinition.java @@ -24,6 +24,9 @@ import org.apache.commons.lang3.StringUtils; +/** + * {@inheritDoc} + */ public class ELClassDefinition extends ClassDefinition { private final ELEngine elEngine; diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELConfigurationDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELConfigurationDefinition.java index ca4561dd5..4b2792f9c 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELConfigurationDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELConfigurationDefinition.java @@ -27,6 +27,9 @@ import org.apache.commons.lang3.StringUtils; +/** + * {@inheritDoc} + */ public class ELConfigurationDefinition extends ConfigurationDefinition { private final ELEngine elEngine; diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELConverterTypeDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELConverterTypeDefinition.java index ae081e225..abce40ffc 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELConverterTypeDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELConverterTypeDefinition.java @@ -24,6 +24,9 @@ import org.apache.commons.lang3.StringUtils; +/** + * {@inheritDoc} + */ public class ELConverterTypeDefinition extends ConverterTypeDefinition { private final ELEngine elEngine; diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELCopyByReferencesDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELCopyByReferencesDefinition.java index 59fc7a542..bbf5bdf57 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELCopyByReferencesDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELCopyByReferencesDefinition.java @@ -23,6 +23,9 @@ import com.github.dozermapper.core.classmap.CopyByReference; import com.github.dozermapper.core.el.ELEngine; +/** + * {@inheritDoc} + */ public class ELCopyByReferencesDefinition extends CopyByReferencesDefinition { private final ELEngine elEngine; diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELCustomConvertersDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELCustomConvertersDefinition.java index 31987b4c2..79d8d03e0 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELCustomConvertersDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELCustomConvertersDefinition.java @@ -23,6 +23,9 @@ import com.github.dozermapper.core.builder.model.jaxb.CustomConvertersDefinition; import com.github.dozermapper.core.el.ELEngine; +/** + * {@inheritDoc} + */ public class ELCustomConvertersDefinition extends CustomConvertersDefinition { private final ELEngine elEngine; diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELFieldDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELFieldDefinition.java index 55c04664a..18b60893e 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELFieldDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELFieldDefinition.java @@ -16,7 +16,6 @@ package com.github.dozermapper.core.builder.model.elengine; import com.github.dozermapper.core.builder.model.jaxb.FieldDefinition; -import com.github.dozermapper.core.builder.model.jaxb.FieldExcludeDefinition; import com.github.dozermapper.core.builder.model.jaxb.MappingDefinition; import com.github.dozermapper.core.classmap.ClassMap; import com.github.dozermapper.core.config.BeanContainer; @@ -27,12 +26,15 @@ import org.apache.commons.lang3.StringUtils; +/** + * {@inheritDoc} + */ public class ELFieldDefinition extends FieldDefinition { private final ELEngine elEngine; public ELFieldDefinition(ELEngine elEngine, FieldDefinition copy) { - this(elEngine, null, null); + this(elEngine, (MappingDefinition)null); if (copy != null) { this.a = copy.getA(); @@ -52,8 +54,8 @@ public ELFieldDefinition(ELEngine elEngine, FieldDefinition copy) { } } - public ELFieldDefinition(ELEngine elEngine, MappingDefinition parent, FieldExcludeDefinition fieldExcludeParent) { - super(parent, fieldExcludeParent); + public ELFieldDefinition(ELEngine elEngine, MappingDefinition parent) { + super(parent); this.elEngine = elEngine; } diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELMappingDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELMappingDefinition.java index d79016a95..a149a2007 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELMappingDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELMappingDefinition.java @@ -30,6 +30,9 @@ import org.apache.commons.lang3.StringUtils; +/** + * {@inheritDoc} + */ public class ELMappingDefinition extends MappingDefinition { private final ELEngine elEngine; @@ -76,7 +79,7 @@ public FieldDefinition withField() { setFields(new ArrayList<>()); } - ELFieldDefinition field = new ELFieldDefinition(elEngine, this, null); + ELFieldDefinition field = new ELFieldDefinition(elEngine, this); getFields().add(field); return field; diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELMappingsDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELMappingsDefinition.java index ecd4acba4..e83e955dc 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELMappingsDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELMappingsDefinition.java @@ -23,6 +23,9 @@ import com.github.dozermapper.core.builder.model.jaxb.MappingsDefinition; import com.github.dozermapper.core.el.ELEngine; +/** + * {@inheritDoc} + */ public class ELMappingsDefinition extends MappingsDefinition { private final ELEngine elEngine; diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELVariableDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELVariableDefinition.java index c9ed1ee63..cf5415aa4 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELVariableDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELVariableDefinition.java @@ -21,6 +21,9 @@ import org.apache.commons.lang3.StringUtils; +/** + * {@inheritDoc} + */ public class ELVariableDefinition extends VariableDefinition { private final ELEngine elEngine; diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELVariablesDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELVariablesDefinition.java index 9df280820..f44246557 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELVariablesDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/elengine/ELVariablesDefinition.java @@ -23,6 +23,9 @@ import com.github.dozermapper.core.builder.model.jaxb.VariablesDefinition; import com.github.dozermapper.core.el.ELEngine; +/** + * {@inheritDoc} + */ public class ELVariablesDefinition extends VariablesDefinition { private final ELEngine elEngine; diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/jaxb/FieldDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/jaxb/FieldDefinition.java index c939f7b77..a8e52c1b1 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/jaxb/FieldDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/jaxb/FieldDefinition.java @@ -133,12 +133,12 @@ public class FieldDefinition { protected String customConverterParam; public FieldDefinition() { - this(null, null); + this(null); } - public FieldDefinition(MappingDefinition parentMappingDefinition, FieldExcludeDefinition parentFieldExclude) { + public FieldDefinition(MappingDefinition parentMappingDefinition) { this.parentMappingDefinition = parentMappingDefinition; - this.parentFieldExclude = parentFieldExclude; + this.parentFieldExclude = null; } @@ -230,10 +230,6 @@ public FieldDefinition withCustomConverterParam(String customConverterParam) { return this; } - public FieldExcludeDefinition endFieldExclude() { - return parentFieldExclude; - } - public MappingDefinition end() { return parentMappingDefinition; } diff --git a/core/src/main/java/com/github/dozermapper/core/builder/model/jaxb/MappingDefinition.java b/core/src/main/java/com/github/dozermapper/core/builder/model/jaxb/MappingDefinition.java index 271d2270a..e989a847a 100644 --- a/core/src/main/java/com/github/dozermapper/core/builder/model/jaxb/MappingDefinition.java +++ b/core/src/main/java/com/github/dozermapper/core/builder/model/jaxb/MappingDefinition.java @@ -176,7 +176,7 @@ public FieldDefinition withField() { setFields(new ArrayList<>()); } - FieldDefinition field = new FieldDefinition(this, null); + FieldDefinition field = new FieldDefinition(this); getFields().add(field); return field; diff --git a/core/src/test/java/com/github/dozermapper/core/builder/fluent/BeanMappingsFluentBuilderTest.java b/core/src/test/java/com/github/dozermapper/core/builder/fluent/BeanMappingsFluentBuilderTest.java index 4bdd07ef0..f00492553 100644 --- a/core/src/test/java/com/github/dozermapper/core/builder/fluent/BeanMappingsFluentBuilderTest.java +++ b/core/src/test/java/com/github/dozermapper/core/builder/fluent/BeanMappingsFluentBuilderTest.java @@ -83,7 +83,7 @@ protected void configure() { .withWildcardCaseInsensitive(false) .withMapEmptyString(true) .withDateFormat("MM/dd/yyyy HH:mm") - .withRelationshipType(Relationship.CUMULATIVE) + .withRelationshipType(Relationship.fromValue("cumulative")) .end(); // @formatter:on @@ -97,7 +97,7 @@ protected void configure() { .withMapEmptyString(true) .withDateFormat("MM/dd/yyyy HH:mm") .withMapId("A") - .withType(Type.ONE_WAY) + .withType(Type.fromValue("one-way")) .withBeanFactory(JAXBBeanFactory.class.getName()) .withRelationshipType(Relationship.CUMULATIVE) .withClassA() @@ -133,7 +133,7 @@ protected void configure() { .withMapSetMethod("put") .withDateFormat("MM/dd/yyyy HH:mm") .withKey("id") - .withType(FieldType.GENERIC) + .withType(FieldType.fromValue("generic")) .withSetMethod("set") .withGetMethod("get") .end() @@ -149,6 +149,7 @@ protected void configure() { .withSetMethod("set") .withGetMethod("get") .end() + .withType(Type.ONE_WAY) .end() .withField() .withCopyByReference(true)