From 0239d32ac078c706d98b066ca4d49a8d91a404bc Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 15 Apr 2022 20:21:37 +0200 Subject: Update Javadocs with @snippet blocks. Change-Id: Id28c226b6882c088f288b247f73041be807be862 --- .../src/main/java/eu/mulk/jgvariant/core/Decoder.java | 6 +++--- .../src/main/java/eu/mulk/jgvariant/core/package-info.java | 6 +++--- jgvariant-core/src/main/java/module-info.java | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'jgvariant-core/src/main/java') diff --git a/jgvariant-core/src/main/java/eu/mulk/jgvariant/core/Decoder.java b/jgvariant-core/src/main/java/eu/mulk/jgvariant/core/Decoder.java index 8a3741b..2cb36c6 100644 --- a/jgvariant-core/src/main/java/eu/mulk/jgvariant/core/Decoder.java +++ b/jgvariant-core/src/main/java/eu/mulk/jgvariant/core/Decoder.java @@ -40,7 +40,7 @@ import org.jetbrains.annotations.Nullable; *

To parse a GVariant of type {@code "a(si)"}, which is an array of pairs of {@link String} and * {@code int}, you can use the following code: * - *

{@code
+ * {@snippet lang="java" :
  * record ExampleRecord(String s, int i) {}
  *
  * var decoder =
@@ -50,9 +50,9 @@ import org.jetbrains.annotations.Nullable;
  *       Decoder.ofString(UTF_8),
  *       Decoder.ofInt().withByteOrder(LITTLE_ENDIAN)));
  *
- * byte[] bytes = ...;
+ * byte[] bytes;
  * List example = decoder.decode(ByteBuffer.wrap(bytes));
- * }
+ * } * * @param the type that the {@link Decoder} can decode. */ diff --git a/jgvariant-core/src/main/java/eu/mulk/jgvariant/core/package-info.java b/jgvariant-core/src/main/java/eu/mulk/jgvariant/core/package-info.java index a1e0a20..e2e8143 100644 --- a/jgvariant-core/src/main/java/eu/mulk/jgvariant/core/package-info.java +++ b/jgvariant-core/src/main/java/eu/mulk/jgvariant/core/package-info.java @@ -14,7 +14,7 @@ *

To parse a GVariant of type {@code "a(si)"}, which is an array of pairs of {@link * java.lang.String} and {@code int}, you can use the following code: * - *

{@code
+ * {@snippet lang="java" :
  * record ExampleRecord(String s, int i) {}
  *
  * var decoder =
@@ -24,8 +24,8 @@
  *       Decoder.ofString(UTF_8),
  *       Decoder.ofInt().withByteOrder(LITTLE_ENDIAN)));
  *
- * byte[] bytes = ...;
+ * byte[] bytes;
  * List example = decoder.decode(ByteBuffer.wrap(bytes));
- * }
+ * } */ package eu.mulk.jgvariant.core; diff --git a/jgvariant-core/src/main/java/module-info.java b/jgvariant-core/src/main/java/module-info.java index 4df8acd..6b45af0 100644 --- a/jgvariant-core/src/main/java/module-info.java +++ b/jgvariant-core/src/main/java/module-info.java @@ -26,7 +26,7 @@ * *

Usage with Maven

* - *
{@code
+ * {@snippet lang="xml" :
  * 
  *   ...
  *
@@ -63,21 +63,21 @@
  *
  *   ...
  * 
- * }
+ * } * *

Usage with Gradle

* - *
{@code
+ * {@snippet lang="groovy" :
  * dependencies {
- *   ...
+ *   // ...
  *
- *   implementation(platform("eu.mulk.jgvariant:jgvariant-bom:0.1.5")
+ *   implementation(platform("eu.mulk.jgvariant:jgvariant-bom:0.1.5"))
  *   implementation("eu.mulk.jgvariant:jgvariant-core")
  *   implementation("eu.mulk.jgvariant:jgvariant-ostree")
  *
- *   ...
+ *   // ...
+ * }
  * }
- * }
*/ module eu.mulk.jgvariant.core { requires com.google.errorprone.annotations; -- cgit v1.2.3