Class AbstractHandler

java.lang.Object
eu.europa.ec.taxud.handler.AbstractHandler
Direct Known Subclasses:
StatusMessageHandler, ValidationAndStatusHandler, ValidationHandler

public abstract class AbstractHandler extends Object
The type Abstract handler.
  • Field Details

    • config

      protected Properties config
      Configuration of the handler.
  • Constructor Details

    • AbstractHandler

      public AbstractHandler()
  • Method Details

    • printHelp

      public void printHelp(CommandLine line, String applicationName, String[] args, Options options, String cmdLineErrorMessage)
      Print help message when the command line is empty (missing required option) or when the command line contains "-h".
      Parameters:
      line - The command line to check.
      applicationName - The application name.
      args - The arguments provided by the user
      options - The options list available.
      cmdLineErrorMessage - The error message to display to the user.
    • initContext

      public abstract boolean initContext(ValidationContext context, String[] args)
      Initialise ValidationContext based on args of command line interfaces.
      Parameters:
      context - the context
      args - the arguments
      Returns:
      true if the context is initialised
    • validateContext

      public void validateContext(ValidationContext context)
      Validate the current context given.
      Parameters:
      context - the context to validate
    • initContext

      public boolean initContext(ValidationContext context) throws ValidationException
      Generic Init method to initialize the ValidationContext component (such as Validator, Reader).
      Parameters:
      context - Validation context
      Returns:
      boolean Is the handler applicable for input message
      Throws:
      ValidationException - Initialisation exception
    • loadConfig

      public void loadConfig(String className)
      Load config.
      Parameters:
      className - the class name
    • isApplicationDomainSupported

      public boolean isApplicationDomainSupported(ValidationContext context)
      Is application domain supported by the current validation handler.
      Parameters:
      context - Validation context
      Returns:
      the boolean Is the handler supports the application domain given