Interface ImpExFragment

All Known Implementing Classes:
ConstantTextFragment, DataHubDataFragment, ImpexMacroFragment

public interface ImpExFragment
A logical block of an ImpEx script, e.g. a header, data block, macros, etc.
  • Method Details

    • addLine

      boolean addLine(String line)
      Adds a line of the script to this block.
      Parameters:
      line - a line of script text
      Returns:
      true, if the line is added; false, if the line does not belong to this block.
      Throws:
      ImpexValidationException - when a line is invalid
    • addLine

      boolean addLine(String line, List<ImpExFragment> fragments)
      Adds a line of the script to this block.
      Parameters:
      line - a line of script text
      Returns:
      true, if the line is added; false, if the line does not belong to this block.
      Throws:
      ImpexValidationException - when a line is invalid
    • getContent

      String getContent() throws IOException
      Reads back the content of this script block.
      Returns:
      content of this script block or an empty string, if this block is empty.
      Throws:
      IOException - if failed to read this fragment content.
    • getContentAsInputStream

      InputStream getContentAsInputStream() throws IOException
      Retrieves an input stream to read content of this fragment.
      Returns:
      an input stream to read content of this fragment.
      Throws:
      IOException - if failed to create an input stream for the fragment content.