def _AddPropertiesForNonRepeatedCompositeField(field, cls):
<EOL>proto_field_name = field.name<EOL>property_name = _PropertyName(proto_field_name)<EOL>def getter(self):<EOL><INDENT>field_value = self._fields.get(field)<EOL>if field_value is None:<EOL><INDENT>field_value = field._default_constructor(self)<EOL>field_value = self._fields.setdefault(field, field_value)<EOL><DEDENT>return field_value<EOL><DEDENT>getter.__module__ = None<EOL>getter.__doc__ = '<STR_LIT>' % proto_field_name<EOL>def setter(self, new_value):<EOL><INDENT>raise AttributeError('<STR_LIT>'<EOL>'<STR_LIT>' % proto_field_name)<EOL><DEDENT>doc = '<STR_LIT>' % proto_field_name<EOL>setattr(cls, property_name, property(getter, setter, doc=doc))<EOL>
Adds a public property for a nonrepeated, composite protocol message field.
    A composite field is a "group" or "message" field.

    Clients can use this property to get the value of the field, but cannot
    assign to the property directly.

    Args:
      field: A FieldDescriptor for this field.
      cls: The class we're constructing.