| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 /** | 5 /** |
| 6 * Code generation for the file "AnalysisServer.java". | 6 * Code generation for the file "AnalysisServer.java". |
| 7 */ | 7 */ |
| 8 library java.generator.server; | 8 library java.generator.server; |
| 9 | 9 |
| 10 import 'package:analyzer/src/codegen/tools.dart'; | 10 import 'package:analyzer/src/codegen/tools.dart'; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 | 112 |
| 113 @override | 113 @override |
| 114 void visitRequest(Request request) { | 114 void visitRequest(Request request) { |
| 115 String methodName = '${request.domainName}_${request.method}'; | 115 String methodName = '${request.domainName}_${request.method}'; |
| 116 publicMethod(methodName, () { | 116 publicMethod(methodName, () { |
| 117 docComment(toHtmlVisitor.collectHtml(() { | 117 docComment(toHtmlVisitor.collectHtml(() { |
| 118 toHtmlVisitor.write('{@code ${request.longMethod }}'); | 118 toHtmlVisitor.write('{@code ${request.longMethod }}'); |
| 119 toHtmlVisitor.translateHtml(request.html); | 119 toHtmlVisitor.translateHtml(request.html); |
| 120 toHtmlVisitor.javadocParams(request.params); | 120 toHtmlVisitor.javadocParams(request.params); |
| 121 if (request.deprecated) { |
| 122 toHtmlVisitor.p(() => toHtmlVisitor.write('@deprecated')); |
| 123 } |
| 121 })); | 124 })); |
| 122 write('public void $methodName('); | 125 write('public void $methodName('); |
| 123 List<String> arguments = []; | 126 List<String> arguments = []; |
| 124 if (request.params != null) { | 127 if (request.params != null) { |
| 125 for (TypeObjectField field in request.params.fields) { | 128 for (TypeObjectField field in request.params.fields) { |
| 126 arguments.add('${javaType(field.type)} ${javaName(field.name)}'); | 129 arguments.add('${javaType(field.type)} ${javaName(field.name)}'); |
| 127 } | 130 } |
| 128 } | 131 } |
| 129 if (request.result != null) { | 132 if (request.result != null) { |
| 130 arguments.add('${consumerName(request)} consumer'); | 133 arguments.add('${consumerName(request)} consumer'); |
| 131 } | 134 } |
| 132 write(arguments.join(', ')); | 135 write(arguments.join(', ')); |
| 133 writeln(');'); | 136 writeln(');'); |
| 134 }); | 137 }); |
| 135 } | 138 } |
| 136 } | 139 } |
| OLD | NEW |