11{% - macro to_java_key_type (attribute ) -%}
2- {% - if attribute .type is template_type -%}
3- {{ attribute.type | instantiated_type | map_text("java_template_key_type") }}
4- {% - else -%}
5- {{ attribute.type | instantiated_type | map_text("java_key_type") }}
6- {% - endif %}
2+ {% - if attribute .type is template_type -%}
3+ {{ attribute.type | instantiated_type | map_text("java_template_key_type") }}
4+ {% - else -%}
5+ {{ attribute.type | instantiated_type | map_text("java_key_type") }}
6+ {% - endif %}
77{% - endmacro %}
8+
89{% - macro to_java_key_factory (attribute ) -%}
9- {% - if attribute .type is template_type -%}
10- {{ attribute.type | instantiated_type | map_text("java_template_key_factory") }}
11- {% - else -%}
12- {{ attribute.type | instantiated_type | map_text("java_key_factory") }}
13- {% - endif %}
10+ {% - if attribute .type is template_type -%}
11+ {{ attribute.type | instantiated_type | map_text("java_template_key_factory") }}
12+ {% - else -%}
13+ {{ attribute.type | instantiated_type | map_text("java_key_factory") }}
14+ {% - endif %}
1415{% - endmacro %}
1516{% - set my_class_name = ctx .root_namespace | pascal_case ~ "IncubatingAttributes" -%}
1617{% - set stable_class_name = ctx .root_namespace | pascal_case ~ "Attributes" -%}
@@ -36,33 +37,34 @@ import java.util.List;
3637// DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2
3738@SuppressWarnings("unused")
3839public final class {{ my_class_name }} {
39- {% for attribute in ctx .attributes | rejectattr ("name" , "in" , ctx .excluded_attributes ) | rejectattr ("type" , "eq" , "any" ) %}{% if attribute is experimental %}
40+ {% for attribute in ctx .attributes | rejectattr ("name" , "in" , ctx .excluded_attributes ) | rejectattr ("type" , "eq" , "any" ) %}{% if attribute is experimental %}
4041 {% - if attribute is deprecated %}{% - set deprecated_javadoc = "@deprecated " ~ attribute .deprecated .note -%}
4142 {% - else -%}{% - set deprecated_javadoc = "" -%}
4243 {% - endif -%}
4344 {{ [attribute.brief, concat_if("\n\nNotes:\n\n", attribute.note), deprecated_javadoc] | comment(indent=4) }}
4445 {% if attribute is deprecated %} @Deprecated{% endif %} public static final {{ to_java_key_type(attribute) | trim }} {{ attribute.name | screaming_snake_case }} = {{ to_java_key_factory(attribute) | trim }}("{{ attribute.name }}");
45- {% elif attribute is stable %}
46+ {% elif attribute is stable %}
4647 {% - set stable_class_link = "io.opentelemetry.semconv." ~ stable_class_name ~ "#" ~ (attribute .name | screaming_snake_case ) -%}
4748 {{ [attribute.brief, concat_if("\n\nNotes:\n\n", attribute.note), "@deprecated deprecated in favor of stable {@link " ~ stable_class_link ~ "} attribute."] | comment(indent=4) }}
4849 @Deprecated public static final {{ to_java_key_type(attribute) | trim }} {{ attribute.name | screaming_snake_case }} = {{ to_java_key_factory(attribute) | trim }}("{{ attribute.name }}");
49- {% endif %}
50- {% endfor %}
51- // Enum definitions
52- {% for attribute in ctx .attributes | select ("enum" ) | rejectattr ("name" , "in" , ctx .excluded_attributes ) %}
50+ {% endif %}
51+ {% endfor %}
52+
53+ // Enum definitions
54+ {% for attribute in ctx .attributes | select ("enum" ) | rejectattr ("name" , "in" , ctx .excluded_attributes ) %}
5355 {% set enum_deprecated_in_favor_of_stable = namespace (value =false ) %}
5456 {% if attribute is stable %}
5557 {% - set enum_deprecated_in_favor_of_stable .value = true -%}
5658 {% - endif -%}
5759 {% - for member in attribute .type .members %}
58- {% if member is experimental %}
59- {% if not member is deprecated %}
60- {% - set enum_deprecated_in_favor_of_stable .value = false -%}
61- {% - endif -%}
62- {% - endif -%}
60+ {% if member is experimental %}
61+ {% if not member is deprecated %}
62+ {% - set enum_deprecated_in_favor_of_stable .value = false -%}
63+ {% - endif -%}
64+ {% - endif -%}
6365 {% - endfor %}
6466 {% - if enum_deprecated_in_favor_of_stable .value -%}
65- {% - set stable_class_link = "io.opentelemetry.semconv." ~ stable_class_name ~ "." ~ (attribute .name | pascal_case ) ~ "Values" -%}
67+ {% - set stable_class_link = "io.opentelemetry.semconv." ~ stable_class_name ~ "." ~ (attribute .name | pascal_case ) ~ "Values" -%}
6668 /**
6769 * Values for {@link #{{ attribute.name | screaming_snake_case }}}.
6870 *
@@ -75,18 +77,18 @@ public final class {{ my_class_name }} {
7577 {% - endif -%}
7678 {% if enum_deprecated_in_favor_of_stable .value or attribute is deprecated %} @Deprecated{% endif %}
7779 public static final class {{ attribute.name | pascal_case }}IncubatingValues {
78- {% - for member in attribute .type .members %}
80+ {% - for member in attribute .type .members %}
7981 {% if member is experimental or enum_deprecated_in_favor_of_stable .value %} {{ [member.brief or (member.id ~ '.')] | comment(indent=4) }}
8082 {% if member is deprecated %} @Deprecated{% endif %} public static final {{ attribute.type | instantiated_type | map_text("java_enum_type") }} {{ member.id | screaming_snake_case }} = {{ member.value | print_member_value }};
8183 {% elif member is stable %}
8284 {% - set stable_class_link = "io.opentelemetry.semconv." ~ stable_class_name ~ "." ~ (attribute .name | pascal_case ) ~ "Values#" ~ (member .id | screaming_snake_case ) -%}
8385 {{ [member.brief or (member.id ~ '.'), "@deprecated deprecated in favor of stable {@link " ~ stable_class_link ~ "} value."] | comment(indent=4) }}
8486 @Deprecated public static final {{ attribute.type | instantiated_type | map_text("java_enum_type") }} {{ member.id | screaming_snake_case }} = {{ member.value | print_member_value }};
8587 {% - endif -%}
86- {% - endfor %}
87- private {{ attribute.name | pascal_case }}IncubatingValues() {}
88- }
89- {% endfor %}
88+ {% - endfor %}
89+ private {{ attribute.name | pascal_case }}IncubatingValues() {}
90+ }
91+ {% endfor %}
9092
91- private {{ my_class_name }}() {}
93+ private {{ my_class_name }}() {}
9294}
0 commit comments