diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs new file mode 100644 index 0000000000..e734a9ff11 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs @@ -0,0 +1,53 @@ +<% + 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 + public static final String VISIBLE = "visible"; + public static final String NONE = "none"; + + @StringDef({ + VISIBLE, + NONE + }) + @Retention(RetentionPolicy.SOURCE) + public @interface VISIBILITY {} + +<% for (const property of properties) { -%> + //<%- property.name %> +<% for (const value of property.values) { -%> + public static final String <%- snakeCaseUpper(property.name) %>_<%- snakeCaseUpper(value) %> = "<%- value %>"; +<% } -%> + + @StringDef({ + <% for (const value of 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; + } + +} |