本文整理匯總了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
}