From 4d236472e2fde28e4a4aa12fd53b0155dd4915d4 Mon Sep 17 00:00:00 2001 From: Gunnar Morling Date: Thu, 27 Nov 2014 19:32:58 +0100 Subject: [PATCH] Fixing Javadoc issues --- core-common/pom.xml | 4 +++ .../src/main/java/org/mapstruct/Mapper.java | 2 +- .../main/java/org/mapstruct/Qualifier.java | 28 +++++++++---------- .../ap/model/MappingBuilderContext.java | 12 -------- .../ap/model/source/SourceReference.java | 18 ++++++------ .../builtin/CalendarToZonedDateTime.java | 10 +++---- .../builtin/ZonedDateTimeToCalendar.java | 6 ++-- .../source/selector/QualifierSelector.java | 1 - .../ap/util/SpecificCompilerWorkarounds.java | 8 +++--- 9 files changed, 39 insertions(+), 50 deletions(-) diff --git a/core-common/pom.xml b/core-common/pom.xml index aba46dc5e..6533c2c65 100644 --- a/core-common/pom.xml +++ b/core-common/pom.xml @@ -33,6 +33,10 @@ jar MapStruct Core Common + + true + + junit diff --git a/core-common/src/main/java/org/mapstruct/Mapper.java b/core-common/src/main/java/org/mapstruct/Mapper.java index 4c1434bde..20347f31c 100644 --- a/core-common/src/main/java/org/mapstruct/Mapper.java +++ b/core-common/src/main/java/org/mapstruct/Mapper.java @@ -44,7 +44,7 @@ public @interface Mapper { /** * Additional types for which an import statement is to be added to the generated mapper implementation class. - * This allows to refer to those types from within mapping expressions given via {@link #expression()} using + * This allows to refer to those types from within mapping expressions given via {@link Mapping#expression()} using * their simple name rather than their fully-qualified name. * * @return classes to add in the imports of the generated implementation. diff --git a/core-common/src/main/java/org/mapstruct/Qualifier.java b/core-common/src/main/java/org/mapstruct/Qualifier.java index 65d7d2b2b..b3ea8b2ca 100644 --- a/core-common/src/main/java/org/mapstruct/Qualifier.java +++ b/core-common/src/main/java/org/mapstruct/Qualifier.java @@ -24,29 +24,27 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Declares a target annotation to be a qualifier. - * + * Declares an annotation type to be a qualifier. Qualifier annotations allow unambiguously identify a suitable mapping + * method in case several methods qualify to map a bean property, iterable element etc. *

* For more info see: - *

    + *
      *
    • {@link Mapping#qualifiedBy() }
    • *
    • {@link IterableMapping#qualifiedBy() }
    • *
    • {@link MapMapping#keyQualifiedBy() }
    • *
    • {@link MapMapping#valueQualifiedBy() }
    • - *

      - *

      - * - * @Qualifier - * @Target(ElementType.METHOD) - * @Retention(RetentionPolicy.SOURCE) - * public @interface EnglishToGerman { - * } - * - *

      + *
    + * Example: + *
    + * @Qualifier
    + * @Target(ElementType.METHOD)
    + * @Retention(RetentionPolicy.SOURCE)
    + * public @interface EnglishToGerman {}
    + * 
    * * @author Sjaak Derksen */ -@Target(ElementType.ANNOTATION_TYPE) -@Retention(RetentionPolicy.CLASS) +@Target( ElementType.ANNOTATION_TYPE ) +@Retention( RetentionPolicy.CLASS ) public @interface Qualifier { } diff --git a/processor/src/main/java/org/mapstruct/ap/model/MappingBuilderContext.java b/processor/src/main/java/org/mapstruct/ap/model/MappingBuilderContext.java index bbee23977..7164ea192 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/MappingBuilderContext.java +++ b/processor/src/main/java/org/mapstruct/ap/model/MappingBuilderContext.java @@ -37,17 +37,6 @@ import org.mapstruct.ap.option.Options; /** * This class provides the context for the builders. - * - *

    - * The following builders make use of this context: - *

      - *
    • {@link BeanMappingMethod.Builder}
    • - *
    • {@link PropertyMappingMethod.Builder}
    • - *
    • {@link IterableMappingMethod.Builder}
    • - *
    • {@link MapMappingMethod.Builder}
    • - *
    • {@link EnumMappingMethod.Builder}
    • - *
    - *

    *

    * The context provides: *

      @@ -56,7 +45,6 @@ import org.mapstruct.ap.option.Options; *
    • Means to harbor results produced by the builders, such as forged- and virtual mapping methods that should be * generated in a later stage.
    • *
    - *

    * * @author Sjaak Derksen */ diff --git a/processor/src/main/java/org/mapstruct/ap/model/source/SourceReference.java b/processor/src/main/java/org/mapstruct/ap/model/source/SourceReference.java index 8e6ee2bda..16d4d38a0 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/source/SourceReference.java +++ b/processor/src/main/java/org/mapstruct/ap/model/source/SourceReference.java @@ -38,17 +38,17 @@ import org.mapstruct.ap.util.Strings; * It contains the source parameter, and all individual (nested) property entries. So consider the following * mapping method: * - * {@code - * @Mapping( source = "in.propA.propB" target = "propC" ) - * TypeB mappingMethod ( TypeA in ); - * } + *
    + * @Mapping(source = "in.propA.propB" target = "propC")
    + * TypeB mappingMethod(TypeA in);
    + * 
    * * Then: - *
      - *
    1. {@link #parameter} will describe {@code in}
    2. - *
    3. {@link #propertyEntries[0]} will describe {@code propA}
    4. - *
    5. {@link #propertyEntries[1]} will describe {@code propB}
    6. - *
    + *
      + *
    • {@code parameter} will describe {@code in}
    • + *
    • {@code propertyEntries[0]} will describe {@code propA}
    • + *
    • {@code propertyEntries[1]} will describe {@code propB}
    • + *
    * * After building, {@link #isValid()} will return true when when no problems are detected during building. * diff --git a/processor/src/main/java/org/mapstruct/ap/model/source/builtin/CalendarToZonedDateTime.java b/processor/src/main/java/org/mapstruct/ap/model/source/builtin/CalendarToZonedDateTime.java index e2d9a6147..bec792551 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/source/builtin/CalendarToZonedDateTime.java +++ b/processor/src/main/java/org/mapstruct/ap/model/source/builtin/CalendarToZonedDateTime.java @@ -18,6 +18,9 @@ */ package org.mapstruct.ap.model.source.builtin; +import static org.mapstruct.ap.util.Collections.asSet; + +import java.time.ZonedDateTime; import java.util.Calendar; import java.util.Set; import java.util.TimeZone; @@ -27,12 +30,9 @@ import org.mapstruct.ap.model.common.Type; import org.mapstruct.ap.model.common.TypeFactory; import org.mapstruct.ap.util.JavaTimeConstants; -import static org.mapstruct.ap.util.Collections.asSet; - /** - * {@link BuiltInMethod} for mapping between {@link java.util.Calendar} - * and {@link java.time.ZonedDateTime}. - *
    + * {@link BuiltInMethod} for mapping between {@link Calendar} and {@link ZonedDateTime}. + *

    * Template is at org.mapstruct.ap.model.builtin.CalendarToZonedDateTime.ftl */ public class CalendarToZonedDateTime extends BuiltInMethod { diff --git a/processor/src/main/java/org/mapstruct/ap/model/source/builtin/ZonedDateTimeToCalendar.java b/processor/src/main/java/org/mapstruct/ap/model/source/builtin/ZonedDateTimeToCalendar.java index 9101eda59..62cd29aa5 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/source/builtin/ZonedDateTimeToCalendar.java +++ b/processor/src/main/java/org/mapstruct/ap/model/source/builtin/ZonedDateTimeToCalendar.java @@ -18,6 +18,7 @@ */ package org.mapstruct.ap.model.source.builtin; +import java.time.ZonedDateTime; import java.util.Calendar; import java.util.Set; @@ -28,9 +29,8 @@ import org.mapstruct.ap.util.Collections; import org.mapstruct.ap.util.JavaTimeConstants; /** - * {@link BuiltInMethod} for mapping between {@link java.util.Calendar} - * and {@link java.time.ZonedDateTime}. - *
    + * {@link BuiltInMethod} for mapping between {@link Calendar} and {@link ZonedDateTime}. + *

    * Template is at org.mapstruct.ap.model.builtin.ZonedDateTimeToCalendar.ftl */ public class ZonedDateTimeToCalendar extends BuiltInMethod { diff --git a/processor/src/main/java/org/mapstruct/ap/model/source/selector/QualifierSelector.java b/processor/src/main/java/org/mapstruct/ap/model/source/selector/QualifierSelector.java index 34a2515c2..0c3196d3d 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/source/selector/QualifierSelector.java +++ b/processor/src/main/java/org/mapstruct/ap/model/source/selector/QualifierSelector.java @@ -45,7 +45,6 @@ import org.mapstruct.ap.prism.QualifierPrism; * removed from the list of potential mapping methods *

  1. If multiple qualifiers (qualifedBy) are specified, all should match to make a match.
  2. *
- *

* * @author Sjaak Derksen */ diff --git a/processor/src/main/java/org/mapstruct/ap/util/SpecificCompilerWorkarounds.java b/processor/src/main/java/org/mapstruct/ap/util/SpecificCompilerWorkarounds.java index 251a5f5fc..172a42cc8 100644 --- a/processor/src/main/java/org/mapstruct/ap/util/SpecificCompilerWorkarounds.java +++ b/processor/src/main/java/org/mapstruct/ap/util/SpecificCompilerWorkarounds.java @@ -36,7 +36,7 @@ public class SpecificCompilerWorkarounds { /** * Tests whether one type is a subtype of another. Any type is considered to be a subtype of itself. Also see JLS section 4.10, Subtyping. - *

+ *

* Work-around for a bug related to sub-typing in the Eclipse JSR 269 implementation. * * @param types the type utils @@ -55,15 +55,15 @@ public class SpecificCompilerWorkarounds { /** * Returns the erasure of a type. - *

+ *

* Performs an additional test on the given type to check if it is not void. Calling - * {@link Types#erasure(TypeMirror)} with a void kind type will create a ClassCastException in Eclipse JDT. + * {@link Types#erasure(TypeMirror)} with a void kind type will create a ClassCastException in Eclipse JDT. See the + * JLS, section 4.6 Type Erasure, for reference. * * @param types the type utils * @param t the type to be erased * @return the erasure of the given type * @throws IllegalArgumentException if given a package type - * @jls 4.6 Type Erasure */ public static TypeMirror erasure(Types types, TypeMirror t) { if ( t.getKind() == TypeKind.VOID || t.getKind() == TypeKind.NULL ) {