Skip to content

Commit 6218bae

Browse files
committed
add note about difficult-to-convert Java types
Signed-off-by: Sean Corfield <[email protected]>
1 parent 80c55b1 commit 6218bae

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Diff for: README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
# java.data
22

33
Functions for recursively converting Java beans to Clojure and vice
4-
versa. Future home of Java beans and properties support from the old
5-
clojure-contrib
4+
versa.
5+
6+
You can perform shallow conversions and deep conversions, and `java.data`
7+
provides quite a bit of control over the conversion process.
8+
9+
Conversion of Clojure maps etc to specific Java types is generally fairly
10+
straightforward, either via regular construction or via "builder" APIs.
11+
12+
Some Java types, however, are going to be difficult to convert to Clojure,
13+
e.g., Protobuf is particularly problematic because it is all recursive metadata
14+
about types and values: even when you use `:omit` to avoid deep recursion in
15+
an automated conversion, you are not necessarily going to get a useful result.
616

717
## Releases and Dependency Information
818

@@ -59,6 +69,11 @@ org.clojure/java.data {:mvn/version "1.3.113"}
5969
;; represent a javaValue instance in a Clojure data structure:
6070
(j/from-java javaValue)
6171

72+
;; from-java is the legacy, default API and offers no control over the
73+
;; conversion process; from-java-shallow and from-java-deep accept options
74+
;; that provide control over which properties to omit, how to handle property
75+
;; methods that fail, etc, and should be preferred over the default from-java
76+
6277
;; populate javaValue instance from a Clojure property hash map
6378
;; (calls a setter for each key/value pair in the hash map):
6479
(j/set-properties javaValue clojure-property-map)

0 commit comments

Comments
 (0)