for (Map.Entry<String, String> mapping : refSpec.getMappedParams().entrySet()) { if (xmlSpec.getParam(mapping.getKey()).isFeatureId()) { continue;
boolean child = feature.hasId() ? false : true; // no id is considered a child to make the list-add not break the branch if(refSpec.hasMappedParams()) { for (Map.Entry<String, String> mapping : refSpec.getMappedParams().entrySet()) { final String paramName = mapping.getKey(); final String refParamName = mapping.getValue();
for (Map.Entry<String, String> mapping : refSpec.getMappedParams().entrySet()) { final FeatureParameterSpec param = xmlSpec.getParam(mapping.getKey()); if(!param.isFeatureId()) {
private void assertRefParamMapping(final FeatureReferenceSpec refSpec, final ResolvedFeatureSpec targetSpec) throws ProvisioningDescriptionException { if (!targetSpec.xmlSpec.hasId()) { throw new ProvisioningDescriptionException(id + " feature spec declares reference " + refSpec.getName() + " to feature spec " + targetSpec.id + " that has no ID parameters"); } if(!refSpec.hasMappedParams()) { for(FeatureParameterSpec targetIdParam : targetSpec.xmlSpec.getIdParams()) { if(!xmlSpec.hasParam(targetIdParam.getName())) { throw new ProvisioningDescriptionException(Errors.nonExistingForeignKeyParam(refSpec.getName(), id, targetIdParam.getName())); } } return; } if (targetSpec.xmlSpec.getIdParams().size() != refSpec.getParamsMapped()) { throw new ProvisioningDescriptionException("The number of foreign key parameters of reference " + refSpec.getName() + " in feature spec " + id + " does not match the number of the ID parameters of the referenced feature spec " + targetSpec.id); } for(Map.Entry<String, String> mapping : refSpec.getMappedParams().entrySet()) { if (!xmlSpec.hasParam(mapping.getKey())) { throw new ProvisioningDescriptionException(Errors.nonExistingForeignKeyParam(refSpec.getName(), id, mapping.getKey())); } if (!targetSpec.xmlSpec.hasParam(mapping.getValue())) { throw new ProvisioningDescriptionException( Errors.nonExistingForeignKeyTarget(mapping.getKey(), refSpec.getName(), id, mapping.getValue(), targetSpec.id)); } } }
addAttribute(refE, Attribute.INCLUDE, TRUE); for(Map.Entry<String, String> mapping : ref.getMappedParams().entrySet()) { final ElementNode paramE = addElement(refE, Element.PARAMETER); addAttribute(paramE, Attribute.NAME, mapping.getKey());