Class ConstantTextFragment

  • All Implemented Interfaces:
    ImpExFragment

    public class ConstantTextFragment
    extends java.lang.Object
    implements ImpExFragment
    A block of an ImpEx script containing constant content.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstantTextFragment()
      Instantiates a script fragment with constant content.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addLine​(java.lang.String line)
      Adds a line of the script to this block.
      boolean addLine​(java.lang.String line, java.util.List<ImpExFragment> fragments)
      Adds a line of the script to this block.
      java.lang.String getContent()
      Reads back the content of this script block.
      java.io.InputStream getContentAsInputStream()
      Retrieves an input stream to read content of this fragment.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConstantTextFragment

        public ConstantTextFragment()
        Instantiates a script fragment with constant content.
    • Method Detail

      • addLine

        public boolean addLine​(java.lang.String line)
        Description copied from interface: ImpExFragment
        Adds a line of the script to this block.
        Specified by:
        addLine in interface ImpExFragment
        Parameters:
        line - a line of script text
        Returns:
        true, if the line is added; false, if the line does not belong to this block.
      • addLine

        public boolean addLine​(java.lang.String line,
                               java.util.List<ImpExFragment> fragments)
        Description copied from interface: ImpExFragment
        Adds a line of the script to this block.
        Specified by:
        addLine in interface ImpExFragment
        Parameters:
        line - a line of script text
        Returns:
        true, if the line is added; false, if the line does not belong to this block.
      • getContent

        public java.lang.String getContent()
        Description copied from interface: ImpExFragment
        Reads back the content of this script block.
        Specified by:
        getContent in interface ImpExFragment
        Returns:
        content of this script block or an empty string, if this block is empty.
      • getContentAsInputStream

        public java.io.InputStream getContentAsInputStream()
        Description copied from interface: ImpExFragment
        Retrieves an input stream to read content of this fragment.
        Specified by:
        getContentAsInputStream in interface ImpExFragment
        Returns:
        an input stream to read content of this fragment.