adds the qualified names to the export-package attribute, if not already
present.

@param packages - passing parameterized packages is not supported
165042
public void addExportedPackages(Set<String> packages) {
		String s = (String) getMainAttributes().get(EXPORT_PACKAGE);
		Wrapper<Boolean> modified = Wrapper.wrap(this.modified);
		String result = mergeIntoCommaSeparatedList(s, packages, modified, lineDelimiter);
		this.modified = modified.get();
		getMainAttributes().put(EXPORT_PACKAGE, result);
	}
943486
public void buildPackageTags(XMLNode node, Content packageContentTree) {
        if (configuration.nocomment) {
            return;
        }
        packageWriter.addPackageTags(packageContentTree);
    }
305411
public void addImport(String fullyQualifiedName) {
    String[] importSplit = fullyQualifiedName.split("\\.");
    String className = importSplit[importSplit.length - 1];

    classNameToFullyQualifiedName.put(className, fullyQualifiedName);
  }
375969
protected void addPackageInfo(PackageInfo packageInfo) {
        if (packageInfo != null) {
            packageInfoMap.put(packageInfo.getInternalPackageName(), packageInfo);
        }
    }
227203
public void addImportName(ClassDesc classDesc, EnumConstants importedClass) {
    ClassConstants classConstant = importedClass.getClassConstant();
    String packageName = classConstant.getPackageName();
    if (isImportTargetPackage(classDesc, packageName)) {
      classDesc.addImportName(importedClass.getImportName());
    }
  }
392223
@PublicAPI(usage = ACCESS)
    public JavaClasses importPackages(Collection<String> packages) {
        Set<Location> locations = new HashSet<>();
        for (String pkg : packages) {
            locations.addAll(Locations.ofPackage(pkg));
        }
        return importLocations(locations);
    }
581530
@Override
    public DEBBuilder setPackageName(String name)
    {
        this.name = name;
        control.setPackage(name);
        return this;
    }
1289188
public static ValidationResult validatePackageName(String packageName)
   {
      if (Strings.isNullOrEmpty(packageName))
         return new ValidationResult(ERROR, Messages.notNullOrEmpty(PACKAGE_NAME));
      int indexOfDot = packageName.indexOf(".");
      if (indexOfDot == -1)
      {
         return validateIdentifier(packageName, PACKAGE_NAME);
      }
      else if (indexOfDot == 0)
      {
         return new ValidationResult(ERROR, "The package name must not start with a '.'");
      }
      else if (packageName.charAt(packageName.length() - 1) == '.')
      {
         return new ValidationResult(ERROR, "The package name must not end with a '.'");
      }
      else
      {
         String[] names = packageName.split("[.]");
         for (String name : names)
         {
            if (Strings.isNullOrEmpty(name))
            {
               return new ValidationResult(ERROR, Messages.isInvalidPackageName(packageName));
            }
            ValidationResult result = validateIdentifier(name, PACKAGE_NAME);
            if (!result.getType().equals(ResultType.INFO))
            {
               return result;
            }
         }
      }
      return new ValidationResult(INFO);
   }
844390
public Weld addPackages(boolean scanRecursively, Class<?>... packageClasses) {
        for (Class<?> packageClass : packageClasses) {
            addPackage(scanRecursively, packageClass);
        }
        return this;
    }
1349996
protected void packageDef(AST packageDef) {
        List<AnnotationNode> annotations = new ArrayList<AnnotationNode>();
        AST node = packageDef.getFirstChild();
        if (isType(ANNOTATIONS, node)) {
            processAnnotations(annotations, node);
            node = node.getNextSibling();
        }
        String name = qualifiedName(node);
        // TODO should we check package node doesn't already exist? conflict?
        PackageNode packageNode = setPackage(name, annotations);
        configureAST(packageNode, packageDef);
    }
1013446
public void setAttributeNames(java.util.Collection<String> attributeNames) {
        if (attributeNames == null) {
            this.attributeNames = null;
            return;
        }

        this.attributeNames = new java.util.ArrayList<String>(attributeNames);
    }
881659
public void scan(final String[] packages) {
        LOGGER.info("Scanning packages {}:", ArrayUtils.toString(packages));
        for (final String pkg : packages) {
            try {
                final String pkgFile = pkg.replace('.', '/');
                final Enumeration<URL> urls = getRootClassloader().getResources(pkgFile);
                while (urls.hasMoreElements()) {
                    final URL url = urls.nextElement();
                    try {
                        final URI uri = getURI(url);
                        LOGGER.debug("Scanning {}", uri);
                        scan(uri, pkgFile);
                    } catch (final URISyntaxException e) {
                        LOGGER.debug("URL {} cannot be converted to a URI", url, e);
                    }
                }
            } catch (final IOException ex) {
                throw new RuntimeException("The resources for the package" + pkg + ", could not be obtained",
                        ex);
            }
        }
        LOGGER.info(
                "Found {} matching classes and {} matching files",
                matchingClasses.size(),
                matchingFiles.size());
    }
1322674
public void addStaticImport(String fullyQualifiedName) {
    String[] importSplit = fullyQualifiedName.split("\\.");
    String symbolName = importSplit[importSplit.length - 1];

    methodNameToFullyQualifiedName.put(symbolName, fullyQualifiedName);
    propertyNameToFullyQualifiedName.put(symbolName, fullyQualifiedName);
  }
650415
public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes

		// Initialize classes and features; add operations and parameters
		initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getDocumentRoot_BackgroundColor(), this.getHexColor(), "backgroundColor", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getDocumentRoot_BorderColor(), this.getHexColor(), "borderColor", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getDocumentRoot_Color(), this.getHexColor(), "color", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Initialize data types
		initEDataType(hexColorEDataType, String.class, "HexColor", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);

		// Create resource
		createResource(eNS_URI);

		// Create annotations
		// http:///org/eclipse/emf/ecore/util/ExtendedMetaData
		createExtendedMetaDataAnnotations();
	}
291515
public void addRequiredBundles(Set<String> bundles) {
		// TODO manage transitive dependencies
		// don't require self
		Set<String> bundlesToMerge;
		String bundleName = (String) getMainAttributes().get(BUNDLE_SYMBOLIC_NAME);
		if (bundleName != null) {
			int idx = bundleName.indexOf(';');
			if (idx >= 0) {
				bundleName = bundleName.substring(0, idx);
			}
		}
		if (bundleName != null && bundles.contains(bundleName)
				|| projectName != null && bundles.contains(projectName)) {
			bundlesToMerge = new LinkedHashSet<String>(bundles);
			bundlesToMerge.remove(bundleName);
			bundlesToMerge.remove(projectName);
		} else {
			bundlesToMerge = bundles;
		}
		String s = (String) getMainAttributes().get(REQUIRE_BUNDLE);
		Wrapper<Boolean> modified = Wrapper.wrap(this.modified);
		String result = mergeIntoCommaSeparatedList(s, bundlesToMerge, modified, lineDelimiter);
		this.modified = modified.get();
		getMainAttributes().put(REQUIRE_BUNDLE, result);
	}
191006
private static List<String> normalizePackagePrefixes(List<String> packages)
    {
        if (packages == null)
            return null;

        List<String> result = new ArrayList<>(packages.size());
        for (String pkg : packages)
        {
            if(pkg.endsWith(".*")){
                System.out.println("Warning: removing the .* suffix from the package prefix: " + pkg);
            }
            result.add(StringUtils.removeEndIgnoreCase(pkg, ".*"));
        }

        return packages;
    }
374897
public ScanningModuleBuilder excludePackages(String... packages) {
        return excludeClassesWhen(cls -> {
            for (String pkg : packages) {
                if (cls.getPackage().getName().startsWith(pkg)) {
                    return true;
                };
            }
            return false;
        });
    }