public abstract static class DXLVariable.FileOutput extends DXLVariable implements DXLExecutionListener
Here is a snippet:
StringBuffer buffer = new StringBuffer(); myDXLEngine.execute(new DXLFragment[] { DXLVariable.FileOutput.create("outputFilename", buffer, "UTF-8"), //$NON-NLS-1$ dxlFragment // / a fragment that will write some result data in the file, using the "outputFilename" variable }); // now the buffer contains what has been written in the file by the DXL script String resultOfExecution = buffer.toString();
DXLVariable.FileOutput
Modifier and Type | Method and Description |
---|---|
static DXLFragment |
create(String name,
ByteArrayOutputStream os)
Instantiates a fragment that declares a string variable whose value is a file path.
|
static DXLFragment |
create(String name,
StringBuffer buffer,
String charSetName)
Instantiates a fragment that declares a string variable whose value is a file path.
|
void |
executionCompleted()
Notification sent when the DXL script execution is completed.
|
void |
executionStarted()
Notification sent when the DXL script execution is about to start.
|
void |
write(Writer writer)
Writes the content of this fragment into the specified writer.
|
create, create, create, create, createUnquoted
public static DXLFragment create(String name, ByteArrayOutputStream os)
name
- the DXL variable name which references a file path.os
- a byte stream where the bytes written by the DXL script are copied over.public static DXLFragment create(String name, StringBuffer buffer, String charSetName)
name
- the DXL variable name which references a file path.buffer
- a buffer where the bytes written by the DXL script are copied over.charSetName
- the Java charset name used to convert the bytes written by the DXL script into characters.public void write(Writer writer) throws IOException
DXLFragment
DXLEngine
when combining
fragments into a DXL file.write
in interface DXLFragment
write
in class DXLVariable
writer
- the writer in which to output the content of the fragment.IOException
- if the content cannot be written.public void executionStarted() throws org.eclipse.core.runtime.CoreException
DXLExecutionListener
executionStarted
in interface DXLExecutionListener
org.eclipse.core.runtime.CoreException
- if an error occurs in the listener that should abort the execution.public void executionCompleted() throws org.eclipse.core.runtime.CoreException
DXLExecutionListener
executionCompleted
in interface DXLExecutionListener
org.eclipse.core.runtime.CoreException
- if an error occurs in the listener that should abort the execution.