Class ScriptValidationReader


  • public class ScriptValidationReader
    extends ImpExReader
    This reader can be used for validating an script. At the moment you can only validate the first until the first header definition. Just use it like a normal ImpExReader by calling readLine for one time. If the call passes all is OK.
    • Constructor Detail

      • ScriptValidationReader

        public ScriptValidationReader​(CSVReader reader,
                                      java.lang.String mode)
      • ScriptValidationReader

        public ScriptValidationReader​(CSVReader reader,
                                      EnumerationValue mode,
                                      DocumentIDRegistry docIdRegistry)
        Creates a new validator using the given reader.
        Parameters:
        reader - reader from which the script will be read
    • Method Detail

      • readLine

        public java.lang.Object readLine()
                                  throws ImpExException
        Description copied from class: ImpExReader
        Fetches the next line, parses it and returns it encapsulated in a HeaderDescriptor if the line was a header definition or a ValueLine if it was a data row.
        Overrides:
        readLine in class ImpExReader
        Returns:
        either HeaderDescriptor or ValueLine instances or null if end of data is reached.
        Throws:
        ImpExException - if a header could not be parsed properly
      • validateScript

        public static void validateScript​(CSVReader reader)
                                   throws ImpExException
        Validates a script using the given reader. The call will pass if the script is valid.
        Parameters:
        reader - reader holding the stream to check.
        Throws:
        ImpExException - script is not valid
      • validateScript

        public static void validateScript​(java.io.InputStream inputStream,
                                          java.lang.String encoding)
                                   throws ImpExException
        Validates a script using the given stream. The call will pass if the script is valid.
        Parameters:
        inputStream - stream to script
        encoding - used encoding
        Throws:
        ImpExException - script is not valid