Search in sources :

Example 6 with FeatureParameterSpec

use of org.jboss.galleon.spec.FeatureParameterSpec in project galleon by wildfly.

the class ResolvedFeatureSpec method resolveFeatureId.

ResolvedFeatureId resolveFeatureId(Map<String, String> params) throws ProvisioningException {
    if (!xmlSpec.hasId()) {
        return null;
    }
    final List<FeatureParameterSpec> idSpecs = xmlSpec.getIdParams();
    if (idSpecs.size() == 1) {
        final FeatureParameterSpec idSpec = idSpecs.get(0);
        return new ResolvedFeatureId(id, Collections.singletonMap(idSpec.getName(), resolveIdParamValue(params, idSpec)));
    }
    final Map<String, Object> resolvedParams = new HashMap<>(idSpecs.size());
    for (FeatureParameterSpec param : idSpecs) {
        resolvedParams.put(param.getName(), resolveIdParamValue(params, param));
    }
    return new ResolvedFeatureId(id, resolvedParams);
}
Also used : FeatureParameterSpec(org.jboss.galleon.spec.FeatureParameterSpec) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

FeatureParameterSpec (org.jboss.galleon.spec.FeatureParameterSpec)6 HashMap (java.util.HashMap)3 LinkedHashMap (java.util.LinkedHashMap)3 Map (java.util.Map)3 FeatureReferenceSpec (org.jboss.galleon.spec.FeatureReferenceSpec)3 ProvisioningDescriptionException (org.jboss.galleon.ProvisioningDescriptionException)2 FeatureAnnotation (org.jboss.galleon.spec.FeatureAnnotation)2 FeatureDependencySpec (org.jboss.galleon.spec.FeatureDependencySpec)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 ProvisioningException (org.jboss.galleon.ProvisioningException)1 FeatureSpecInfo (org.jboss.galleon.cli.model.FeatureSpecInfo)1 Identity (org.jboss.galleon.cli.model.Identity)1 PackageInfo (org.jboss.galleon.cli.model.PackageInfo)1 CapabilitySpec (org.jboss.galleon.spec.CapabilitySpec)1 ElementNode (org.jboss.galleon.xml.util.ElementNode)1