ikitommi / java-jdk

JDK 1.8 Bindings for Clojure.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JDK 1.8 Bindings for Clojure.

These bindings are created to simplify interaction with java classes from clojure. For each java class was created a separate namespace. Each method/field has its own function/field binding. Their names are changed for a more native look in the clojure code. Each function has docstring - information about the parameters, return value and possible exceptions.

Note

All namespaces starting with java. are renamed to jdk. (java compiler limitation).

java.io.File renamed to jdk.io.File for example.

Clojars

You can find clojars in README of packages.

Usage

(require '[jdk.io.File :as f])

(-> "./resource/MyFile.txt"
  f/->file
  f/exists?)

(-> "./resource/MyAnotherFile.txt"
  f/->file
  f/mkdirs)

Class Members Naming Conventions

Class Member Java Clojure
constructor new File() (->file)
instance method getAnyValue() (get-any-value)
instance field instanceField (-instance-field)
static method staticMethod() (*static-method)
static field ANY_STATIC_FIELD (*-any-static-field)
boolean field/method isExists(), canUse() (exists?), (can-use?)

Contributors

Eugene Potapenko

License

Distributed under the Eclipse Public License, the same as Clojure.

About

JDK 1.8 Bindings for Clojure.


Languages

Language:Clojure 100.0%Language:Shell 0.0%