* and change it back because an & would create a parse exception.
*/
value = "<attribute xmlns='" + ATTRIBUTE_NAMESPACE + "'>" + value.replaceAll("&(?!amp;)", "&") + "</attribute>";
Reader reader = new StringReader(value);
try {
AttributeType attribute = AttributesXmlUtil.loadAttribute(reader);
attribute.setName(name);
String editorClass = propertyEditors.get(name);
if (null != editorClass) {
attribute.setPropertyEditor(editorClass);
}
gbean.getAttributeOrReference().add(attribute);
} catch (Exception e) {
log.error("Could not serialize attribute " + name + " in gbean " + gbeanName + ", value: " + value, e);
}
}
}
// cleared attributes
for (String name : clearAttributes) {
AttributeType attribute = new AttributeType();
attribute.setName(name);
gbean.getAttributeOrReference().add(attribute);
}
// Null attributes
for (String name : nullAttributes) {
AttributeType attribute = new AttributeType();
attribute.setName(name);
attribute.setNull(true);
gbean.getAttributeOrReference().add(attribute);
}
// references
for (Map.Entry<String, ReferencePatterns> entry : references.entrySet()) {