OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library analyzer.src.task.model; | 5 library analyzer.src.task.model; |
6 | 6 |
7 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; | 7 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; |
8 import 'package:analyzer/src/task/inputs.dart'; | 8 import 'package:analyzer/src/task/inputs.dart'; |
9 import 'package:analyzer/task/model.dart'; | 9 import 'package:analyzer/task/model.dart'; |
10 | 10 |
11 /** | 11 /** |
12 * A concrete implementation of a [ContributionPoint]. | 12 * A concrete implementation of a [ContributionPoint]. |
13 */ | 13 */ |
14 class ContributionPointImpl<V> extends ResultDescriptorImpl<V> implements | 14 class ContributionPointImpl<V> extends ResultDescriptorImpl<V> |
15 ContributionPoint<V> { | 15 implements ContributionPoint<V> { |
16 /** | 16 /** |
17 * The results that contribute to this result. | 17 * The results that contribute to this result. |
18 */ | 18 */ |
19 final List<ResultDescriptor<V>> contributors = <ResultDescriptor<V>>[]; | 19 final List<ResultDescriptor<V>> contributors = <ResultDescriptor<V>>[]; |
20 | 20 |
21 /** | 21 /** |
22 * Initialize a newly created contribution point to have the given [name]. | 22 * Initialize a newly created contribution point to have the given [name]. |
23 */ | 23 */ |
24 ContributionPointImpl(String name) : super(name, null); | 24 ContributionPointImpl(String name) : super(name, null); |
25 | 25 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 */ | 90 */ |
91 @override | 91 @override |
92 final List<ResultDescriptor> results; | 92 final List<ResultDescriptor> results; |
93 | 93 |
94 /** | 94 /** |
95 * Initialize a newly created task descriptor to have the given [name] and to | 95 * Initialize a newly created task descriptor to have the given [name] and to |
96 * describe a task that takes the inputs built using the given [createTaskInpu
ts], | 96 * describe a task that takes the inputs built using the given [createTaskInpu
ts], |
97 * and produces the given [results]. The [buildTask] will be used to create | 97 * and produces the given [results]. The [buildTask] will be used to create |
98 * the instance of [AnalysisTask] thusly described. | 98 * the instance of [AnalysisTask] thusly described. |
99 */ | 99 */ |
100 TaskDescriptorImpl(this.name, this.buildTask, this.createTaskInputs, | 100 TaskDescriptorImpl( |
101 this.results); | 101 this.name, this.buildTask, this.createTaskInputs, this.results); |
102 | 102 |
103 @override | 103 @override |
104 AnalysisTask createTask(AnalysisContext context, AnalysisTarget target, | 104 AnalysisTask createTask(AnalysisContext context, AnalysisTarget target, |
105 Map<String, dynamic> inputs) { | 105 Map<String, dynamic> inputs) { |
106 AnalysisTask task = buildTask(context, target); | 106 AnalysisTask task = buildTask(context, target); |
107 task.inputs = inputs; | 107 task.inputs = inputs; |
108 return task; | 108 return task; |
109 } | 109 } |
110 | 110 |
111 @override | 111 @override |
112 String toString() => name; | 112 String toString() => name; |
113 } | 113 } |
OLD | NEW |