Package eu.europa.ec.taxud.handler
Class AbstractHandler
java.lang.Object
eu.europa.ec.taxud.handler.AbstractHandler
- Direct Known Subclasses:
StatusMessageHandler,ValidationAndStatusHandler,ValidationHandler
The type Abstract handler.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaninitContext(ValidationContext context) Generic Init method to initialize the ValidationContext component (such as Validator, Reader).abstract booleaninitContext(ValidationContext context, String[] args) Initialise ValidationContext based on args of command line interfaces.booleanIs application domain supported by the current validation handler.voidloadConfig(String className) Load config.voidprintHelp(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".voidvalidateContext(ValidationContext context) Validate the current context given.
-
Field Details
-
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 useroptions- The options list available.cmdLineErrorMessage- The error message to display to the user.
-
initContext
Initialise ValidationContext based on args of command line interfaces.- Parameters:
context- the contextargs- the arguments- Returns:
- true if the context is initialised
-
validateContext
Validate the current context given.- Parameters:
context- the context to validate
-
initContext
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
Load config.- Parameters:
className- the class name
-
isApplicationDomainSupported
Is application domain supported by the current validation handler.- Parameters:
context- Validation context- Returns:
- the boolean Is the handler supports the application domain given
-