public void extend(Extension extension)
    {
        if (isExtensible() == false)
        {
            throw err("Message " + getFullName()
                    + " does not define extension range", getProto());
        }

        for (Field<?> field : extension.getFields())
        {
            int number = field.getNumber();
            boolean inRange = false;
            for (int[] range : extensionRanges)
            {
                if (number >= range[0] && number <= range[1])
                {
                    inRange = true;
                    break;
                }
            }
            if (inRange == false)
            {
                throw err("Extension '" + field.getName()
                        + "' is outside extension range", getProto());
            }
            if (this.extensions.containsKey(number))
            {
                throw err("Extension already defined for number '" + number
                        + "'", getProto());
            }
            this.extensions.put(number, field);
        }
    }
Represents the message defined in the {@link Proto}.

@author David Yu
@created Dec 19, 2009
protostuff-parser/src/main/java/io/protostuff/parser/Message.java