001///////////////////////////////////////////////////////////////////////////////////////////////
002// checkstyle: Checks Java source code and other text files for adherence to a set of rules.
003// Copyright (C) 2001-2026 the original author or authors.
004//
005// This library is free software; you can redistribute it and/or
006// modify it under the terms of the GNU Lesser General Public
007// License as published by the Free Software Foundation; either
008// version 2.1 of the License, or (at your option) any later version.
009//
010// This library is distributed in the hope that it will be useful,
011// but WITHOUT ANY WARRANTY; without even the implied warranty of
012// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013// Lesser General Public License for more details.
014//
015// You should have received a copy of the GNU Lesser General Public
016// License along with this library; if not, write to the Free Software
017// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
018///////////////////////////////////////////////////////////////////////////////////////////////
019
020package com.puppycrawl.tools.checkstyle.site;
021
022import java.util.Collections;
023import java.util.LinkedHashMap;
024import java.util.Map;
025
026/**
027 * Class with result data of ClassAndPropertiesSettersJavadocScraper.
028 */
029public final class JavadocScraperResultUtil {
030    /**
031     * Map of scraped properties details - name of property, property details object.
032     */
033    private static final Map<String, PropertyDetails> PROPERTIES_DETAILS =
034             new LinkedHashMap<>();
035
036    /**
037     * The since version of the module.
038     */
039    private static String moduleSinceVersion = "";
040
041    /**
042     * The description of the module.
043     */
044    private static String moduleDescription = "";
045
046    /**
047     * The notes of the module.
048     */
049    private static String moduleNotes = "";
050
051    /**
052     * Private utility constructor.
053     */
054    private JavadocScraperResultUtil() {
055    }
056
057    /**
058     * Resets the fields.
059     */
060    public static void clearData() {
061        PROPERTIES_DETAILS.clear();
062        moduleSinceVersion = "";
063        moduleDescription = "";
064        moduleNotes = "";
065    }
066
067    /**
068     * Get the properties details map.
069     *
070     * @return the details map.
071     */
072    public static Map<String, PropertyDetails> getPropertiesDetails() {
073        return Collections.unmodifiableMap(PROPERTIES_DETAILS);
074    }
075
076    /**
077     * Get the module's since version.
078     *
079     * @return the module's since version.
080     */
081    public static String getModuleSinceVersion() {
082        return moduleSinceVersion;
083    }
084
085    /**
086     * Sets the module's since version.
087     *
088     * @param sinceVersion module's since version.
089     */
090    /* package */ static void setModuleSinceVersion(String sinceVersion) {
091        moduleSinceVersion = sinceVersion;
092    }
093
094    /**
095     * Get the module's description.
096     *
097     * @return the module's description.
098     */
099    public static String getModuleDescription() {
100        return moduleDescription;
101    }
102
103    /**
104     * Sets the module's description.
105     *
106     * @param description module's description.
107     */
108    /* package */ static void setModuleDescription(String description) {
109        moduleDescription = description;
110    }
111
112    /**
113     * Get the module's notes.
114     *
115     * @return the module's notes.
116     */
117    public static String getModuleNotes() {
118        return moduleNotes;
119    }
120
121    /**
122     * Sets the module's notes.
123     *
124     * @param notes module's notes.
125     */
126    /* package */ static void setModuleNotes(String notes) {
127        moduleNotes = notes;
128    }
129
130    /**
131     * Sets additional property details to property map.
132     *
133     * @param propertyName name of property.
134     * @param details property's details.
135     */
136    /* package */ static void putPropertyDetails(String propertyName,
137                                                 PropertyDetails details) {
138        PROPERTIES_DETAILS.put(propertyName, details);
139    }
140}