}
/**
*/
public XMLElement save() {
final XMLElement element = new XMLElement();
if (isVisible()) {
element.setAttribute("VISIBLE", "true");
}
if (isManual()) {
element.setAttribute("MANUAL", "true");
}
if (isRestricted()) {
element.setAttribute("RESTRICTED", "true");
}
if (isManual() || isRestricted()) {
for (int i = 0; i < values.getSize(); i++) {
final XMLElement xmlValue = new XMLElement();
xmlValue.setName(AttributeBuilder.XML_NODE_REGISTERED_ATTRIBUTE_VALUE);
final Object value = values.getElementAt(i);
final String string = value.toString();
xmlValue.setAttribute("VALUE", string);
if(! (value instanceof String)){
final String spec = TypeReference.toSpec(value);
xmlValue.setAttribute("OBJECT", spec);
}
element.addChild(xmlValue);
}
}
element.setName(AttributeBuilder.XML_NODE_REGISTERED_ATTRIBUTE_NAME);