/** Constructor. * * @param importManager the import manager. */ public ExtraLanguageAppendable(ImportManager importManager) { super(false); ImportManager im = importManager; if (im == null) { im = new ImportManager(true); } this.importManager = im; }
public StringBuilderBasedAppendable() { this(new ImportManager(false)); }
protected ImportManager createImportManager(final JvmDeclaredType type) { return new ImportManager(true, type); }
/** Constructor. * * @param indentation the indentation string. * @param lineSeparator the line separator string. * @param importManager the import manager. */ public ExtraLanguageAppendable(String indentation, String lineSeparator, ImportManager importManager) { super(indentation, lineSeparator, false); ImportManager im = importManager; if (im == null) { im = new ImportManager(true); } this.importManager = im; }
@Override public void appendInlineAnnotation(JvmAnnotationTarget target, XtendExecutable source) { final ImportManager imports = new ImportManager(); final InlineAnnotationTreeAppendable result = newAppendable(imports); generate(source.getExpression(), null, source, result); final String content = result.getContent(); if (!Strings.isEmpty(content)) { final List<String> importedTypes = imports.getImports(); final JvmTypeReference[] importArray = new JvmTypeReference[importedTypes.size()]; for (int i = 0; i < importArray.length; ++i) { importArray[i] = this.typeReferences.getTypeForName(importedTypes.get(i), source); } appendInlineAnnotation(target, source.eResource().getResourceSet(), content, result.isConstant(), result.isStatement(), importArray); } }
final String typeComment = getTypeComment(compilationUnit, lineSeparator); final IJvmTypeProvider typeProvider = this.jdtTypeProviderFactory.findOrCreateTypeProvider(resourceSet); final ImportManager imports = new ImportManager(true); this.injector.injectMembers(imports); final FakeTreeAppendable appender = new FakeTreeAppendable(imports);
ImportManager concreteImports = new ImportManager(true); XImportSection importSection = getScript().getImportSection(); if (importSection != null) {
final ImportManager importManager = new ImportManager(); final ITreeAppendable it = new FakeTreeAppendable(importManager);
@SuppressWarnings({"checkstyle:methodlength", "checkstyle:npathcomplexity"}) private void generateAbstractTest(File outputFolder) throws IOException { getLog().debug("Generating abstract test"); //$NON-NLS-1$ final ImportManager importManager = new ImportManager(); final ITreeAppendable it = new FakeTreeAppendable(importManager); it.append("@").append(SuppressWarnings.class).append("(\"all\")"); //$NON-NLS-1$ //$NON-NLS-2$
private void generateRunner(File outputFolder) throws IOException { getLog().debug("Generating test runner"); //$NON-NLS-1$ final ImportManager importManager = new ImportManager(); final ITreeAppendable it = new FakeTreeAppendable(importManager); it.append("@").append(SuppressWarnings.class).append("(\"all\")"); //$NON-NLS-1$ //$NON-NLS-2$