/** * Returns the list of qualified names for which imports are to be added to the compilation unit. */ public Collection<String> getImports() { compactImports(); return imports; }
/** * @since 2.2. */ protected String format(String name, char separator, String prefix, boolean includePrefix, boolean includeLeadingSeparator) { return CodeGenUtil.format(name, separator, prefix, includePrefix, includeLeadingSeparator); }
/** * Creates an import manager for the given compilation unit package and short name. * This is the preferred constructor form, as it automatically adds the {@link #addMasterImport(String, String) master import} * for the compilation unit. * @since 2.5 * @see ImportManager#addMasterImport(String, String) */ public ImportManager(String compilationUnitPackage, String compilationUnitShortName) { this(compilationUnitPackage); addMasterImport(compilationUnitPackage, compilationUnitShortName); }
/** * Creates and caches an {@link org.eclipse.emf.codegen.util.ImportManager ImportManager} for use in generating Java * code. */ protected void createImportManager(String packageName, String className) { importManager = new ImportManager(packageName); importManager.addMasterImport(packageName, className); }
/** * Registers an import for the given qualified name. * @param qualifiedName the qualified name of the type to import, which may end with <code>".*"</code> for a wildcard import. */ public void addImport(String qualifiedName) { String importName = getImportName(qualifiedName); basicAddImport(getPackageName(importName), getShortName(importName), importName); }
/** * Determines whether the given non-wildcard import should be added. * By default, this returns false if the short name is a built-in Java language type name. * @since 2.8 */ protected boolean shouldImport(String packageName, String shortName, String importName) { return !CodeGenUtil.isJavaDefaultType(shortName); }
/** * Creates and returns a sub-monitor for the given progress monitor. When running stand-alone, the same monitor is * actually returned. * * @param monitor the parent monitor * @param ticks the number of work ticks allocated from the parent monitor */ protected Monitor createMonitor(Monitor monitor, int ticks) { return CodeGenUtil.createMonitor(monitor, ticks); }
public String uncapPrefixedName(String name, boolean forceDifferent) { return CodeGenUtil.uncapPrefixedName(name, forceDifferent); }
public void addPseudoImport(String qualifiedName) { importManager.addPseudoImport(qualifiedName); }
/** * Returns the equivalent imported short name for the given qualified name, if there is one, or the qualified name * itself otherwise. Optionally, the qualified name can be automatically imported if possible. * In fact, a parameterized type expression is also allowed, in which case the expression will be parsed to obtain the * individual imported names within it. Then the full expression, with the appropriate substitutions, is returned. * @param qualifiedName the qualified name or parameterized type expression. * @return the equivalent type or type expression, using short names wherever possible. */ public String getImportedName(String qualifiedName) { return getImportedName(qualifiedName, false); }
public String safeName(String name) { return CodeGenUtil.safeName(name); }
genModel.setImportManager(new ImportManager("org.bimserver.models")); genModel.setImportManager(new ImportManager("org.bimserver.models")); genModel.setImportManager(new ImportManager("org.bimserver.models")); genModel.setImportManager(new ImportManager("org.bimserver.models")); genModel.setImportManager(new ImportManager("org.bimserver.models")); genModel.setImportManager(new ImportManager("org.bimserver.models")); genModel.setImportManager(new ImportManager("org.bimserver.models")); genModel.setImportManager(new ImportManager("org.bimserver.models")); genModel.setImportManager(new ImportManager("org.bimserver.models")); genModel.setImportManager(new ImportManager("org.bimserver.models")); String implFileName = MODEL_PACKAGE + genPackage.getPackageName() + ".impl."; implFileName = implFileName.replace(".", File.separator) + genClass.getName() + "Impl.java"; genModel.setImportManager(new ImportManager("org.bimserver.models")); String interfaceFileName = MODEL_PACKAGE + genPackage.getPackageName() + "."; interfaceFileName = interfaceFileName.replace(".", File.separator) + genClass.getName() + ".java"; genModel.setImportManager(new ImportManager("org.bimserver.models"));
public static String safeName(String name) { if (CodeGenUtil.isJavaReservedWord(name)) return name + "_"; return name; }
public static Monitor createMonitor(Monitor monitor, int ticks) { return EMFPlugin.IS_ECLIPSE_RUNNING ? EclipseHelper.createMonitor(monitor, ticks) : monitor; }
/** * Registers an import for the given package name and short name. * Note that the <code>$</code> notation for inner classes is <em>not</em> supported by this method, since the short * name is explicitly specified. * @param packageName the package name of the type to import * @param shortName the short name of the type to import, or <code>"*"</code> for a wildcard import. */ public void addImport(String packageName, String shortName) { basicAddImport(normalize(packageName), normalize(shortName), null); }
/** * Creates and caches an {@link org.eclipse.emf.codegen.util.ImportManager ImportManager} for use in generating Java * code. */ protected void createImportManager(String packageName, String className) { importManager = new ImportManager(packageName); importManager.addMasterImport(packageName, className); }
/** * @since 2.2. */ protected String format(String name, char separator, String prefix, boolean includePrefix, boolean includeLeadingSeparator) { return CodeGenUtil.format(name, separator, prefix, includePrefix, includeLeadingSeparator); }
/** * Creates and returns a sub-monitor for the given progress monitor. When running stand-alone, the same monitor is * actually returned. * * @param monitor the parent monitor * @param ticks the number of work ticks allocated from the parent monitor */ protected Monitor createMonitor(Monitor monitor, int ticks) { return CodeGenUtil.createMonitor(monitor, ticks); }
public static String safeName(String name) { if (CodeGenUtil.isJavaReservedWord(name)) return name + "_"; return name; }
public static Monitor createMonitor(Monitor monitor, int ticks) { return EMFPlugin.IS_ECLIPSE_RUNNING ? EclipseHelper.createMonitor(monitor, ticks) : monitor; }