OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of protoc; | 5 part of protoc; |
6 | 6 |
7 class ExtensionGenerator implements ProtobufContainer { | 7 class ExtensionGenerator extends ProtobufContainer { |
8 final String fqname; | 8 final String fqname; |
9 final FieldDescriptorProto _descriptor; | 9 final FieldDescriptorProto _descriptor; |
10 final ProtobufContainer _parent; | 10 final ProtobufContainer _parent; |
11 final GenerationContext _context; | 11 final GenerationContext _context; |
12 | 12 |
13 ExtensionGenerator( | 13 ExtensionGenerator( |
14 FieldDescriptorProto descriptor, | 14 FieldDescriptorProto descriptor, |
15 ProtobufContainer parent, | 15 ProtobufContainer parent, |
16 GenerationContext context) | 16 GenerationContext context) |
17 : this._descriptor = descriptor, | 17 : this._descriptor = descriptor, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 out.println('static final Extension $name${SP}=${SP}' | 80 out.println('static final Extension $name${SP}=${SP}' |
81 'new Extension(\'$extendee\',${SP}\'$name\',${SP}' | 81 'new Extension(\'$extendee\',${SP}\'$name\',${SP}' |
82 '${_descriptor.number},${SP}GeneratedMessage.$type' | 82 '${_descriptor.number},${SP}GeneratedMessage.$type' |
83 '${initializer}${builder}${valueOf}' | 83 '${initializer}${builder}${valueOf}' |
84 ');'); | 84 ');'); |
85 } | 85 } |
86 | 86 |
87 String get name => classname; | 87 String get name => classname; |
88 } | 88 } |
OLD | NEW |