diff --git a/processor/src/main/java/org/mapstruct/ap/conversion/ConversionProvider.java b/processor/src/main/java/org/mapstruct/ap/conversion/ConversionProvider.java index a5e8bc4c7..eddce812a 100644 --- a/processor/src/main/java/org/mapstruct/ap/conversion/ConversionProvider.java +++ b/processor/src/main/java/org/mapstruct/ap/conversion/ConversionProvider.java @@ -20,9 +20,9 @@ package org.mapstruct.ap.conversion; import java.util.Date; -import org.mapstruct.ap.model.Type; import org.mapstruct.ap.model.TypeConversion; -import org.mapstruct.ap.model.TypeFactory; +import org.mapstruct.ap.model.common.Type; +import org.mapstruct.ap.model.common.TypeFactory; /** * Implementations create inline {@link TypeConversion}s such as diff --git a/processor/src/main/java/org/mapstruct/ap/conversion/Conversions.java b/processor/src/main/java/org/mapstruct/ap/conversion/Conversions.java index 1e47a1c9b..f5f4f58ba 100644 --- a/processor/src/main/java/org/mapstruct/ap/conversion/Conversions.java +++ b/processor/src/main/java/org/mapstruct/ap/conversion/Conversions.java @@ -26,8 +26,8 @@ import java.util.Map; import javax.lang.model.util.Elements; -import org.mapstruct.ap.model.Type; -import org.mapstruct.ap.model.TypeFactory; +import org.mapstruct.ap.model.common.Type; +import org.mapstruct.ap.model.common.TypeFactory; import static org.mapstruct.ap.conversion.ReverseConversion.reverse; diff --git a/processor/src/main/java/org/mapstruct/ap/conversion/DateToStringConversion.java b/processor/src/main/java/org/mapstruct/ap/conversion/DateToStringConversion.java index 68be645a7..59dae76e7 100644 --- a/processor/src/main/java/org/mapstruct/ap/conversion/DateToStringConversion.java +++ b/processor/src/main/java/org/mapstruct/ap/conversion/DateToStringConversion.java @@ -24,8 +24,8 @@ import java.util.Arrays; import java.util.Collections; import java.util.Date; -import org.mapstruct.ap.model.Type; import org.mapstruct.ap.model.TypeConversion; +import org.mapstruct.ap.model.common.Type; import static org.mapstruct.ap.util.Collections.asSet; diff --git a/processor/src/main/java/org/mapstruct/ap/conversion/DefaultConversionContext.java b/processor/src/main/java/org/mapstruct/ap/conversion/DefaultConversionContext.java index 8e251db5a..726de941d 100644 --- a/processor/src/main/java/org/mapstruct/ap/conversion/DefaultConversionContext.java +++ b/processor/src/main/java/org/mapstruct/ap/conversion/DefaultConversionContext.java @@ -19,8 +19,8 @@ package org.mapstruct.ap.conversion; import org.mapstruct.ap.conversion.ConversionProvider.Context; -import org.mapstruct.ap.model.Type; -import org.mapstruct.ap.model.TypeFactory; +import org.mapstruct.ap.model.common.Type; +import org.mapstruct.ap.model.common.TypeFactory; /** * Default implementation of the {@link Context} passed to conversion providers. diff --git a/processor/src/main/java/org/mapstruct/ap/model/Annotation.java b/processor/src/main/java/org/mapstruct/ap/model/Annotation.java index 894b69ab8..fa764bd5e 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/Annotation.java +++ b/processor/src/main/java/org/mapstruct/ap/model/Annotation.java @@ -21,6 +21,9 @@ package org.mapstruct.ap.model; import java.util.Collections; import java.util.Set; +import org.mapstruct.ap.model.common.ModelElement; +import org.mapstruct.ap.model.common.Type; + /** * Represents a Java 5 annotation. * diff --git a/processor/src/main/java/org/mapstruct/ap/model/AnnotationMapperReference.java b/processor/src/main/java/org/mapstruct/ap/model/AnnotationMapperReference.java index 6986be4a2..b0504b2f9 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/AnnotationMapperReference.java +++ b/processor/src/main/java/org/mapstruct/ap/model/AnnotationMapperReference.java @@ -21,6 +21,7 @@ package org.mapstruct.ap.model; import java.beans.Introspector; import java.util.Set; +import org.mapstruct.ap.model.common.Type; import org.mapstruct.ap.util.Collections; import org.mapstruct.ap.util.Strings; diff --git a/processor/src/main/java/org/mapstruct/ap/model/BeanMappingMethod.java b/processor/src/main/java/org/mapstruct/ap/model/BeanMappingMethod.java index c2c6606ca..bd34737bc 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/BeanMappingMethod.java +++ b/processor/src/main/java/org/mapstruct/ap/model/BeanMappingMethod.java @@ -24,6 +24,8 @@ import java.util.List; import java.util.Map; import java.util.Set; +import org.mapstruct.ap.model.common.Parameter; +import org.mapstruct.ap.model.common.Type; import org.mapstruct.ap.model.source.Method; /** diff --git a/processor/src/main/java/org/mapstruct/ap/model/DefaultMapperReference.java b/processor/src/main/java/org/mapstruct/ap/model/DefaultMapperReference.java index a5ac8c8f5..62c65d390 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/DefaultMapperReference.java +++ b/processor/src/main/java/org/mapstruct/ap/model/DefaultMapperReference.java @@ -21,6 +21,8 @@ package org.mapstruct.ap.model; import java.beans.Introspector; import java.util.Set; +import org.mapstruct.ap.model.common.Type; +import org.mapstruct.ap.model.common.TypeFactory; import org.mapstruct.ap.util.Collections; import org.mapstruct.ap.util.Strings; diff --git a/processor/src/main/java/org/mapstruct/ap/model/IterableMappingMethod.java b/processor/src/main/java/org/mapstruct/ap/model/IterableMappingMethod.java index 7ebc04779..521435d22 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/IterableMappingMethod.java +++ b/processor/src/main/java/org/mapstruct/ap/model/IterableMappingMethod.java @@ -21,6 +21,8 @@ package org.mapstruct.ap.model; import java.beans.Introspector; import java.util.Set; +import org.mapstruct.ap.model.common.Parameter; +import org.mapstruct.ap.model.common.Type; import org.mapstruct.ap.model.source.Method; import org.mapstruct.ap.util.Strings; diff --git a/processor/src/main/java/org/mapstruct/ap/model/MapMappingMethod.java b/processor/src/main/java/org/mapstruct/ap/model/MapMappingMethod.java index 1e81bc308..66a1e409b 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/MapMappingMethod.java +++ b/processor/src/main/java/org/mapstruct/ap/model/MapMappingMethod.java @@ -20,6 +20,8 @@ package org.mapstruct.ap.model; import java.util.Set; +import org.mapstruct.ap.model.common.Parameter; +import org.mapstruct.ap.model.common.Type; import org.mapstruct.ap.model.source.Method; import org.mapstruct.ap.util.Strings; diff --git a/processor/src/main/java/org/mapstruct/ap/model/Mapper.java b/processor/src/main/java/org/mapstruct/ap/model/Mapper.java index d825ad78f..0eef76753 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/Mapper.java +++ b/processor/src/main/java/org/mapstruct/ap/model/Mapper.java @@ -29,6 +29,10 @@ import javax.lang.model.element.ElementKind; import javax.lang.model.element.TypeElement; import javax.lang.model.util.Elements; +import org.mapstruct.ap.model.common.ModelElement; +import org.mapstruct.ap.model.common.Type; +import org.mapstruct.ap.model.common.TypeFactory; + /** * Represents a type implementing a mapper interface (annotated with {@code @Mapper}). This is the root object of the * mapper model. diff --git a/processor/src/main/java/org/mapstruct/ap/model/MapperReference.java b/processor/src/main/java/org/mapstruct/ap/model/MapperReference.java index 2ae730ba1..bc5bb0e4d 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/MapperReference.java +++ b/processor/src/main/java/org/mapstruct/ap/model/MapperReference.java @@ -18,6 +18,9 @@ */ package org.mapstruct.ap.model; +import org.mapstruct.ap.model.common.ModelElement; +import org.mapstruct.ap.model.common.Type; + /** * A reference to another mapper class, which itself may be generated or hand-written. * diff --git a/processor/src/main/java/org/mapstruct/ap/model/MappingMethod.java b/processor/src/main/java/org/mapstruct/ap/model/MappingMethod.java index 92a54b63d..a05497596 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/MappingMethod.java +++ b/processor/src/main/java/org/mapstruct/ap/model/MappingMethod.java @@ -24,6 +24,9 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import org.mapstruct.ap.model.common.ModelElement; +import org.mapstruct.ap.model.common.Parameter; +import org.mapstruct.ap.model.common.Type; import org.mapstruct.ap.model.source.Method; import org.mapstruct.ap.util.Strings; diff --git a/processor/src/main/java/org/mapstruct/ap/model/MappingMethodReference.java b/processor/src/main/java/org/mapstruct/ap/model/MappingMethodReference.java index ac23a0d9c..64d54d3c4 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/MappingMethodReference.java +++ b/processor/src/main/java/org/mapstruct/ap/model/MappingMethodReference.java @@ -22,6 +22,7 @@ import java.beans.Introspector; import java.util.HashSet; import java.util.Set; +import org.mapstruct.ap.model.common.Type; import org.mapstruct.ap.model.source.Method; import org.mapstruct.ap.util.Strings; diff --git a/processor/src/main/java/org/mapstruct/ap/model/PropertyMapping.java b/processor/src/main/java/org/mapstruct/ap/model/PropertyMapping.java index e6e3b716e..5659fcc21 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/PropertyMapping.java +++ b/processor/src/main/java/org/mapstruct/ap/model/PropertyMapping.java @@ -21,6 +21,9 @@ package org.mapstruct.ap.model; import java.util.HashSet; import java.util.Set; +import org.mapstruct.ap.model.common.ModelElement; +import org.mapstruct.ap.model.common.Type; + /** * Represents the mapping between a source and target property, e.g. from * {@code String Source#foo} to {@code int Target#bar}. Name and type of source diff --git a/processor/src/main/java/org/mapstruct/ap/model/TypeConversion.java b/processor/src/main/java/org/mapstruct/ap/model/TypeConversion.java index 8b0cf76d6..2ea38c53d 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/TypeConversion.java +++ b/processor/src/main/java/org/mapstruct/ap/model/TypeConversion.java @@ -23,6 +23,9 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import org.mapstruct.ap.model.common.ModelElement; +import org.mapstruct.ap.model.common.Type; + /** * An inline conversion between source and target type of a mapping. * diff --git a/processor/src/main/java/org/mapstruct/ap/model/ModelElement.java b/processor/src/main/java/org/mapstruct/ap/model/common/ModelElement.java similarity index 97% rename from processor/src/main/java/org/mapstruct/ap/model/ModelElement.java rename to processor/src/main/java/org/mapstruct/ap/model/common/ModelElement.java index dfac6aee3..2714ac50e 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/ModelElement.java +++ b/processor/src/main/java/org/mapstruct/ap/model/common/ModelElement.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.mapstruct.ap.model; +package org.mapstruct.ap.model.common; import java.io.Writer; import java.util.Set; diff --git a/processor/src/main/java/org/mapstruct/ap/model/common/Parameter.java b/processor/src/main/java/org/mapstruct/ap/model/common/Parameter.java index e913d239b..d54a72c92 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/common/Parameter.java +++ b/processor/src/main/java/org/mapstruct/ap/model/common/Parameter.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.mapstruct.ap.model; +package org.mapstruct.ap.model.common; import java.util.Set; diff --git a/processor/src/main/java/org/mapstruct/ap/model/common/Type.java b/processor/src/main/java/org/mapstruct/ap/model/common/Type.java index 751ec5ce8..88709c175 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/common/Type.java +++ b/processor/src/main/java/org/mapstruct/ap/model/common/Type.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.mapstruct.ap.model; +package org.mapstruct.ap.model.common; import java.util.Collections; import java.util.List; diff --git a/processor/src/main/java/org/mapstruct/ap/model/common/TypeFactory.java b/processor/src/main/java/org/mapstruct/ap/model/common/TypeFactory.java index fdefc98ff..fd2179a2a 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/common/TypeFactory.java +++ b/processor/src/main/java/org/mapstruct/ap/model/common/TypeFactory.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.mapstruct.ap.model; +package org.mapstruct.ap.model.common; import java.util.ArrayList; import java.util.Collection; diff --git a/processor/src/main/java/org/mapstruct/ap/model/common/package-info.java b/processor/src/main/java/org/mapstruct/ap/model/common/package-info.java new file mode 100644 index 000000000..abf0f0492 --- /dev/null +++ b/processor/src/main/java/org/mapstruct/ap/model/common/package-info.java @@ -0,0 +1,24 @@ +/** + * Copyright 2012-2014 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + *

+ * Contains types which are shared between the intermediary mapping method model ("source model") and the mapper model. + *

+ */ +package org.mapstruct.ap.model.common; diff --git a/processor/src/main/java/org/mapstruct/ap/model/source/Method.java b/processor/src/main/java/org/mapstruct/ap/model/source/Method.java index eece09af2..dace1d096 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/source/Method.java +++ b/processor/src/main/java/org/mapstruct/ap/model/source/Method.java @@ -22,11 +22,12 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; + import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; -import org.mapstruct.ap.model.Parameter; -import org.mapstruct.ap.model.Type; +import org.mapstruct.ap.model.common.Parameter; +import org.mapstruct.ap.model.common.Type; import org.mapstruct.ap.util.Strings; /** diff --git a/processor/src/main/java/org/mapstruct/ap/model/source/MethodMatcher.java b/processor/src/main/java/org/mapstruct/ap/model/source/MethodMatcher.java index b9fe199d0..3a9703b67 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/source/MethodMatcher.java +++ b/processor/src/main/java/org/mapstruct/ap/model/source/MethodMatcher.java @@ -35,7 +35,7 @@ import javax.lang.model.type.WildcardType; import javax.lang.model.util.SimpleTypeVisitor6; import javax.lang.model.util.Types; -import org.mapstruct.ap.model.Type; +import org.mapstruct.ap.model.common.Type; /** * MethodMatcher $8.4 of the JavaLanguage specification describes a method body as such: diff --git a/processor/src/main/java/org/mapstruct/ap/processor/AnnotationBasedComponentModelProcessor.java b/processor/src/main/java/org/mapstruct/ap/processor/AnnotationBasedComponentModelProcessor.java index 7371f9a07..065c35fa1 100644 --- a/processor/src/main/java/org/mapstruct/ap/processor/AnnotationBasedComponentModelProcessor.java +++ b/processor/src/main/java/org/mapstruct/ap/processor/AnnotationBasedComponentModelProcessor.java @@ -26,7 +26,7 @@ import org.mapstruct.ap.model.Annotation; import org.mapstruct.ap.model.AnnotationMapperReference; import org.mapstruct.ap.model.Mapper; import org.mapstruct.ap.model.MapperReference; -import org.mapstruct.ap.model.TypeFactory; +import org.mapstruct.ap.model.common.TypeFactory; import org.mapstruct.ap.option.OptionsHelper; import org.mapstruct.ap.prism.MapperPrism; diff --git a/processor/src/main/java/org/mapstruct/ap/processor/DefaultModelElementProcessorContext.java b/processor/src/main/java/org/mapstruct/ap/processor/DefaultModelElementProcessorContext.java index 3764f1368..f1bdae737 100644 --- a/processor/src/main/java/org/mapstruct/ap/processor/DefaultModelElementProcessorContext.java +++ b/processor/src/main/java/org/mapstruct/ap/processor/DefaultModelElementProcessorContext.java @@ -28,7 +28,7 @@ import javax.lang.model.util.Elements; import javax.lang.model.util.Types; import javax.tools.Diagnostic.Kind; -import org.mapstruct.ap.model.TypeFactory; +import org.mapstruct.ap.model.common.TypeFactory; import org.mapstruct.ap.option.Options; /** diff --git a/processor/src/main/java/org/mapstruct/ap/processor/MapperCreationProcessor.java b/processor/src/main/java/org/mapstruct/ap/processor/MapperCreationProcessor.java index dab0dc1c4..8e45dfb9e 100644 --- a/processor/src/main/java/org/mapstruct/ap/processor/MapperCreationProcessor.java +++ b/processor/src/main/java/org/mapstruct/ap/processor/MapperCreationProcessor.java @@ -52,11 +52,11 @@ import org.mapstruct.ap.model.Mapper; import org.mapstruct.ap.model.MapperReference; import org.mapstruct.ap.model.MappingMethod; import org.mapstruct.ap.model.MappingMethodReference; -import org.mapstruct.ap.model.Parameter; import org.mapstruct.ap.model.PropertyMapping; -import org.mapstruct.ap.model.Type; import org.mapstruct.ap.model.TypeConversion; -import org.mapstruct.ap.model.TypeFactory; +import org.mapstruct.ap.model.common.Parameter; +import org.mapstruct.ap.model.common.Type; +import org.mapstruct.ap.model.common.TypeFactory; import org.mapstruct.ap.model.source.Mapping; import org.mapstruct.ap.model.source.Method; import org.mapstruct.ap.model.source.MethodMatcher; diff --git a/processor/src/main/java/org/mapstruct/ap/processor/MethodRetrievalProcessor.java b/processor/src/main/java/org/mapstruct/ap/processor/MethodRetrievalProcessor.java index 996ffec1e..eca947528 100644 --- a/processor/src/main/java/org/mapstruct/ap/processor/MethodRetrievalProcessor.java +++ b/processor/src/main/java/org/mapstruct/ap/processor/MethodRetrievalProcessor.java @@ -34,9 +34,9 @@ import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; import javax.tools.Diagnostic.Kind; -import org.mapstruct.ap.model.Parameter; -import org.mapstruct.ap.model.Type; -import org.mapstruct.ap.model.TypeFactory; +import org.mapstruct.ap.model.common.Parameter; +import org.mapstruct.ap.model.common.Type; +import org.mapstruct.ap.model.common.TypeFactory; import org.mapstruct.ap.model.source.IterableMapping; import org.mapstruct.ap.model.source.MapMapping; import org.mapstruct.ap.model.source.Mapping; diff --git a/processor/src/main/java/org/mapstruct/ap/processor/ModelElementProcessor.java b/processor/src/main/java/org/mapstruct/ap/processor/ModelElementProcessor.java index 5f58635dc..364f42bea 100644 --- a/processor/src/main/java/org/mapstruct/ap/processor/ModelElementProcessor.java +++ b/processor/src/main/java/org/mapstruct/ap/processor/ModelElementProcessor.java @@ -25,7 +25,7 @@ import javax.lang.model.util.Elements; import javax.lang.model.util.Types; import javax.tools.Diagnostic.Kind; -import org.mapstruct.ap.model.TypeFactory; +import org.mapstruct.ap.model.common.TypeFactory; import org.mapstruct.ap.option.Options; /** diff --git a/processor/src/main/resources/org.mapstruct.ap.model.Parameter.ftl b/processor/src/main/resources/org.mapstruct.ap.model.common.Parameter.ftl similarity index 100% rename from processor/src/main/resources/org.mapstruct.ap.model.Parameter.ftl rename to processor/src/main/resources/org.mapstruct.ap.model.common.Parameter.ftl diff --git a/processor/src/main/resources/org.mapstruct.ap.model.Type.ftl b/processor/src/main/resources/org.mapstruct.ap.model.common.Type.ftl similarity index 100% rename from processor/src/main/resources/org.mapstruct.ap.model.Type.ftl rename to processor/src/main/resources/org.mapstruct.ap.model.common.Type.ftl