保存自行编写的代码-Xtend [英] Saving self-written code - xtend

查看:61
本文介绍了保存自行编写的代码-Xtend的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以在生成的文件中保存自写代码。如果更改模型,然后按保存按钮,则所有代码将被覆盖。我想保存一些旧文件的代码。

I want to know if it is possible to save self-written code within a generated file. If you change the model and then push the save button, all code is overwritten. I want to save some of the code of the old file.

推荐答案

Xtend使用源生成的编译器,因此生成的Java代码用于Xtend本身不能在源代码级别进行更改。

Xtend uses a source generating compiler thus the produced Java code for Xtend itself cannot be altered on the source level.

但是,如果使用Xtend的模板表达式生成代码,则当然可以插入受保护的区域以允许用户修改生成的代码。 Github上的此操作系统项目在Xtend中实现了对受保护区域的支持。

Nevertheless, if you use Xtend's template expression to generate code, you can of course insert protected regions to allow users to modify the generated code. This OS project on Github implements support for protected regions in Xtend.

这篇关于保存自行编写的代码-Xtend的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆