Class DictionaryFile<T extends DictionaryItem>

java.lang.Object
org.codelibs.fess.dict.DictionaryFile<T>
Type Parameters:
T - the type of dictionary items managed by this file
Direct Known Subclasses:
CharMappingFile, KuromojiFile, ProtwordsFile, StemmerOverrideFile, StopwordsFile, SynonymFile

public abstract class DictionaryFile<T extends DictionaryItem> extends Object
Abstract base class for dictionary files that manage dictionary items. A dictionary file represents a collection of dictionary items with CRUD operations and pagination support.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A paginated list implementation that wraps another list and provides pagination metadata and functionality.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The dictionary manager responsible for this file.
    protected String
    The unique identifier for this dictionary file.
    protected String
    The file path of this dictionary.
    protected Date
    The timestamp when this dictionary file was created or last modified.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    DictionaryFile(String id, String path, Date timestamp)
    Creates a new DictionaryFile with the specified parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    delete(T item)
    Deletes a dictionary item.
    abstract org.dbflute.optional.OptionalEntity<T>
    get(long id)
    Retrieves a dictionary item by its ID.
    Returns the unique identifier of this dictionary file.
    Gets the file path of this dictionary.
    Returns the timestamp of this dictionary file.
    abstract String
    Gets the type identifier for this dictionary file.
    abstract void
    insert(T item)
    Inserts a new dictionary item.
    manager(DictionaryManager dictionaryManager)
    Sets the dictionary manager for this file and returns this instance.
    selectList(int offset, int size)
    Retrieves a paginated list of dictionary items.
    abstract void
    update(T item)
    Updates an existing dictionary item.
    void
    writeOut(org.lastaflute.web.servlet.request.stream.WrittenStreamOut out)
    Writes the content of this dictionary file to the provided output stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • dictionaryManager

      protected DictionaryManager dictionaryManager
      The dictionary manager responsible for this file.
    • id

      protected String id
      The unique identifier for this dictionary file.
    • path

      protected String path
      The file path of this dictionary.
    • timestamp

      protected Date timestamp
      The timestamp when this dictionary file was created or last modified.
  • Constructor Details

    • DictionaryFile

      protected DictionaryFile(String id, String path, Date timestamp)
      Creates a new DictionaryFile with the specified parameters.
      Parameters:
      id - the unique identifier for this dictionary file
      path - the file path of this dictionary
      timestamp - the timestamp of the dictionary file
  • Method Details

    • getId

      public String getId()
      Returns the unique identifier of this dictionary file.
      Returns:
      the dictionary file ID
    • getPath

      public String getPath()
      Gets the file path of this dictionary.
      Returns:
      the file path
    • getTimestamp

      public Date getTimestamp()
      Returns the timestamp of this dictionary file.
      Returns:
      the timestamp when this dictionary was created or last modified
    • manager

      public DictionaryFile<T> manager(DictionaryManager dictionaryManager)
      Sets the dictionary manager for this file and returns this instance.
      Parameters:
      dictionaryManager - the dictionary manager to set
      Returns:
      this dictionary file instance for method chaining
    • writeOut

      public void writeOut(org.lastaflute.web.servlet.request.stream.WrittenStreamOut out) throws IOException
      Writes the content of this dictionary file to the provided output stream.
      Parameters:
      out - the output stream to write to
      Throws:
      IOException - if an I/O error occurs during writing
    • getType

      public abstract String getType()
      Gets the type identifier for this dictionary file.
      Returns:
      the dictionary type
    • selectList

      public abstract DictionaryFile.PagingList<T> selectList(int offset, int size)
      Retrieves a paginated list of dictionary items.
      Parameters:
      offset - the starting offset for pagination
      size - the number of items to retrieve
      Returns:
      a paginated list of dictionary items
    • get

      public abstract org.dbflute.optional.OptionalEntity<T> get(long id)
      Retrieves a dictionary item by its ID.
      Parameters:
      id - the item ID
      Returns:
      an optional containing the item if found
    • insert

      public abstract void insert(T item)
      Inserts a new dictionary item.
      Parameters:
      item - the item to insert
    • update

      public abstract void update(T item)
      Updates an existing dictionary item.
      Parameters:
      item - the item to update
    • delete

      public abstract void delete(T item)
      Deletes a dictionary item.
      Parameters:
      item - the item to delete