Add setAttributes method for AttributedObject.