Java 类com.google.protobuf.AbstractParser 实例源码

项目:jprotobuf    文件:MapEntry.java   
/**
 * Instantiates a new metadata.
 *
 * @param descriptor the descriptor
 * @param defaultInstance the default instance
 * @param keyType the key type
 * @param valueType the value type
 */
public Metadata(Descriptor descriptor, MapEntry<K, V> defaultInstance, WireFormat.FieldType keyType,
        WireFormat.FieldType valueType) {
    super(keyType, defaultInstance.key, valueType, defaultInstance.value);
    this.descriptor = descriptor;
    this.parser = new AbstractParser<MapEntry<K, V>>() {

        @Override
        public MapEntry<K, V> parsePartialFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
                throws InvalidProtocolBufferException {
            return new MapEntry<K, V>(Metadata.this, input, extensionRegistry);
        }
    };
}