adds a handler for class attributes