aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2022-04-15 20:21:37 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2022-04-15 20:21:37 +0200
commit0239d32ac078c706d98b066ca4d49a8d91a404bc (patch)
treee65b17bf8820f51b02983896fedd17f5ea9d45b4
parent789a7fe484c6f3110e2e251ceab01dc7bb25ae94 (diff)
Update Javadocs with @snippet blocks.
Change-Id: Id28c226b6882c088f288b247f73041be807be862
-rw-r--r--jgvariant-core/src/main/java/eu/mulk/jgvariant/core/Decoder.java6
-rw-r--r--jgvariant-core/src/main/java/eu/mulk/jgvariant/core/package-info.java6
-rw-r--r--jgvariant-core/src/main/java/module-info.java14
-rw-r--r--jgvariant-ostree/src/main/java/module-info.java14
4 files changed, 20 insertions, 20 deletions
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;
* <p>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:
*
- * <pre>{@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<ExampleRecord> example = decoder.decode(ByteBuffer.wrap(bytes));
- * }</pre>
+ * }
*
* @param <T> 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 @@
* <p>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:
*
- * <pre>{@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<ExampleRecord> example = decoder.decode(ByteBuffer.wrap(bytes));
- * }</pre>
+ * }
*/
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 @@
*
* <h3 id="sect-installation-maven">Usage with Maven</h3>
*
- * <pre>{@code
+ * {@snippet lang="xml" :
* <project>
* ...
*
@@ -63,21 +63,21 @@
*
* ...
* </project>
- * }</pre>
+ * }
*
* <h3 id="sect-installation-gradle">Usage with Gradle</h3>
*
- * <pre>{@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")
*
- * ...
+ * // ...
+ * }
* }
- * }</pre>
*/
module eu.mulk.jgvariant.core {
requires com.google.errorprone.annotations;
diff --git a/jgvariant-ostree/src/main/java/module-info.java b/jgvariant-ostree/src/main/java/module-info.java
index 6e6018e..18daf94 100644
--- a/jgvariant-ostree/src/main/java/module-info.java
+++ b/jgvariant-ostree/src/main/java/module-info.java
@@ -25,7 +25,7 @@
*
* <h3 id="sect-installation-maven">Usage with Maven</h3>
*
- * <pre>{@code
+ * {@snippet lang="xml" :
* <project>
* ...
*
@@ -62,21 +62,21 @@
*
* ...
* </project>
- * }</pre>
+ * }
*
* <h3 id="sect-installation-gradle">Usage with Gradle</h3>
*
- * <pre>{@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")
*
- * ...
+ * // ...
+ * }
* }
- * }</pre>
*/
module eu.mulk.jgvariant.ostree {
requires transitive eu.mulk.jgvariant.core;