Interface ImpExFragment
-
- All Known Implementing Classes:
ConstantTextFragment,DataHubDataFragment,ImpexMacroFragment
public interface ImpExFragmentA logical block of an ImpEx script, e.g. a header, data block, macros, etc.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddLine(java.lang.String line)Adds a line of the script to this block.booleanaddLine(java.lang.String line, java.util.List<ImpExFragment> fragments)Adds a line of the script to this block.java.lang.StringgetContent()Reads back the content of this script block.java.io.InputStreamgetContentAsInputStream()Retrieves an input stream to read content of this fragment.
-
-
-
Method Detail
-
addLine
boolean addLine(java.lang.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(java.lang.String line, java.util.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
java.lang.String getContent() throws java.io.IOExceptionReads back the content of this script block.- Returns:
- content of this script block or an empty string, if this block is empty.
- Throws:
java.io.IOException- if failed to read this fragment content.
-
getContentAsInputStream
java.io.InputStream getContentAsInputStream() throws java.io.IOExceptionRetrieves an input stream to read content of this fragment.- Returns:
- an input stream to read content of this fragment.
- Throws:
java.io.IOException- if failed to create an input stream for the fragment content.
-
-