String friendlyName, String name, String nameFormat, List<?> values
) {
if (stringBuilder == null) {
stringBuilder = (XSStringBuilder)builderFactory.getBuilder(XSString.TYPE_NAME);
}
Attribute attribute = createAttribute(friendlyName, name, nameFormat);
for (Object value : values) {
if (value instanceof String) {
XSString attributeValue =
stringBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME);
attributeValue.setValue((String)value);
attribute.getAttributeValues().add(attributeValue);
} else if (value instanceof XMLObject) {
attribute.getAttributeValues().add((XMLObject)value);
}
}
return attribute;
}