public class CommandSkeletonService extends Object
CommandTemplate
data to an XML file to create a command skeleton and generates
CommandTemplate
s from saved command skeleton XML.Modifier and Type | Class and Description |
---|---|
protected class |
CommandSkeletonService.CommandTemplateInputPicker |
protected class |
CommandSkeletonService.CommandTemplateOutputPicker |
Modifier and Type | Field and Description |
---|---|
private FileInputStream |
fis |
private FileOutputStream |
fos |
private XMLStreamReader |
xsr |
private XMLStreamWriter |
xsw |
Constructor and Description |
---|
CommandSkeletonService() |
Modifier and Type | Method and Description |
---|---|
void |
read(File file,
ArrayList<CommandTemplate> cts,
ArrayList<String> rootColumnTypes)
Read a command skeleton from an XML file.
|
void |
runSkeleton(List<CommandTemplate> cts,
List<String> rootColTypes,
SlideSet root,
SlideSetPluginLoader sspl,
boolean overrideRootWarning)
Run a command skeleton on a data table.
|
void |
write(ArrayDeque<CommandTemplate> cts,
List<String> rootColumnTypes,
File file)
Write a command skeleton to an XML file.
|
void |
write(SlideSet data,
File file)
Write a command skeleton to an XML file.
|
private FileOutputStream fos
private XMLStreamWriter xsw
private FileInputStream fis
private XMLStreamReader xsr
public void write(ArrayDeque<CommandTemplate> cts, List<String> rootColumnTypes, File file) throws IOException, XMLStreamException
cts
- The command skeleton, consisting of a stack of CommandTemplate
srootColumnTypes
- A list of DataElement
class names
specifying the column types of the root table. This will be
used as a check to make sure the command skeleton is applied
on appropriate data.file
- The file to be written.IOException
XMLStreamException
public void write(SlideSet data, File file) throws IOException, XMLStreamException, SlideSetException
data
- The leaf of the command skeleton.file
- The file to be written.IOException
XMLStreamException
SlideSetException
public void read(File file, ArrayList<CommandTemplate> cts, ArrayList<String> rootColumnTypes) throws IOException, XMLStreamException, SlideSetException
file
- The file to read.cts
- A list to be filled with CommandTemplate
s
from the command skeleton file. The commands are intended
to be executed in the order they are listed.rootColumnTypes
- A list to be filled with DataElement
class names representing the intended column structure
of appropriate root input data tables for the command skeleton.IOException
XMLStreamException
SlideSetException
public void runSkeleton(List<CommandTemplate> cts, List<String> rootColTypes, SlideSet root, SlideSetPluginLoader sspl, boolean overrideRootWarning) throws ColumnTypeException, SlideSetException
cts
- The list of CommandTemplate
s.rootColTypes
- The list of DataElement
types expected
in the root table.root
- The root table on which the command skeleton will be run.sspl
- The SlideSetPluginLoader
service.overrideRootWarning
- A flag to ignore a discrepancy between
the column types listed in rootColTypes
and the actual
column types found in root
. Note that doing so could
lead to unexpected behavior.ColumnTypeException
- Indicates a discrepancy between
the column types listed in rootColTypes
and the actual
column types found in root
.SlideSetException
- Indicates some other error.Copyright © 2023. All rights reserved.