use of com.teradata.jaqy.interfaces.JaqyExporter in project jaqy by Teradata.
the class ExportCommand method execute.
@Override
public void execute(String[] args, boolean silent, JaqyInterpreter interpreter) throws Exception {
if (args.length == 0) {
JaqyExporter exporter = interpreter.getExporter();
if (exporter == null) {
interpreter.println("No current exports.");
} else {
interpreter.println(getCommand() + " " + exporter.getName());
}
} else {
String name = args[0];
args = StringUtils.shiftArgs(args);
JaqyExporter exporter = interpreter.getGlobals().getExporterManager().getHandler(name, args, interpreter);
if (exporter == null) {
interpreter.error("invalid format name: " + name);
}
interpreter.setExporter(exporter);
}
}
use of com.teradata.jaqy.interfaces.JaqyExporter in project jaqy by Teradata.
the class PipeImporterFactory method getHandler.
@Override
public PipeImporter getHandler(CommandLine cmdLine, JaqyInterpreter interpreter) throws Exception {
JaqyExporter exporter = interpreter.getExporter();
if (exporter == null)
interpreter.error("No current pipe export.");
else if (!(exporter instanceof PipeExporter))
interpreter.error("Current export is not a pipe export.");
JaqyResultSet rs = ((PipeExporter) exporter).getResultSet();
if (rs == null)
interpreter.error("Data has not been exported.");
interpreter.setExporter(null);
return new PipeImporter(rs, interpreter.getGlobals());
}
Aggregations