Enum Class Setting

java.lang.Object
java.lang.Enum<Setting>
org.klojang.templates.Setting
All Implemented Interfaces:
Serializable, Comparable<Setting>, Constable

public enum Setting extends Enum<Setting>
Specifies all system properties and/or environment variables that will be picked up by Klojang Templates. Environment variables take precedence over system properties.
Author:
Ayco Holleman
  • Enum Constant Details

    • TMPL_CACHE_SIZE

      public static final Setting TMPL_CACHE_SIZE

      System Property: org.klojang.templates.cacheSize
      Environment Variable: KJT_CACHE_SIZE
      Default Value: -1.

      Specifies the maximum size of an internally maintained cache of Template instances - used to reduce the overhead of parsing template files. When the cache reaches the specified size, Template instances are evicted on a least-recently-used basis. A value of -1 means the cache is allowed to grow to any size. A value of 0 disables caching. This is useful during development and/or debugging as the template file will be re-loaded and re-parsed every time you press the refresh button in the browser.

  • Method Details

    • values

      public static Setting[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Setting valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • property

      public String property()
      Returns the name of the system property for this setting.
      Returns:
      the name of the system property for this setting
    • envVar

      public String envVar()
      Returns the name of the environment variable for this setting.
      Returns:
      the name of the environment variable for this setting
    • defaultValue

      public String defaultValue()
      Returns the default value for this setting.
      Returns:
      the default value for this setting
    • get

      public String get()
      Returns the value of this setting or its default value if not specified.
      Returns:
      the value of this setting or its default value if not specified