From b23a1f3119b4ec30586cc40c2b65552cac90cfa2 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Sat, 16 Dec 2023 21:15:50 +0100 Subject: [PATCH] Expose type of entry via getter method --- .../apache/maven/doxia/index/IndexEntry.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java b/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java index f71d6e0d9..f3f95f9e5 100644 --- a/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java +++ b/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java @@ -53,13 +53,10 @@ public class IndexEntry { */ private List childEntries = new ArrayList<>(); - /** The type of the entry, one of the types defined by {@link IndexingSink} */ - private int type; - /** - * System-dependent EOL. + * The type of the entry, one of the types defined by {@link IndexingSink} */ - private static final String EOL = System.getProperty("line.separator"); + private final int type; /** * Constructor for root entry. @@ -124,6 +121,15 @@ protected void setId(String id) { this.id = id; } + /** + * Returns the type of this entry. Is one of the types defined by {@link IndexingSink}. + * @return the type of this entry + * @since 2.0.0 + */ + public int getType() { + return type; + } + /** Set if the entry's id already has an anchor in the underlying document. * * @param hasAnchor {@true} if the id already has an anchor. @@ -304,7 +310,7 @@ public String toString(int depth) { message.append(", title: ").append(title); } - message.append(EOL); + message.append(System.lineSeparator()); StringBuilder indent = new StringBuilder();