Liking cljdoc? Tell your friends :D

trptr.java-wrapper.locale

Clojure wrapper for java.util.Locale.

The main fn: locale.

Note: wherever a Java method requires a Locale object, not only such an object, but also a "locale specification" is accepted. In such cases the Java method (called by the Clojure wrapper) will get the Locale object "specified" by the "specification". This means, that (unless we pass a Locale object already to the Clojure wrapper), the needed Locale object is created "on the fly", "behind the scenes", inside the Clojure wrapper.

Below are the possibilities for such "locale specifications" and their interpretations.

  • nil
    In this case the Locale object, "specified" by this "specification" is the one returned by Java's Locale.getDefault().

  • a Java Locale object
    In this case the resulting Locale object is the same as the "specification".

  • a map with keys corresponding to the Locale.Builder class' setXXX instance methods, i.e. :language, :region, :script, :variant, etc.
    The resulting Locale object is the one returned by a corresponding build call. See examples at build.

  • a keyword or string
    In this case the "specification" is splitted at "-" and "_" characters;
    the resulting Locale object is the one returned by make-locale applied on the result of the splitting.

For more info see locale.

Clojure wrapper for java.util.Locale.

The main fn: [[locale]].

Note: wherever a Java method requires a Locale object, not only such an object,
but also a "locale specification" is accepted.
In such cases the Java method (called by the Clojure wrapper) will get
the Locale object "specified" by the "specification". This means, that
(unless we pass a Locale object already to the Clojure wrapper), the needed Locale object
is created "on the fly", "behind the scenes", inside the Clojure wrapper.

Below are the possibilities for such "**locale specifications**" and their interpretations.

* **`nil`**  
In this case the Locale object, "specified" by this "specification"
is the one returned by Java's `Locale.getDefault()`.

* a **Java Locale object**  
In this case the resulting Locale object is the same as the "specification".

* a **map** with keys corresponding to the Locale.Builder class' setXXX instance methods,
i.e. `:language`, `:region`, `:script`, `:variant`, etc.  
The resulting Locale object is the one
returned by a corresponding [[build]] call. See examples at [[build]].

* a **keyword** or **string**  
In this case the "specification" is splitted at "-" and "_" characters;  
the resulting Locale object is the one returned by
[[make-locale]] applied on the result of the splitting.

For more info see [[locale]].
raw docstring

trptr.java-wrapper.util

General utility fns and macros used for creating Clojure wrappers of Java classes.

General utility fns and macros used for creating Clojure wrappers of Java classes.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close