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 Summary
All Methods Instance Methods Abstract 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.
-
-
-
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.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:
java.io.IOException
- if failed to read this fragment content.
-
getContentAsInputStream
java.io.InputStream getContentAsInputStream() throws java.io.IOException
Retrieves 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.
-
-