本文整理汇总了Java中org.eclipse.xtext.xtext.generator.model.JavaFileAccess类的典型用法代码示例。如果您正苦于以下问题:Java JavaFileAccess类的具体用法?Java JavaFileAccess怎么用?Java JavaFileAccess使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JavaFileAccess类属于org.eclipse.xtext.xtext.generator.model包,在下文中一共展示了JavaFileAccess类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateProjectInfo
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
public void generateProjectInfo() {
final TypeReference projectInfoClass = TypeReference.typeRef(this.getProjectInfoClassName());
final JavaFileAccess file = this.fileAccessFactory.createJavaFile(projectInfoClass);
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("public class ");
String _simpleName = projectInfoClass.getSimpleName();
_builder.append(_simpleName);
_builder.append(" extends ");
TypeReference _typeRef = TypeReference.typeRef("org.eclipse.xtext.ui.wizard.DefaultProjectInfo");
_builder.append(_typeRef);
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("}");
_builder.newLine();
}
};
file.setContent(_client);
file.writeTo(this.getProjectConfig().getEclipsePlugin().getSrc());
}
示例2: generateWizardNewProjectCreationPage
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
public void generateWizardNewProjectCreationPage() {
final TypeReference mainPageClass = TypeReference.typeRef(this.getProjectWizardCreationPageClassName());
final JavaFileAccess file = this.fileAccessFactory.createJavaFile(mainPageClass);
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("public class ");
String _simpleName = mainPageClass.getSimpleName();
_builder.append(_simpleName);
_builder.append(" extends ");
TypeReference _typeRef = TypeReference.typeRef("org.eclipse.ui.dialogs.WizardNewProjectCreationPage");
_builder.append(_typeRef);
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("\t");
_builder.append("public ");
String _simpleName_1 = mainPageClass.getSimpleName();
_builder.append(_simpleName_1, "\t");
_builder.append("(String pageName) {");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append("super(pageName);");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
}
};
file.setContent(_client);
file.writeTo(this.getProjectConfig().getEclipsePlugin().getSrc());
}
示例3: compilePomDeclarationSearcher
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
public JavaFileAccess compilePomDeclarationSearcher(final Grammar it) {
TypeReference _pomDeclarationSearcher = this._ideaPluginClassNames.getPomDeclarationSearcher(it);
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("public class ");
String _simpleName = IdeaPluginGenerator.this._ideaPluginClassNames.getPomDeclarationSearcher(it).getSimpleName();
_builder.append(_simpleName);
_builder.append(" extends ");
TypeReference _typeRef = TypeReference.typeRef("org.eclipse.xtext.idea.pom.AbstractXtextPomDeclarationSearcher");
_builder.append(_typeRef);
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("\t");
_builder.append("public ");
String _simpleName_1 = IdeaPluginGenerator.this._ideaPluginClassNames.getPomDeclarationSearcher(it).getSimpleName();
_builder.append(_simpleName_1, "\t");
_builder.append("() {");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append("super(");
TypeReference _ideaLanguage = IdeaPluginGenerator.this._ideaPluginClassNames.getIdeaLanguage(IdeaPluginGenerator.this.getGrammar());
_builder.append(_ideaLanguage, "\t\t");
_builder.append(".INSTANCE);");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
}
};
return this.fileAccessFactory.createJavaFile(_pomDeclarationSearcher, _client);
}
示例4: compileAntlrTokenFileProvider
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
public JavaFileAccess compileAntlrTokenFileProvider(final Grammar grammar) {
TypeReference _antlrTokenFileProvider = this._ideaPluginClassNames.getAntlrTokenFileProvider(grammar);
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("public class ");
String _simpleName = IdeaPluginGenerator.this._ideaPluginClassNames.getAntlrTokenFileProvider(grammar).getSimpleName();
_builder.append(_simpleName);
_builder.append(" implements ");
_builder.append(IAntlrTokenFileProvider.class);
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("@");
_builder.append(Override.class, "\t");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("public ");
_builder.append(InputStream.class, "\t");
_builder.append(" getAntlrTokenFile() {");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append(ClassLoader.class, "\t\t");
_builder.append(" classLoader = getClass().getClassLoader();");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append("return classLoader.getResourceAsStream(\"");
String _tokens = IdeaPluginGenerator.this._ideaPluginClassNames.getTokens(grammar);
_builder.append(_tokens, "\t\t");
_builder.append("\");");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
}
};
return this.fileAccessFactory.createJavaFile(_antlrTokenFileProvider, _client);
}
示例5: compileSemanticHighlightVisitor
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
public JavaFileAccess compileSemanticHighlightVisitor(final Grammar grammar) {
TypeReference _semanticHighlightVisitor = this._ideaPluginClassNames.getSemanticHighlightVisitor(grammar);
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("public class ");
String _simpleName = IdeaPluginGenerator.this._ideaPluginClassNames.getSemanticHighlightVisitor(grammar).getSimpleName();
_builder.append(_simpleName);
_builder.append(" extends ");
TypeReference _typeRef = TypeReference.typeRef("org.eclipse.xtext.idea.highlighting.SemanticHighlightVisitor");
_builder.append(_typeRef);
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("public ");
String _simpleName_1 = IdeaPluginGenerator.this._ideaPluginClassNames.getSemanticHighlightVisitor(grammar).getSimpleName();
_builder.append(_simpleName_1, "\t");
_builder.append("() {");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
TypeReference _ideaLanguage = IdeaPluginGenerator.this._ideaPluginClassNames.getIdeaLanguage(grammar);
_builder.append(_ideaLanguage, "\t\t");
_builder.append(".INSTANCE.injectMembers(this);");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
}
};
return this.fileAccessFactory.createJavaFile(_semanticHighlightVisitor, _client);
}
示例6: compileAbstractCompletionContributor
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
public JavaFileAccess compileAbstractCompletionContributor(final Grammar grammar) {
TypeReference _abstractCompletionContributor = this._ideaPluginClassNames.getAbstractCompletionContributor(grammar);
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("public class ");
String _simpleName = IdeaPluginGenerator.this._ideaPluginClassNames.getAbstractCompletionContributor(grammar).getSimpleName();
_builder.append(_simpleName);
_builder.append(" extends ");
TypeReference _completionContributorSuperClass = IdeaPluginGenerator.this._ideaPluginClassNames.getCompletionContributorSuperClass(grammar);
_builder.append(_completionContributorSuperClass);
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("public ");
String _simpleName_1 = IdeaPluginGenerator.this._ideaPluginClassNames.getAbstractCompletionContributor(grammar).getSimpleName();
_builder.append(_simpleName_1, "\t");
_builder.append("(");
TypeReference _typeRef = TypeReference.typeRef("org.eclipse.xtext.idea.lang.AbstractXtextLanguage");
_builder.append(_typeRef, "\t");
_builder.append(" lang) {");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append("super(lang);");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
}
};
return this.fileAccessFactory.createJavaFile(_abstractCompletionContributor, _client);
}
示例7: generateIAutomatedIssueResolutionProvider
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
private void generateIAutomatedIssueResolutionProvider() {
JavaFileAccess jva = fileAccessFactory.createJavaFile(typeRef(getAutomatedIssueResolutionProviderName()));
AutomatedIssueResolutionProviderGenerator generator = new AutomatedIssueResolutionProviderGenerator(naming,
grammar);
generator.create(jva, getAutomatedIssueResolutionProviderSimpleName());
jva.writeTo(getProjectConfig().getRuntime().getSrc());
getProjectConfig().getRuntime().getManifest().getExportedPackages().add(getIssuesPackageName());
}
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:9,代码来源:AutomatedIssueResolutionFragment2.java
示例8: generateAutomatedIssueResolutionFactoryBase
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
private void generateAutomatedIssueResolutionFactoryBase() {
TypeReference tr = typeRef(getAutomatedIssueResolutionFactoryBaseName());
JavaFileAccess jva = fileAccessFactory.createJavaFile(tr);
AutomatedIssueResolutionFactoryBaseGenerator generator = new AutomatedIssueResolutionFactoryBaseGenerator(
naming, grammar);
generator.create(jva, tr.getSimpleName());
jva.writeTo(getProjectConfig().getRuntime().getSrc());
getProjectConfig().getRuntime().getManifest().getExportedPackages().add(getIssuesPackageName());
}
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:10,代码来源:AutomatedIssueResolutionFragment2.java
示例9: generateDerivedStateElementComparator
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
private void generateDerivedStateElementComparator() {
TypeReference tr = getDerivedStateElementComparatorName();
JavaFileAccess jva = fileAccessFactory.createJavaFile(tr);
DerivedStateElementComparatorGenerator generator = new DerivedStateElementComparatorGenerator();
generator.create(jva, tr.getSimpleName());
jva.writeTo(getProjectConfig().getRuntime().getSrc());
}
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:8,代码来源:DerivedStateCalculationFragment2.java
示例10: generateAntlrTokenFileProvider
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
public JavaFileAccess generateAntlrTokenFileProvider() {
GeneratedJavaFileAccess _xblockexpression = null;
{
@Extension
final GrammarNaming naming = this.productionNaming;
final GeneratedJavaFileAccess file = this.fileFactory.createGeneratedJavaFile(naming.getAntlrTokenFileProviderClass(this.getGrammar()));
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("public class ");
String _simpleName = naming.getAntlrTokenFileProviderClass(XtextAntlrGeneratorFragment2.this.getGrammar()).getSimpleName();
_builder.append(_simpleName);
_builder.append(" implements ");
_builder.append(IAntlrTokenFileProvider.class);
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("\t");
_builder.append("@Override");
_builder.newLine();
_builder.append("\t");
_builder.append("public ");
_builder.append(InputStream.class, "\t");
_builder.append(" getAntlrTokenFile() {");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append(ClassLoader.class, "\t\t");
_builder.append(" classLoader = getClass().getClassLoader();");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append("return classLoader.getResourceAsStream(\"");
String _tokensFileName = naming.getParserGrammar(XtextAntlrGeneratorFragment2.this.getGrammar()).getTokensFileName();
_builder.append(_tokensFileName, "\t\t");
_builder.append("\");");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
}
};
file.setContent(_client);
_xblockexpression = file;
}
return _xblockexpression;
}
示例11: generateUiInjectorProvider
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
protected JavaFileAccess generateUiInjectorProvider() {
JavaFileAccess _xblockexpression = null;
{
final JavaFileAccess file = this.fileAccessFactory.createJavaFile(this.uiInjectorProvider());
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("public class ");
String _simpleName = Junit4Fragment2.this.uiInjectorProvider().getSimpleName();
_builder.append(_simpleName);
_builder.append(" implements ");
TypeReference _iInjectorProvider = Junit4Fragment2.this.iInjectorProvider();
_builder.append(_iInjectorProvider);
_builder.append(" {");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("\t");
_builder.append("@Override");
_builder.newLine();
_builder.append("\t");
_builder.append("public ");
_builder.append(Injector.class, "\t");
_builder.append(" getInjector() {");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append("return ");
TypeReference _eclipsePluginActivator = Junit4Fragment2.this._xtextGeneratorNaming.getEclipsePluginActivator();
_builder.append(_eclipsePluginActivator, "\t\t");
_builder.append(".getInstance().getInjector(\"");
String _name = Junit4Fragment2.this.getGrammar().getName();
_builder.append(_name, "\t\t");
_builder.append("\");");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
}
};
file.setContent(_client);
_xblockexpression = file;
}
return _xblockexpression;
}
示例12: setTypeComment
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
public void setTypeComment(final StringConcatenationClient javaContent) {
final JavaFileAccess.JavaTypeAwareStringConcatenation javaStringConcat = new JavaFileAccess.JavaTypeAwareStringConcatenation(this);
javaStringConcat.append(javaContent);
this.typeComment = javaStringConcat;
}
示例13: createJavaFile
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
public JavaFileAccess createJavaFile(final TypeReference typeRef) {
return new JavaFileAccess(typeRef, this.codeConfig);
}
示例14: appliesTo
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
@Override
public boolean appliesTo(final JavaFileAccess javaFile) {
return true;
}
示例15: appliesTo
import org.eclipse.xtext.xtext.generator.model.JavaFileAccess; //导入依赖的package包/类
@Override
public boolean appliesTo(final JavaFileAccess javaFile) {
return javaFile.isMarkedAsGenerated();
}