summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs
blob: de5330bd9cdab3e1f30ce3815686b1fa580d0f4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<%
  const properties = locals.properties;
-%>
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
package com.mapbox.mapboxsdk.style.layers;

import android.support.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Paint/Layout properties for Layer
 */
public abstract class Property<T> {

    //VISIBILITY: Whether this layer is displayed.

    /**
     * The layer is shown.
     */
    public static final String VISIBLE = "visible";
    /**
     * The layer is hidden.
     */
    public static final String NONE = "none";

    @StringDef({
            VISIBLE,
            NONE
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface VISIBILITY {}

<% for (const property of properties) { -%>
    //<%- snakeCaseUpper(property.name) %>: <%- property.doc %>

<% for (const value in property.values) { -%>
    /**
     * <%- property.values[value].doc %>
     */
    public static final String <%- snakeCaseUpper(property.name) %>_<%- snakeCaseUpper(value) %> = "<%- value %>";
<% } -%>

    @StringDef({
    <% for (const value of Object.keys(property.values)) { -%>
        <%- snakeCaseUpper(property.name) %>_<%- snakeCaseUpper(value) %>,
    <% } -%>
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface <%- snakeCaseUpper(property.name) %> {}

<% } -%>

    //Class definition
    public final String name;
    public final T value;

    /* package */ Property(String name, T value) {
        this.name = name;
        this.value = value;
    }

}