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


Java IFileSystemAccess.DEFAULT_OUTPUT属性代码示例

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


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

示例1: generate

public String generate(final Resource res, final JvmDeclaredType type) {
  String _xblockexpression = null;
  {
    res.eSetDeliver(false);
    EList<EObject> _contents = res.getContents();
    this.builder.<JvmDeclaredType>operator_add(_contents, type);
    res.eSetDeliver(true);
    final InMemoryFileSystemAccess fsa = new InMemoryFileSystemAccess();
    this.generator.doGenerate(res, fsa);
    Map<String, CharSequence> _files = fsa.getFiles();
    String _replace = type.getIdentifier().replace(".", "/");
    String _plus = (IFileSystemAccess.DEFAULT_OUTPUT + _replace);
    String _plus_1 = (_plus + ".java");
    _xblockexpression = _files.get(_plus_1).toString();
  }
  return _xblockexpression;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:17,代码来源:JvmModelGeneratorTest.java

示例2: getFileSystemAccess

protected IFileSystemAccess2 getFileSystemAccess(final IProject project, final IProgressMonitor monitor) {
	EclipseResourceFileSystemAccess2 access = fileSystemAccessProvider.get();
	access.setContext(project);
	access.setMonitor(monitor);
	OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
	defaultOutput.setDescription("Output Folder");
	defaultOutput.setOutputDirectory("./");
	defaultOutput.setOverrideExistingResources(true);
	defaultOutput.setCreateOutputDirectory(true);
	defaultOutput.setCleanUpDerivedResources(false);
	defaultOutput.setSetDerivedProperty(false);
	defaultOutput.setKeepLocalHistory(false);
	HashMap<String, OutputConfiguration> outputConfigurations = new HashMap<String, OutputConfiguration>();
	outputConfigurations.put(IFileSystemAccess.DEFAULT_OUTPUT, defaultOutput);
	access.setOutputConfigurations(outputConfigurations);
	return access;
}
 
开发者ID:vicegd,项目名称:org.xtext.dsl.restaurante,代码行数:17,代码来源:RestauranteProjectCreator.java

示例3: getOutputConfigurations

@Override
public Set<OutputConfiguration> getOutputConfigurations() {
	OutputConfiguration config = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
	config.setOutputDirectory("src-gen");
	if (useOutputPerSource) {
		SourceMapping sourceMapping = new OutputConfiguration.SourceMapping("src2");
		sourceMapping.setOutputDirectory("src2-gen");
		config.getSourceMappings().add(sourceMapping);
		config.setUseOutputPerSourceFolder(true);
	}
	return ImmutableSet.of(config);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:12,代码来源:StandaloneBuilderTest.java

示例4: getDefaultConfig

/**
 * Creates output configuration for regular generated files.
 *
 * @return output configuration
 */
private OutputConfiguration getDefaultConfig() {
  OutputConfiguration config = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
  config.setDescription("Output configuration for generated classes");
  config.setOverrideExistingResources(true);
  config.setOutputDirectory("src-gen");
  return config;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:12,代码来源:ExportOutputConfigurationProvider.java

示例5: getOutputConfigurations

/**
 * @return a set of {@link OutputConfiguration} available for the generator
 */
public Set<OutputConfiguration> getOutputConfigurations() {
    OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
    defaultOutput.setDescription("Output Folder");
    defaultOutput.setOutputDirectory("./src-gen");
    defaultOutput.setOverrideExistingResources(true);
    defaultOutput.setCreateOutputDirectory(true);
    defaultOutput.setCleanUpDerivedResources(true);
    defaultOutput.setSetDerivedProperty(true);
    return newHashSet(defaultOutput);
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:13,代码来源:MyOutputConfigurationProvider.java

示例6: getOutputConfigurations

public Set<OutputConfiguration> getOutputConfigurations() {
	OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
	defaultOutput.setDescription("Output Folder");
	defaultOutput.setOutputDirectory("./application-gen");
	defaultOutput.setOverrideExistingResources(true);
	defaultOutput.setCreateOutputDirectory(true);
	defaultOutput.setCleanUpDerivedResources(true);
	defaultOutput.setSetDerivedProperty(true);
	defaultOutput.setKeepLocalHistory(true);
	return newHashSet(defaultOutput);
}
 
开发者ID:nohum,项目名称:android-code-generation,代码行数:11,代码来源:CustomOutputConfigProvider.java

示例7: bug390290InnerClassMemberImport

@Test
public void bug390290InnerClassMemberImport() {
  try {
    final XExpression expression = this.expression("null");
    final Procedure1<JvmGenericType> _function = (JvmGenericType it) -> {
      final JvmGenericType innerClass = this.builder.toClass(it, "InnerClass");
      final JvmGenericType innerClassString = this.builder.toClass(it, "String");
      EList<JvmMember> _members = it.getMembers();
      this.builder.<JvmGenericType>operator_add(_members, innerClass);
      EList<JvmMember> _members_1 = it.getMembers();
      this.builder.<JvmGenericType>operator_add(_members_1, innerClassString);
      EList<JvmMember> _members_2 = it.getMembers();
      final Procedure1<JvmOperation> _function_1 = (JvmOperation fooMethod) -> {
        EList<JvmFormalParameter> _parameters = fooMethod.getParameters();
        JvmFormalParameter _parameter = this.builder.toParameter(it, "p1", this.references.createTypeRef(innerClass));
        this.builder.<JvmFormalParameter>operator_add(_parameters, _parameter);
        EList<JvmFormalParameter> _parameters_1 = fooMethod.getParameters();
        JvmFormalParameter _parameter_1 = this.builder.toParameter(it, "p2", this.references.createTypeRef(innerClassString));
        this.builder.<JvmFormalParameter>operator_add(_parameters_1, _parameter_1);
        this.builder.setBody(fooMethod, expression);
      };
      JvmOperation _method = this.builder.toMethod(it, "foo", this.references.getTypeForName(String.class, expression), _function_1);
      this.builder.<JvmOperation>operator_add(_members_2, _method);
    };
    final JvmGenericType clazz = this.builder.toClass(expression, "my.test.Outer", _function);
    expression.eResource().eSetDeliver(false);
    EList<EObject> _contents = expression.eResource().getContents();
    this.builder.<JvmGenericType>operator_add(_contents, clazz);
    expression.eResource().eSetDeliver(true);
    final InMemoryFileSystemAccess fsa = new InMemoryFileSystemAccess();
    this.generator.doGenerate(expression.eResource(), fsa);
    Map<String, CharSequence> _files = fsa.getFiles();
    String _replace = clazz.getIdentifier().replace(".", "/");
    String _plus = (IFileSystemAccess.DEFAULT_OUTPUT + _replace);
    String _plus_1 = (_plus + ".java");
    final String code = _files.get(_plus_1).toString();
    Assert.assertFalse(code.contains("import"));
    Assert.assertTrue(code, code.contains("java.lang.String foo"));
    final Class<?> compiledClass = this.javaCompiler.compileToClass(clazz.getIdentifier(), code);
    this.helper.assertNoErrors(IterableExtensions.<EObject>head(expression.eResource().getContents()));
    Assert.assertEquals(2, ((List<Class<?>>)Conversions.doWrapArray(compiledClass.getDeclaredClasses())).size());
    Assert.assertNotNull(compiledClass.getMethod("foo", IterableExtensions.<Class<?>>head(((Iterable<Class<?>>)Conversions.doWrapArray(compiledClass.getDeclaredClasses()))), IterableExtensions.<Class<?>>last(((Iterable<Class<?>>)Conversions.doWrapArray(compiledClass.getDeclaredClasses())))));
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:46,代码来源:JvmModelGeneratorTest.java


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