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.stemmeroverride;
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 new stemmer override dictionary entries.
26 * This form handles the creation of stemmer override rules that modify
27 * the stemming behavior for specific words.
28 *
29 */
30 public class CreateForm {
31
32 /**
33 * Creates a new CreateForm instance.
34 */
35 public CreateForm() {
36 }
37
38 /** The dictionary ID to which this stemmer override entry belongs */
39 @Required
40 public String dictId;
41
42 /** The CRUD operation mode for form processing */
43 @ValidateTypeFailure
44 public Integer crudMode;
45
46 /** The input word that should be stemmed differently */
47 @Required
48 @Size(max = 1000)
49 public String input;
50
51 /** The desired stem output for the input word */
52 @Required
53 @Size(max = 1000)
54 public String output;
55
56 /**
57 * Initializes the form with default values for creating a new stemmer override entry.
58 */
59 public void initialize() {
60 crudMode = CrudMode.CREATE;
61 }
62 }