|
|
Re: How to set file encoding of generated file from my dsl file [message #819158 is a reply to message #818477] |
Mon, 12 March 2012 15:15 |
Andy Ma Messages: 12 Registered: August 2011 |
Junior Member |
|
|
Hi Christian,
Thank you for your quick response, I tried as you suggested, but with no success, it seems the binding doesn't success, for method getInputStream, it always use from EclipseResourceFileSystemAccess2, not MyFileSystemAccess, can you help to check where the problem is, what I have done is as follow, thank you very much.
1. I created a class MyFileSystemAccess inherited from EclipseResourceFileSystemAccess2 in package org.eclipse.xtext.example.fowlerdsl like:
public class MyFileSystemAccess extends EclipseResourceFileSystemAccess2 {
@Override
protected StringInputStream getInputStream(String contentsAsString,
String encoding) {
return super.getInputStream(contentsAsString, "UTF-16");
}
}
2.I bind MyFileSystemAccess to IFileSystemAccess in file StatemachineRuntimeModule:
public class StatemachineRuntimeModule extends org.eclipse.xtext.example.fowlerdsl.AbstractStatemachineRuntimeModule {
@Override
public void configure(Binder binder) {
binder.bind(IFileSystemAccess.class).to(MyFileSystemAccess.class);
super.configure(binder);
}
}
[Updated on: Mon, 12 March 2012 15:18] Report message to a moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04360 seconds