eclipse plugin - treat non java extension file like a java file(eclipse插件 - 将非java扩展文件视为java文件)
问题描述
我们正在开发一个 Eclipse 插件,我们有一个类似.xyz"的扩展名,但它实际上包含java代码.JavaCore.createCompilationUnitFrom() 只接受扩展名为.java"的文件.JavaCore 有 JAVA_SOURCE_CONTENT_TYPE ,它返回它视为的扩展Java 源文件.
We are developing an eclipse plugin and we have an extension like say, ".xyz" but it actually contains java code. JavaCore.createCompilationUnitFrom() accepts only files with extension ".java". JavaCore has JAVA_SOURCE_CONTENT_TYPE which returns the extensions that it treats as Java source files.
我的问题是如何将.xyz"添加到此列表中?我希望 JavaCore 将.xyz"扩展名的文件视为 java 源文件.
My questions is How do I add ".xyz" to this list ? I want JavaCore to treat files of ".xyz" extension as java source files.
任何指针都会很有帮助.
Any pointers would be very helpful.
推荐答案
错误 71460 在 eclipse3.1 中引入了对类 java 源的不同扩展的支持.
bug 121715 提到 eclipse3.2,(用于支持 .aj 文件作为包含 Java 源):
The bug 71460 has introduced support for different extension for java-like sources in eclipse3.1.
The bug 121715 mentions for eclipse3.2, (for supporting .aj files as containing Java source):
<content-type id="ajSource" name="AspectJ Source File"
base-type="org.eclipse.jdt.core.javaSource"
file-extensions="aj"/>
这篇关于eclipse插件 - 将非java扩展文件视为java文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:eclipse插件 - 将非java扩展文件视为java文件
基础教程推荐
- JPA惰性列表上的流 2022-01-01
- Java ECDSAwithSHA256 签名长度不一致 2022-01-01
- 在java中使用xpath和selenium解析HTML表格数据 2022-01-01
- 将 double 转换为 Int,向下舍入 2022-01-01
- 如何在相机中应用自定义滤镜 [Surfaceview 预览]. 2022-01-01
- doFilter()是在servlet的工作完成之前还是之后执行的? 2022-01-01
- Maven:无效的目标版本:10 2022-01-01
- 将 Windows 证书导入 Java 2022-01-01
- 控制台应用程序中的 Java 键盘输入解析 2022-01-01
- 在springboot中如何给mybatis加拦截器 2023-04-29
