Class CharMappingService
This service handles character mapping management including CRUD operations and list retrieval. Character mappings are used for text normalization and character substitution during document processing and search operations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DictionaryManagerDictionary manager for accessing and managing dictionary files.protected org.codelibs.fess.mylasta.direction.FessConfigFess configuration settings. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(String dictId, CharMappingItem charMappingItem) Deletes a character mapping item from the specified dictionary.org.dbflute.optional.OptionalEntity<CharMappingFile> getCharMappingFile(String dictId) Retrieves the character mapping file for the specified dictionary ID.org.dbflute.optional.OptionalEntity<CharMappingItem> getCharMappingItem(String dictId, long id) Retrieves a specific character mapping item by its ID from the specified dictionary.getCharMappingList(String dictId, CharMappingPager charMappingPager) Retrieves a paginated list of character mapping items from the specified dictionary.voidstore(String dictId, CharMappingItem charMappingItem) Stores a character mapping item in the specified dictionary.
-
Field Details
-
dictionaryManager
Dictionary manager for accessing and managing dictionary files. -
fessConfig
protected org.codelibs.fess.mylasta.direction.FessConfig fessConfigFess configuration settings.
-
-
Constructor Details
-
CharMappingService
public CharMappingService()Creates a new instance of CharMappingService.
-
-
Method Details
-
getCharMappingList
Retrieves a paginated list of character mapping items from the specified dictionary.This method fetches character mapping items with pagination support and updates the pager with the current page information including total count and page ranges.
- Parameters:
dictId- the dictionary ID to retrieve character mappings fromcharMappingPager- the pager object containing pagination parameters- Returns:
- a list of character mapping items for the current page, or empty list if dictionary not found
-
getCharMappingFile
Retrieves the character mapping file for the specified dictionary ID.This method looks up the dictionary file and ensures it is a character mapping file before returning it wrapped in an OptionalEntity.
- Parameters:
dictId- the dictionary ID to retrieve the character mapping file for- Returns:
- an OptionalEntity containing the character mapping file if found and valid, empty otherwise
-
getCharMappingItem
public org.dbflute.optional.OptionalEntity<CharMappingItem> getCharMappingItem(String dictId, long id) Retrieves a specific character mapping item by its ID from the specified dictionary.This method looks up a character mapping item using its unique identifier within the context of the specified dictionary.
- Parameters:
dictId- the dictionary ID containing the character mapping itemid- the unique identifier of the character mapping item- Returns:
- an OptionalEntity containing the character mapping item if found, empty otherwise
-
store
Stores a character mapping item in the specified dictionary.This method performs either an insert operation (for new items with ID 0) or an update operation (for existing items with non-zero ID) depending on the item's current state.
- Parameters:
dictId- the dictionary ID to store the character mapping item incharMappingItem- the character mapping item to store
-
delete
Deletes a character mapping item from the specified dictionary.This method removes the specified character mapping item from the dictionary if the dictionary file exists and is accessible.
- Parameters:
dictId- the dictionary ID to delete the character mapping item fromcharMappingItem- the character mapping item to delete
-