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.app.web.admin.dict.protwords;
17
18 import org.codelibs.fess.app.web.CrudMode;
19 import org.lastaflute.web.validation.Required;
20 import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
21
22 import jakarta.validation.constraints.Size;
23
24 /**
25 * Form class for creating protected words dictionary entries.
26 * Protected words are terms that should not be modified or analyzed during
27 * text processing, preserving their original form in search indexes.
28 *
29 */
30 public class CreateForm {
31
32 /**
33 * Creates a new CreateForm instance.
34 */
35 public CreateForm() {
36 // Default constructor
37 }
38
39 /** Dictionary identifier */
40 @Required
41 public String dictId;
42
43 /** CRUD operation mode (CREATE, EDIT, etc.) */
44 @ValidateTypeFailure
45 public Integer crudMode;
46
47 /** Word or phrase to be protected from analysis */
48 @Required
49 @Size(max = 1000)
50 public String input;
51
52 /**
53 * Initializes the form with default values for creating a new protected words entry.
54 */
55 public void initialize() {
56 crudMode = CrudMode.CREATE;
57 }
58 }