for (Iterator iterator = gbean.getAttributes().entrySet().iterator(); iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
String attributeName = (String) entry.getKey();
GAttributeInfo attributeInfo = gbeanInfo.getAttribute(attributeName);
if (attributeInfo == null) {
throw new InvalidConfigException("No attribute: " + attributeName + " for gbean: " + data.getAbstractName());
}
String valueString = (String) entry.getValue();
Object value = getValue(attributeInfo, valueString, configName, gbeanName, classLoader);
data.setAttribute(attributeName, value);
}
//Clear attributes
for (Iterator iterator = gbean.getClearAttributes().iterator(); iterator.hasNext();){
String attribute = (String) iterator.next();
if (gbean.getClearAttribute(attribute)){
data.clearAttribute(attribute);
}
}
//Null attributes
for (Iterator iterator = gbean.getNullAttributes().iterator(); iterator.hasNext();){
String attribute = (String) iterator.next();
if (gbean.getNullAttribute(attribute)){
data.setAttribute(attribute, null);
}
}
// set references
for (Iterator iterator = gbean.getReferences().entrySet().iterator(); iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
String referenceName = (String) entry.getKey();
GReferenceInfo referenceInfo = gbeanInfo.getReference(referenceName);
if (referenceInfo == null) {
throw new InvalidConfigException("No reference: " + referenceName + " for gbean: " + data.getAbstractName());
}
ReferencePatterns referencePatterns = (ReferencePatterns) entry.getValue();
data.setReferencePatterns(referenceName, referencePatterns);