String data = builder.toString();
for (Message message : proto.getMessages())
{
Annotation annotation = message.getAnnotation("Extend");
if (annotation != null)
{
Object byMessageRef = annotation.getValue("by");
if (byMessageRef == null)
throw new IllegalArgumentException("By parameter of attribute @Extend is not specified");
if (!(byMessageRef instanceof Message))
throw new IllegalArgumentException("By parameter have a non Message reference in your @Extend annotation");