Class BaseLanguageToolBridge

  • All Implemented Interfaces:
    ILanguageToolBridge
    Direct Known Subclasses:
    LanguageToolNativeBridge, LanguageToolNetworkBridge

    public abstract class BaseLanguageToolBridge
    extends java.lang.Object
    implements ILanguageToolBridge
    A base bridge implementation that handles errors thrown by subclasses.

    If the subclass throws an exception, the bridge will log the exception and then simply return empty results from then on. This is OK because the bridge is recreated on project load, so in the case of temporary issues the user can just reload the project to restore functionality.

    This failsafe is required because LanguageTool checks are called automatically and in large batches, so if an exception is thrown it will likely be thrown repeatedly for all invocations. Especially in the case of the network bridge we would otherwise spam the remote server or even DDoS it.

    • Constructor Detail

      • BaseLanguageToolBridge

        public BaseLanguageToolBridge()