// Next get the attributes
List<NameValuePair> nvps =
reader.readNameValuePairs(name, templateAttName, true);
// Create new LayoutComposition
LayoutComposition compElt = new LayoutComposition(
parent,
LayoutElementUtil.getGeneratedId(name, reader.getNextIdNumber()),
trimming);
// Look for required attribute
// Find the template name
for (NameValuePair nvp : nvps) {
if (nvp.getName().equals(templateAttName)) {
compElt.setTemplate((String) nvp.getValue());
} else if (nvp.getName().equals(REQUIRED_ATTRIBUTE)) {
compElt.setRequired(nvp.getValue().toString());
} else {
// We are going to treat extra attributes on compositions to be
// ui:param values
compElt.setParameter(nvp.getName(), nvp.getValue());
}
}
parent.addChildLayoutElement(compElt);