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    /**
032     * Map of scraped properties details - name of property, property details object.
033     */
034    private static final Map<String, PropertyDetails> PROPERTIES_DETAILS =
035             new LinkedHashMap<>();
036
037    /**
038     * The since version of the module.
039     */
040    private static String moduleSinceVersion = "";
041
042    /**
043     * The description of the module.
044     */
045    private static String moduleDescription = "";
046
047    /**
048     * The notes of the module.
049     */
050    private static String moduleNotes = "";
051
052    /**
053     * Private utility constructor.
054     */
055    private JavadocScraperResultUtil() {
056    }
057
058    /**
059     * Resets the fields.
060     */
061    public static void clearData() {
062        PROPERTIES_DETAILS.clear();
063        moduleSinceVersion = "";
064        moduleDescription = "";
065        moduleNotes = "";
066    }
067
068    /**
069     * Get the properties details map.
070     *
071     * @return the details map.
072     */
073    public static Map<String, PropertyDetails> getPropertiesDetails() {
074        return Collections.unmodifiableMap(PROPERTIES_DETAILS);
075    }
076
077    /**
078     * Get the module's since version.
079     *
080     * @return the module's since version.
081     */
082    public static String getModuleSinceVersion() {
083        return moduleSinceVersion;
084    }
085
086    /**
087     * Sets the module's since version.
088     *
089     * @param sinceVersion module's since version.
090     */
091    /* package */ static void setModuleSinceVersion(String sinceVersion) {
092        moduleSinceVersion = sinceVersion;
093    }
094
095    /**
096     * Get the module's description.
097     *
098     * @return the module's description.
099     */
100    public static String getModuleDescription() {
101        return moduleDescription;
102    }
103
104    /**
105     * Sets the module's description.
106     *
107     * @param description module's description.
108     */
109    /* package */ static void setModuleDescription(String description) {
110        moduleDescription = description;
111    }
112
113    /**
114     * Get the module's notes.
115     *
116     * @return the module's notes.
117     */
118    public static String getModuleNotes() {
119        return moduleNotes;
120    }
121
122    /**
123     * Sets the module's notes.
124     *
125     * @param notes module's notes.
126     */
127    /* package */ static void setModuleNotes(String notes) {
128        moduleNotes = notes;
129    }
130
131    /**
132     * Sets additional property details to property map.
133     *
134     * @param propertyName name of property.
135     * @param details property's details.
136     */
137    /* package */ static void putPropertyDetails(String propertyName,
138                                                 PropertyDetails details) {
139        PROPERTIES_DETAILS.put(propertyName, details);
140    }
141
142}