Class ConsoleDocumentLoadHandler

java.lang.Object
lu.kbra.modelizer_next.cmdline.ConsoleDocumentLoadHandler
All Implemented Interfaces:
DocumentLoadHandler

public final class ConsoleDocumentLoadHandler extends Object implements DocumentLoadHandler
Document load handler that reports load failures to the console instead of showing Swing dialogs.
  • Constructor Details

    • ConsoleDocumentLoadHandler

      public ConsoleDocumentLoadHandler(boolean force)
      Creates a console document load handler instance.
      Parameters:
      force - whether force is enabled
  • Method Details

    • confirmLegacyImport

      public boolean confirmLegacyImport(File file)
      Confirms whether the legacy import should continue.
      Specified by:
      confirmLegacyImport in interface DocumentLoadHandler
      Parameters:
      file - file to read or write
      Returns:
      true when the condition is met; otherwise false
    • confirmNewerVersion

      public boolean confirmNewerVersion(String fileVersion, String appVersion)
      Confirms whether the newer version should continue.
      Specified by:
      confirmNewerVersion in interface DocumentLoadHandler
      Parameters:
      fileVersion - text value for file version
      appVersion - text value for application version
      Returns:
      true when the condition is met; otherwise false
    • error

      public void error(String message, Exception ex)
      Reports the error.
      Specified by:
      error in interface DocumentLoadHandler
      Parameters:
      message - message shown to the caller or user
      ex - exception that caused the failure