001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.data.osm;
003
004/**
005 * Hooks that allow correcting the name of a OSM primitive
006 * @see DefaultNameFormatter
007 * @since 12663 (moved from {@code gui} package)
008 */
009public interface NameFormatterHook {
010
011    /**
012     * Check the relation type name. Return the corrected type name if needed, null otherwise.
013     * @param relation The relation.
014     * @param defaultName The default name generated by core.
015     * @return The corrected type name if needed, null otherwise.
016     */
017    String checkRelationTypeName(IRelation relation, String defaultName);
018
019    /**
020     * Check the node format. Return the corrected format if needed, null otherwise.
021     * @param node The node.
022     * @param defaultName The default name generated by core.
023     * @return The corrected format if needed, null otherwise.
024     */
025    String checkFormat(INode node, String defaultName);
026
027    /**
028     * Check the way format. Return the corrected format if needed, null otherwise.
029     * @param way The way.
030     * @param defaultName The default name generated by core.
031     * @return The corrected format if needed, null otherwise.
032     */
033    String checkFormat(IWay way, String defaultName);
034
035    /**
036     * Check the relation format. Return the corrected format if needed, null otherwise.
037     * @param relation The relation.
038     * @param defaultName The default name generated by core.
039     * @return The corrected format if needed, null otherwise.
040     */
041    String checkFormat(IRelation relation, String defaultName);
042}