Class CharMappingFile

java.lang.Object
org.codelibs.fess.dict.DictionaryFile<CharMappingItem>
org.codelibs.fess.dict.mapping.CharMappingFile

public class CharMappingFile extends DictionaryFile<CharMappingItem>
Character mapping file handler for managing character mapping dictionaries. This class provides functionality to load, parse, and manage character mapping rules that define how input characters should be transformed to output characters during text analysis and search processing. Character mapping files contain mapping rules in the format: input1,input2,... => output
  • Constructor Details

    • CharMappingFile

      public CharMappingFile(String id, String path, Date timestamp)
      Constructs a new CharMappingFile instance.
      Parameters:
      id - the unique identifier for this mapping file
      path - the file path to the character mapping dictionary
      timestamp - the last modification timestamp of the file
  • Method Details

    • getType

      public String getType()
      Returns the type identifier for this dictionary file.
      Specified by:
      getType in class DictionaryFile<CharMappingItem>
      Returns:
      the string "mapping" identifying this as a character mapping file
    • getPath

      public String getPath()
      Returns the file path of this character mapping dictionary.
      Overrides:
      getPath in class DictionaryFile<CharMappingItem>
      Returns:
      the file path as a string
    • get

      public org.dbflute.optional.OptionalEntity<CharMappingItem> get(long id)
      Retrieves a character mapping item by its ID.
      Specified by:
      get in class DictionaryFile<CharMappingItem>
      Parameters:
      id - the unique identifier of the mapping item to retrieve
      Returns:
      an OptionalEntity containing the mapping item if found, empty otherwise
    • selectList

      public DictionaryFile.PagingList<CharMappingItem> selectList(int offset, int size)
      Retrieves a paginated list of character mapping items.
      Specified by:
      selectList in class DictionaryFile<CharMappingItem>
      Parameters:
      offset - the starting index for pagination (0-based)
      size - the maximum number of items to return
      Returns:
      a PagingList containing the requested subset of mapping items
    • insert

      public void insert(CharMappingItem item)
      Inserts a new character mapping item into the dictionary file.
      Specified by:
      insert in class DictionaryFile<CharMappingItem>
      Parameters:
      item - the character mapping item to insert
    • update

      public void update(CharMappingItem item)
      Updates an existing character mapping item in the dictionary file.
      Specified by:
      update in class DictionaryFile<CharMappingItem>
      Parameters:
      item - the character mapping item to update
    • delete

      public void delete(CharMappingItem item)
      Deletes a character mapping item from the dictionary file.
      Specified by:
      delete in class DictionaryFile<CharMappingItem>
      Parameters:
      item - the character mapping item to delete
    • reload

      protected void reload(CharMappingFile.MappingUpdater updater)
      Reloads the character mapping items from the dictionary file.
      Parameters:
      updater - the mapping updater to use for writing changes, or null for read-only reload
    • reload

      protected void reload(CharMappingFile.MappingUpdater updater, InputStream in)
      Reloads the character mapping items from the provided input stream. Parses mapping rules in the format: input1,input2,... => output
      Parameters:
      updater - the mapping updater to use for writing changes, or null for read-only reload
      in - the input stream to read the mapping data from
    • getSimpleName

      public String getSimpleName()
      Returns the simple file name (without directory path) of this mapping file.
      Returns:
      the file name without the full path
    • update

      public void update(InputStream in) throws IOException
      Updates the entire mapping file content from the provided input stream.
      Parameters:
      in - the input stream containing the new mapping file content
      Throws:
      IOException - if an I/O error occurs during the update
    • toString

      public String toString()
      Returns a string representation of this character mapping file.
      Overrides:
      toString in class Object
      Returns:
      a string containing the path, mapping items, and ID of this file