Add properties to the {@link ModuleSpec}

@param moduleSpecBuilder builder to populate
@param properties properties to add
435880
public static void addPropertiesToSpec(ModuleSpec.Builder moduleSpecBuilder, Map<String, String> properties) {
        for (Entry<String, String> entry : properties.entrySet()) {
            moduleSpecBuilder.addProperty(entry.getKey(), entry.getValue());
        }
    }
1212227
private void addTreeContainerProperties(CmsResourceTableProperty... properties) {

        for (CmsResourceTableProperty property : properties) {
            m_treeContainer.addContainerProperty(property, property.getColumnType(), property.getDefaultValue());
        }
    }
841140
public ConfigViewImpl withProperties(Properties properties) {
        if (properties != null) {
            this.properties = properties;
            this.strategy.withProperties(properties);
        }
        return this;
    }
253043
private static void addProperties(EndpointReferenceType epr, SLProperties props) {
        MetadataType metadata = WSAEndpointReferenceUtils.getSetMetadata(epr);
        ServiceLocatorPropertiesType jaxbProps = SLPropertiesConverter.toServiceLocatorPropertiesType(props);

        JAXBElement<ServiceLocatorPropertiesType>
            slp = SL_OBJECT_FACTORY.createServiceLocatorProperties(jaxbProps);
        metadata.getAny().add(slp);
    }
560477
public void setProductModules(final String name, final List<String> moduleNames) {
        final DbProduct dbProduct = getProduct(name);
        dbProduct.setModules(moduleNames);
        repositoryHandler.store(dbProduct);
    }
316225
public GlobalJmxStatisticsConfigurationBuilder withProperties(Properties properties) {
      attributes.attribute(PROPERTIES).set(new TypedProperties(properties));
      return this;
   }
352417
public void putProperties(Map<String, String> properties) {
		for (Map.Entry<String, String> property : properties.entrySet()) {
			put(property.getKey(), property.getValue());
		}
	}
1073907
public static void populateModuleSpecWithCoreDependencies(ModuleSpec.Builder moduleSpecBuilder, ScriptArchive scriptArchive) throws ModuleLoadException {
        Objects.requireNonNull(moduleSpecBuilder, "moduleSpecBuilder");
        Objects.requireNonNull(scriptArchive, "scriptArchive");

        Set<String> compilerPlugins = scriptArchive.getModuleSpec().getCompilerPluginIds();
        for (String compilerPluginId : compilerPlugins) {
            moduleSpecBuilder.addDependency(DependencySpec.createModuleDependencySpec(getPluginModuleId(compilerPluginId), false));
        }
        moduleSpecBuilder.addDependency(JRE_DEPENDENCY_SPEC);
        // TODO: Why does a module need a dependency on Nicobar itself?
        moduleSpecBuilder.addDependency(NICOBAR_CORE_DEPENDENCY_SPEC);
        moduleSpecBuilder.addDependency(DependencySpec.createLocalDependencySpec());
    }
199967
public static void populateModuleSpecWithResources(ModuleSpec.Builder moduleSpecBuilder, ScriptArchive scriptArchive) throws ModuleLoadException {
        Objects.requireNonNull(moduleSpecBuilder, "moduleSpecBuilder");
        Objects.requireNonNull(scriptArchive, "scriptArchive");

        MultiplePathFilterBuilder pathFilterBuilder = PathFilters.multiplePathFilterBuilder(true);
        Set<String> archiveEntryNames = scriptArchive.getArchiveEntryNames();
        pathFilterBuilder.addFilter(PathFilters.in(archiveEntryNames), true);

        // add the root resources and classes to the module. If the root is a directory, all files under the tree
        // are added to the module. If it's a jar, then all files in the jar are added.
        URL url = scriptArchive.getRootUrl();
        if (url != null) {
            try {
                File file = Paths.get(url.toURI()).toFile();
                String filePath = file.getPath();
                ResourceLoader rootResourceLoader = null;
                if (file.isDirectory()) {
                    rootResourceLoader = ResourceLoaders.createFileResourceLoader(filePath, file);
                } else if (file.getPath().endsWith(".jar")) {
                    try {
                        rootResourceLoader = ResourceLoaders.createJarResourceLoader(filePath, new JarFile(file));
                    } catch (IOException e) {
                        throw new ModuleLoadException(e);
                    }
                }
                if (rootResourceLoader != null) {
                    moduleSpecBuilder.addResourceRoot(ResourceLoaderSpec.createResourceLoaderSpec(rootResourceLoader, pathFilterBuilder.create()));
                }
            } catch (URISyntaxException e) {
                throw new ModuleLoadException("Unsupported URL syntax: " + url, e);
            }
        }
        // add dependencies to the module spec
        ScriptModuleSpec scriptModuleSpec = scriptArchive.getModuleSpec();

        // add string based properties from module spec metadata to the module spec being created
        Map<String, Object> archiveMetadata = scriptModuleSpec.getMetadata();
        Map<String, String> stringMetadata = new HashMap<String, String>();
        for (Entry<String, Object> entry: archiveMetadata.entrySet()) {
            if (entry.getValue() instanceof String) {
                stringMetadata.put(entry.getKey(), (String)entry.getValue());
            }
        }
        addPropertiesToSpec(moduleSpecBuilder, stringMetadata);

        // override the default ModuleClassLoader to use our customer classloader
        moduleSpecBuilder.setModuleClassLoaderFactory(JBossModuleClassLoader.createFactory(scriptArchive));
    }
1228442
@Override
    public void setProperties(Property[] newProperties) {
        // unregister the listeners from previous properties
        for (Property prop : properties) {
            prop.removePropertyChangeListener(this);
        }

        // replace the current properties
        properties.clear();
        properties.addAll(Arrays.asList(newProperties));

        // add listeners
        for (Property prop : properties) {
            prop.addPropertyChangeListener(this);
        }

        buildModel();
    }
720617
void addExcludedResource(String moduleResource) {

        CmsModuleResourceSelectField resField = createModuleResourceField(moduleResource);
        if (resField != null) {
            m_excludedResourcesGroup.addRow(resField);
        }
    }
459947
public void setBuilderCustomizers(
			Collection<? extends UndertowBuilderCustomizer> customizers) {
		Assert.notNull(customizers, "Customizers must not be null");
		this.builderCustomizers = new ArrayList<>(customizers);
	}
699269
public static void setPropertiesDir(String propertiesDir) {
		if (propertiesDir == null)
			propertiesDir = "";
		propertiesDir = propertiesDir.trim();
		if (!propertiesDir.endsWith("/"))
			propertiesDir += "/";
		ConfigFactory.propertiesDir = propertiesDir;
		init();
	}
433233
public static void setPropertyValue(BeanDefinitionBuilder builder, String propertyValue, String propertyName) {
        if (StringUtils.hasText(propertyValue)) {
            builder.addPropertyValue(propertyName, propertyValue);
        }
    }
877930
private void addAllDependenciesAndPermissions(final ModuleSpecification moduleSpecification, final AdditionalModuleSpecification module) {
        module.addSystemDependencies(moduleSpecification.getSystemDependencies());
        module.addLocalDependencies(moduleSpecification.getLocalDependencies());
        for(ModuleDependency dep : moduleSpecification.getUserDependencies()) {
            if(!dep.getIdentifier().equals(module.getModuleIdentifier())) {
                module.addUserDependency(dep);
            }
        }
        for(PermissionFactory factory : moduleSpecification.getPermissionFactories()) {
            module.addPermissionFactory(factory);
        }
    }
982469
@SuppressWarnings("unchecked")
    private void setupProperties(PropertyDescriptor[] propertyDescriptors) {
        if (theCachedClass.isInterface) {
            LinkedList<CachedClass> superClasses = new LinkedList<CachedClass>();
            superClasses.add(ReflectionCache.OBJECT_CLASS);
            Set interfaces = theCachedClass.getInterfaces();

            LinkedList<CachedClass> superInterfaces = new LinkedList<CachedClass>(interfaces);
            // sort interfaces so that we may ensure a deterministic behaviour in case of
            // ambiguous fields (class implementing two interfaces using the same field)
            if (superInterfaces.size()>1) {
                Collections.sort(superInterfaces, CACHED_CLASS_NAME_COMPARATOR);
            }

            SingleKeyHashMap iPropertyIndex = classPropertyIndex.getNotNull(theCachedClass);
            for (CachedClass iclass : superInterfaces) {
                SingleKeyHashMap sPropertyIndex = classPropertyIndex.getNotNull(iclass);
                copyNonPrivateFields(sPropertyIndex, iPropertyIndex);
                addFields(iclass, iPropertyIndex);
            }
            addFields(theCachedClass, iPropertyIndex);

            applyPropertyDescriptors(propertyDescriptors);
            applyStrayPropertyMethods(superClasses, classPropertyIndex, true);

            makeStaticPropertyIndex();
        } else {
            LinkedList<CachedClass> superClasses = getSuperClasses();
            LinkedList<CachedClass> interfaces = new LinkedList<CachedClass>(theCachedClass.getInterfaces());
            // sort interfaces so that we may ensure a deterministic behaviour in case of
            // ambiguous fields (class implementing two interfaces using the same field)
            if (interfaces.size()>1) {
                Collections.sort(interfaces, CACHED_CLASS_NAME_COMPARATOR);
            }

            // if this an Array, then add the special read-only "length" property
            if (theCachedClass.isArray) {
                SingleKeyHashMap map = new SingleKeyHashMap();
                map.put("length", arrayLengthProperty);
                classPropertyIndex.put(theCachedClass, map);
            }

            inheritStaticInterfaceFields(superClasses, new LinkedHashSet(interfaces));
            inheritFields(superClasses);

            applyPropertyDescriptors(propertyDescriptors);

            applyStrayPropertyMethods(superClasses, classPropertyIndex, true);
            applyStrayPropertyMethods(superClasses, classPropertyIndexForSuper, false);

            copyClassPropertyIndexForSuper(classPropertyIndexForSuper);
            makeStaticPropertyIndex();
        }
    }
1100630
private Map<String, String> collectModuleSpecificProps(DefaultInputModule module) {
    Map<String, String> moduleSpecificProps = new HashMap<>();
    AbstractProjectOrModule parent = hierarchy.parent(module);
    if (parent == null) {
      moduleSpecificProps.putAll(module.properties());
    } else {
      Map<String, String> parentProps = parent.properties();
      for (Map.Entry<String, String> entry : module.properties().entrySet()) {
        if (!parentProps.containsKey(entry.getKey()) || !parentProps.get(entry.getKey()).equals(entry.getValue())) {
          moduleSpecificProps.put(entry.getKey(), entry.getValue());
        }
      }
    }
    return moduleSpecificProps;
  }