当前位置: 首页>>代码示例>>Java>>正文


Java ICompilationUnit.getFileName方法代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.compiler.env.ICompilationUnit.getFileName方法的典型用法代码示例。如果您正苦于以下问题:Java ICompilationUnit.getFileName方法的具体用法?Java ICompilationUnit.getFileName怎么用?Java ICompilationUnit.getFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.internal.compiler.env.ICompilationUnit的用法示例。


在下文中一共展示了ICompilationUnit.getFileName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startLoggingSource

import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; //导入方法依赖的package包/类
public void startLoggingSource(CompilationResult compilationResult) {
	if ((this.tagBits & Logger.XML) != 0) {
		ICompilationUnit compilationUnit = compilationResult.compilationUnit;
		if (compilationUnit != null) {
  				char[] fileName = compilationUnit.getFileName();
  				File f = new File(new String(fileName));
  				if (fileName != null) {
  					this.parameters.put(Logger.PATH, f.getAbsolutePath());
  				}
  				char[][] packageName = compilationResult.packageName;
  				if (packageName != null) {
  					this.parameters.put(
  							Logger.PACKAGE,
  							new String(CharOperation.concatWith(packageName, File.separatorChar)));
  				}
  				CompilationUnit unit = (CompilationUnit) compilationUnit;
  				String destinationPath = unit.destinationPath;
			if (destinationPath == null) {
				destinationPath = this.main.destinationPath;
			}
			if (destinationPath != null && destinationPath != NONE) {
				if (File.separatorChar == '/') {
					this.parameters.put(Logger.OUTPUT, destinationPath);
				} else {
					this.parameters.put(Logger.OUTPUT, destinationPath.replace('/', File.separatorChar));
				}
			}
		}
		printTag(Logger.SOURCE, this.parameters, true, false);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:32,代码来源:Main.java

示例2: extractDestinationPathFromSourceFile

import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; //导入方法依赖的package包/类
public String extractDestinationPathFromSourceFile(CompilationResult result) {
	ICompilationUnit compilationUnit = result.compilationUnit;
	if (compilationUnit != null) {
		char[] fileName = compilationUnit.getFileName();
		int lastIndex = CharOperation.lastIndexOf(java.io.File.separatorChar, fileName);
		if (lastIndex != -1) {
			final String outputPathName = new String(fileName, 0, lastIndex);
			final File output = new File(outputPathName);
			if (output.exists() && output.isDirectory()) {
				return outputPathName;
			}
		}
	}
	return System.getProperty("user.dir"); //$NON-NLS-1$
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:Main.java

示例3: CompilationResult

import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; //导入方法依赖的package包/类
public CompilationResult(ICompilationUnit compilationUnit, int unitIndex, int totalUnitsKnown, int maxProblemPerUnit){
	this.fileName = compilationUnit.getFileName();
	this.compilationUnit = compilationUnit;
	this.unitIndex = unitIndex;
	this.totalUnitsKnown = totalUnitsKnown;
	this.maxProblemPerUnit = maxProblemPerUnit;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:CompilationResult.java


注:本文中的org.eclipse.jdt.internal.compiler.env.ICompilationUnit.getFileName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。