Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl

Issue 398453002: Add dummy BUILDER object to java interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% from "constant_definition.tmpl" import constant_def %} 1 {% from "constant_definition.tmpl" import constant_def %}
2 {% from "enum_definition.tmpl" import enum_def %} 2 {% from "enum_definition.tmpl" import enum_def %}
3 3
4 {%- macro declare_params(parameters) %} 4 {%- macro declare_params(parameters) %}
5 {%- for param in parameters -%} 5 {%- for param in parameters -%}
6 {{param.kind|java_type(False)}} {{param|name}} 6 {{param.kind|java_type(False)}} {{param|name}}
7 {%- if not loop.last %}, {% endif %} 7 {%- if not loop.last %}, {% endif %}
8 {%- endfor %} 8 {%- endfor %}
9 {%- endmacro %} 9 {%- endmacro %}
10 10
(...skipping 17 matching lines...) Expand all
28 {%- macro super_class(client) -%} 28 {%- macro super_class(client) -%}
29 {%- if client -%} 29 {%- if client -%}
30 org.chromium.mojo.bindings.InterfaceWithClient<{{client|java_type}}> 30 org.chromium.mojo.bindings.InterfaceWithClient<{{client|java_type}}>
31 {%- else -%} 31 {%- else -%}
32 org.chromium.mojo.bindings.Interface 32 org.chromium.mojo.bindings.Interface
33 {%- endif -%} 33 {%- endif -%}
34 {%- endmacro -%} 34 {%- endmacro -%}
35 35
36 {% macro interface_def(interface, client) %} 36 {% macro interface_def(interface, client) %}
37 public interface {{interface|name}} extends {{super_class(client)}} { 37 public interface {{interface|name}} extends {{super_class(client)}} {
38
39 public static final Object BUILDER = new Object();
40
38 {% for constant in interface.constants %} 41 {% for constant in interface.constants %}
39 42
40 {{constant_def(constant)|indent(4)}} 43 {{constant_def(constant)|indent(4)}}
41 {% endfor %} 44 {% endfor %}
42 {% for enum in interface.enums %} 45 {% for enum in interface.enums %}
43 46
44 {{enum_def(enum, false)|indent(4)}} 47 {{enum_def(enum, false)|indent(4)}}
45 {% endfor %} 48 {% endfor %}
46 {% for method in interface.methods %} 49 {% for method in interface.methods %}
47 50
48 void {{method|name}}({{declare_request_params(method)}}); 51 void {{method|name}}({{declare_request_params(method)}});
49 {% if method.response_parameters %} 52 {% if method.response_parameters %}
50 {{declare_callback(method)|indent(4)}} 53 {{declare_callback(method)|indent(4)}}
51 {% endif %} 54 {% endif %}
52 {% endfor %} 55 {% endfor %}
53 56
54 } 57 }
55 {% endmacro %} 58 {% endmacro %}
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698