use of org.talend.repository.json.ui.shadow.JSONShadowProcess.EJSONShadowProcessType in project tdi-studio-se by Talend.
the class JSONShadowFilePreview method preview.
/*
* (non-Javadoc)
*
* @see org.talend.repository.preview.IPreview#preview(org.talend.repository.preview.IProcessDescription,
* java.lang.String, boolean)
*/
public CsvArray preview(IProcessDescription description, String type, boolean outputErrorAsException) throws CoreException {
CsvArray res = null;
EJSONShadowProcessType typeShadow = EJSONShadowProcessType.valueOf(type);
shadowProcess = new JSONShadowProcess<IProcessDescription>(description, typeShadow);
try {
res = shadowProcess.runWithErrorOutputAsException(outputErrorAsException);
} catch (ProcessorException e) {
Status status = new Status(Status.ERROR, RunProcessPlugin.PLUGIN_ID, Status.OK, e.getMessage(), e);
RunProcessPlugin.getDefault().getLog().log(status);
throw new CoreException(status);
}
return res;
}
use of org.talend.repository.json.ui.shadow.JSONShadowProcess.EJSONShadowProcessType in project tdi-studio-se by Talend.
the class JSONShadowFilePreview method preview.
/*
* (non-Javadoc)
*
* @see org.talend.repository.preview.filedelimited.IFileDelimitedPreview#
* preview(org.talend.repository.preview.filedelimited.ProcessDescription)
*/
public CsvArray preview(IProcessDescription description, String type) throws CoreException {
CsvArray res = null;
EJSONShadowProcessType typeShadow = EJSONShadowProcessType.valueOf(type);
shadowProcess = new JSONShadowProcess<IProcessDescription>(description, typeShadow);
try {
res = shadowProcess.run();
} catch (ProcessorException e) {
Status status = new Status(Status.ERROR, RunProcessPlugin.PLUGIN_ID, Status.OK, e.getMessage(), e);
RunProcessPlugin.getDefault().getLog().log(status);
throw new CoreException(status);
}
return res;
}
Aggregations