응용프로그램의
일부로 변환을 실행하려면 다음 예제와 같이 변환 API를 호출할 수 있습니다.IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/MyWorkspace/MyConfig.tc"));
try {
ITransformConfig config = TransformConfigUtil.loadConfiguration(file);
IStatus status = TransformController.getInstance().execute(config, null, false, null);
}
catch (IOException e) {
// The config file could not be read.
}
You can also load a transformation
configuration by specifying a URL, as in the following example: try {
URL url= new URL(platform:/plugin/myPluginID/myConfig.tc);
ITransformConfig config = TransformConfigUtil.loadConfiguration(url);
}
catch (MalformedURLException malURLEx) {
// Handle exception.
}
catch (IOException ioEx) {
// Handle exception.
}
다음 예제와 같이 다른 프로토콜을
사용하는 URL을 지정할 수 있습니다. - platform:/plugin/myPluginID/myConfig.tc
- http://myServer.myCompany.com/myConfig.tc
- ftp://myUsername:myPassword@myServer.myCompany.com/myConfig.tc
- jar:file:c:/myFolder/myJar.jar!/myConfig.tc
- file:c:/myFolder/myConfig.tc
|