本文整理汇总了Java中org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy类的典型用法代码示例。如果您正苦于以下问题:Java IAcceleoGenerationStrategy类的具体用法?Java IAcceleoGenerationStrategy怎么用?Java IAcceleoGenerationStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IAcceleoGenerationStrategy类属于org.eclipse.acceleo.engine.generation.strategy包,在下文中一共展示了IAcceleoGenerationStrategy类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createWriterFor
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; //导入依赖的package包/类
@Override
public AbstractAcceleoWriter createWriterFor(File file, AbstractAcceleoWriter previous, boolean appendMode,
boolean hasJMergeTags, String charset) throws IOException {
final AbstractAcceleoWriter writer;
if (!file.getParentFile().exists())
if (!file.getParentFile().mkdirs())
throw new AcceleoEvaluationException(AcceleoEngineMessages.getString(
"AcceleoEvaluationContext.FolderCreationError", file.getParentFile())); //$NON-NLS-1$
if (file.isDirectory())
throw new AcceleoEvaluationException(AcceleoEngineMessages.getString(
"AcceleoEvaluationContext.FileNameIsDirectory", file)); //$NON-NLS-1$
boolean fileExisted = file.exists();
if (!hasJMergeTags || appendMode) {
if (charset != null) {
if (Charset.isSupported(charset)) {
writer = new XAAcceleoWriter(file, appendMode, charset);
((XAAcceleoWriter) writer).setPostProcessors(this.postProcessors).setVetoStrategy(vetoStrategy);
} else {
final String message = AcceleoEngineMessages.getString(
"AcceleoGenerationStrategy.UnsupportedCharset", charset); //$NON-NLS-1$
AcceleoEnginePlugin.log(message, false);
writer = new XAAcceleoWriter(file, appendMode, CharsetHelper.getCharset(file));
((XAAcceleoWriter) writer).setPostProcessors(this.postProcessors).setVetoStrategy(vetoStrategy);
}
} else {
writer = new XAAcceleoWriter(file, appendMode, CharsetHelper.getCharset(file));
((XAAcceleoWriter) writer).setPostProcessors(this.postProcessors).setVetoStrategy(vetoStrategy);
}
if (appendMode && fileExisted)
writer.append(IAcceleoGenerationStrategy.LINE_SEPARATOR);
} else {
writer = new XAAcceleoWriter(file.getPath(), CharsetHelper.getCharset(file));
((XAAcceleoWriter) writer).setPostProcessors(this.postProcessors).setVetoStrategy(vetoStrategy);
}
return writer;
}
示例2: getGenerationStrategy
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; //导入依赖的package包/类
@Override
public IAcceleoGenerationStrategy getGenerationStrategy() {
return new XAGenerationStrategy(this.postProcessors, this.vetoStrategy);
}
示例3: getGenerationStrategy
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; //导入依赖的package包/类
/**
* If you need to change the way files are generated, this is your entry
* point.
* <p>
* The default is
* {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy};
* it generates files on the fly. If you only need to preview the results,
* return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}.
* Both of these aren't aware of the running Eclipse and can be used
* standalone.
* </p>
* <p>
* If you need the file generation to be aware of the workspace (A typical
* example is when you wanna override files that are under clear case or any
* other VCS that could forbid the overriding), then return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}
* . <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
*
* @return The generation strategy that is to be used for generations
* launched through this launcher.
* @generated
*/
@Override
public IAcceleoGenerationStrategy getGenerationStrategy ()
{
return super.getGenerationStrategy();
}
示例4: getGenerationStrategy
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; //导入依赖的package包/类
/**
* If you need to change the way files are generated, this is your entry
* point.
* <p>
* The default is
* {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy};
* it generates files on the fly. If you only need to preview the results,
* return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}.
* Both of these aren't aware of the running Eclipse and can be used
* standalone.
* </p>
* <p>
* If you need the file generation to be aware of the workspace (A typical
* example is when you wanna override files that are under clear case or any
* other VCS that could forbid the overriding), then return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}
* . <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
*
* @return The generation strategy that is to be used for generations
* launched through this launcher.
* @generated NOT
*/
@Override
public IAcceleoGenerationStrategy getGenerationStrategy ()
{
return new WorkspaceAwareStrategy ();
}
示例5: getGenerationStrategy
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; //导入依赖的package包/类
/**
* If you need to change the way files are generated, this is your entry point.
* <p>
* The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates
* files on the fly. If you only need to preview the results, return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware of
* the running Eclipse and can be used standalone.
* </p>
* <p>
* If you need the file generation to be aware of the workspace (A typical example is when you wanna
* override files that are under clear case or any other VCS that could forbid the overriding), then
* return a new {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}.
* <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
*
* @return The generation strategy that is to be used for generations launched through this launcher.
* @generated
*/
@Override
public IAcceleoGenerationStrategy getGenerationStrategy() {
return super.getGenerationStrategy();
}
示例6: getGenerationStrategy
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; //导入依赖的package包/类
/**
* If you need to change the way files are generated, this is your entry
* point.
* <p>
* The default is
* {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy};
* it generates files on the fly. If you only need to preview the results,
* return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}.
* Both of these aren't aware of the running Eclipse and can be used
* standalone.
* </p>
* <p>
* If you need the file generation to be aware of the workspace (A typical
* example is when you wanna override files that are under clear case or any
* other VCS that could forbid the overriding), then return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}
* . <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
*
* @return The generation strategy that is to be used for generations
* launched through this launcher.
* @generated
*/
@Override
public IAcceleoGenerationStrategy getGenerationStrategy() {
return super.getGenerationStrategy();
}