Class ConstantTextFragment

java.lang.Object
com.hybris.datahub.core.services.impl.ConstantTextFragment
All Implemented Interfaces:
ImpExFragment

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

    • ConstantTextFragment

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

    • addLine

      public boolean addLine(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(String line, 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 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 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.