Java 类org.eclipse.xtext.generator.GeneratorDelegate 实例源码

项目:xtext-extras    文件:CompilationTestHelper.java   
protected void doGenerate() {
    if (access == null) {
        doValidation();
        access = fileSystemAccessProvider.get();

        access.setOutputConfigurations(outputConfigurations);
        for (Resource resource : sources) {
            if (resource instanceof XtextResource) {
                access.setProjectName(PROJECT_NAME);
                XtextResource xtextResource = (XtextResource) resource;
                IResourceServiceProvider resourceServiceProvider = xtextResource.getResourceServiceProvider();
                GeneratorDelegate generator = resourceServiceProvider.get(GeneratorDelegate.class);
                if (generator != null) {
                    GeneratorContext context = new GeneratorContext();
                    context.setCancelIndicator(CancelIndicator.NullImpl);
                    generator.generate(xtextResource, access, context);
                }
            }
        }
        generatedCode = newHashMap();
        for (final GeneratedFile e : access.getGeneratedFiles()) {
            if (e.getJavaClassName() != null) {
                generatedCode.put(e.getJavaClassName(), e.getContents().toString());
            }
        }
    }
}
项目:CARMA    文件:MyCompilationTestHelper.java   
protected void doGenerate() {
    if (access == null) {
        doValidation();
        access = fileSystemAccessProvider.get();

        access.setOutputConfigurations(outputConfigurations);
        for (Resource resource : sources) {
            if (resource instanceof XtextResource) {
                access.setProjectName(PROJECT_NAME);
                XtextResource xtextResource = (XtextResource) resource;
                IResourceServiceProvider resourceServiceProvider = xtextResource.getResourceServiceProvider();
                GeneratorDelegate generator = resourceServiceProvider.get(GeneratorDelegate.class);
                if (generator != null) {
                    GeneratorContext context = new GeneratorContext();
                    context.setCancelIndicator(CancelIndicator.NullImpl);
                    generator.generate(xtextResource, access, context);
                }
            }
        }
        generatedCode = newHashMap();
        for (final GeneratedFile e : access.getGeneratedFiles()) {
            if (e.getJavaClassName() != null) {
                generatedCode.put(e.getJavaClassName(), e.getContents().toString());
            }
        }
    }
}
项目:xtext-extras    文件:LanguageAccess.java   
public GeneratorDelegate getGenerator() {
    return resourceServiceProvider.get(GeneratorDelegate.class);
}