This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new 5a66c602fe Avoid using nested Map for
UpdateExtensionDocPageMojo.componentLinkOverrides parameter
5a66c602fe is described below
commit 5a66c602fee172ff7c54965c8ba55cd36c664a41
Author: James Netherton <[email protected]>
AuthorDate: Fri Aug 1 07:11:07 2025 +0100
Avoid using nested Map for
UpdateExtensionDocPageMojo.componentLinkOverrides parameter
---
.../camel/quarkus/maven/ComponentLinkOverride.java | 47 ++++++++++++++++++++++
.../quarkus/maven/UpdateExtensionDocPageMojo.java | 24 ++++++-----
2 files changed, 61 insertions(+), 10 deletions(-)
diff --git
a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/ComponentLinkOverride.java
b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/ComponentLinkOverride.java
new file mode 100644
index 0000000000..d559a3cf93
--- /dev/null
+++
b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/ComponentLinkOverride.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.camel.quarkus.maven;
+
+public class ComponentLinkOverride {
+ private String name;
+ private String xrefPrefix;
+ private String kind;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getXrefPrefix() {
+ return xrefPrefix;
+ }
+
+ public void setXrefPrefix(String xrefPrefix) {
+ this.xrefPrefix = xrefPrefix;
+ }
+
+ public String getKind() {
+ return kind;
+ }
+
+ public void setKind(String kind) {
+ this.kind = kind;
+ }
+}
diff --git
a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java
b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java
index 07777de3d2..b1017e29e5 100644
---
a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java
+++
b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java
@@ -99,7 +99,7 @@ public class UpdateExtensionDocPageMojo extends
AbstractDocGeneratorMojo {
private MavenSession session;
@Parameter
- Map<String, Map<String, String>> componentLinkOverrides = new HashMap<>();
+ Map<String, ComponentLinkOverride> componentLinkOverrides = new
HashMap<>();
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@@ -235,17 +235,21 @@ public class UpdateExtensionDocPageMojo extends
AbstractDocGeneratorMojo {
String xrefPrefix = "xref:{cq-camel-components}:" +
(!"component".equals(kind) ? kind + "s:" : ":");
if (componentLinkOverrides.containsKey(name)) {
- Map<String, String> linkOverridesOptions =
componentLinkOverrides.get(name);
- if (linkOverridesOptions.containsKey("name")) {
- name = linkOverridesOptions.get("name");
- }
+ ComponentLinkOverride override =
componentLinkOverrides.get(name);
+ if (override != null) {
+ if (override.getName() != null) {
+ name = override.getName();
+ }
- if (linkOverridesOptions.containsKey("xrefPrefix")) {
- xrefPrefix = linkOverridesOptions.get("xrefPrefix");
- }
+ if (override.getXrefPrefix() != null) {
+ xrefPrefix = override.getXrefPrefix();
+ }
- if (linkOverridesOptions.containsKey("kind")) {
- kind = linkOverridesOptions.get("kind");
+ if (override.getKind() != null) {
+ kind = override.getKind();
+ }
+ } else {
+ getLog().warn("Failed to determine component link
overrides for " + name);
}
}