Define methods for a serialised attribute.