本文整理汇总了Java中org.eclipse.xpand2.output.FileHandle类的典型用法代码示例。如果您正苦于以下问题:Java FileHandle类的具体用法?Java FileHandle怎么用?Java FileHandle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FileHandle类属于org.eclipse.xpand2.output包,在下文中一共展示了FileHandle类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: format
import org.eclipse.xpand2.output.FileHandle; //导入依赖的package包/类
/**
* Format code with PostProcessor (XPand style).
*/
public CharSequence format(String fileName, CharSequence code) {
// create fileHandle with dummy outlet.
File file = new File(fileName);
FileHandle fileHandle = new FileHandleImpl(new Outlet(), file);
fileHandle.setBuffer(code);
// call postProcessor for formatting the code.
csharpBeautifier.beforeWriteAndClose(fileHandle);
// return formatted results.
return fileHandle.getBuffer();
}
示例2: beforeWriteAndClose
import org.eclipse.xpand2.output.FileHandle; //导入依赖的package包/类
@Override
public void beforeWriteAndClose(FileHandle impl) {
CharSequence content = impl.getBuffer();
String replaced = normalizeLineDelimiters(content);
impl.setBuffer(replaced);
}
示例3: afterClose
import org.eclipse.xpand2.output.FileHandle; //导入依赖的package包/类
@Override
public void afterClose(FileHandle impl) {
// nothing to do
}
示例4: hasVeto
import org.eclipse.xpand2.output.FileHandle; //导入依赖的package包/类
@Override
public boolean hasVeto(FileHandle handle) {
Matcher matcher = PLUGIN_ELEMENT.matcher(handle.getBuffer());
return matcher.find() && Strings.isEmpty(matcher.group(1).trim());
}
示例5: afterClose
import org.eclipse.xpand2.output.FileHandle; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void afterClose(final FileHandle impl) {
// do nothing here
}