1 /*
2 * Copyright 2012-2025 CodeLibs Project and the Others.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13 * either express or implied. See the License for the specific language
14 * governing permissions and limitations under the License.
15 */
16 package org.codelibs.fess.job;
17
18 import java.util.Map;
19 import java.util.Set;
20
21 /**
22 * Strategy interface for formatting exported index documents.
23 */
24 public interface IndexExportFormatter {
25
26 /**
27 * Returns the file extension for this format (e.g. ".html", ".json").
28 *
29 * @return the file extension including the leading dot
30 */
31 String getFileExtension();
32
33 /**
34 * Returns the default index file name for this format (e.g. "index.html", "index.json").
35 *
36 * @return the index file name
37 */
38 String getIndexFileName();
39
40 /**
41 * Formats a document source map into the target format string.
42 *
43 * @param source the document source map
44 * @param excludeFields the set of field names to exclude from output
45 * @return the formatted string
46 */
47 String format(Map<String, Object> source, Set<String> excludeFields);
48 }