Clojure (Clojure API)
Date: 2016-02-23

clojure.java.api

## Class Clojure

- java.lang.Object
- - clojure.java.api.Clojure

-     public class Clojure
      extends java.lang.Object

  The Clojure class provides a minimal interface to bootstrap Clojure access from other JVM languages. It provides:

  1. The ability to use Clojure's namespaces to locate an arbitrary var, returning the var's `IFn` interface.
  2. A convenience method `read` for reading data using Clojure's edn reader

  To lookup and call a Clojure function:

       IFn plus = Clojure.var("clojure.core", "+");
       plus.invoke(1, 2);

  Functions in `clojure.core` are automatically loaded. Other namespaces can be loaded via `require`:

       IFn require = Clojure.var("clojure.core", "require");
       require.invoke(Clojure.read("clojure.set"));

  `IFn`s can be passed to higher order functions, e.g. the example below passes `plus` to `read`:

       IFn map = Clojure.var("clojure.core", "map");
       IFn inc = Clojure.var("clojure.core", "inc");
       map.invoke(inc, Clojure.read("[1 2 3]"));

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.Object` | `read(java.lang.String s)` Read one object from the String s.
    `static IFn` | `var(java.lang.Object qualifiedName)` Returns the var associated with qualifiedName.
    `static IFn` | `var(java.lang.Object ns, java.lang.Object name)` Returns an IFn associated with the namespace and name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### var

          public static IFn var(java.lang.Object qualifiedName)

      Returns the var associated with qualifiedName.
      Parameters:
        `qualifiedName` - a String or clojure.lang.Symbol
      Returns:
        a clojure.lang.IFn

    - #### var

          public static IFn var(java.lang.Object ns,
                java.lang.Object name)

      Returns an IFn associated with the namespace and name.
      Parameters:
        `ns` - a String or clojure.lang.Symbol
        `name` - a String or clojure.lang.Symbol
      Returns:
        a clojure.lang.IFn

    - #### read

          public static java.lang.Object read(java.lang.String s)

      Read one object from the String s. Reads data in the edn format.
      Parameters:
        `s` - a String
      Returns:
        an Object, or nil.