[JAVA-172] Support alternate naming for boolean getters in ReflectionDBObject Created: 05/Oct/10 Updated: 12/Jul/13 Resolved: 12/Jul/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Codecs |
| Affects Version/s: | 2.1 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Ilya Brodotsky | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
java version "1.6.0_21" |
||
| Description |
|
"is"-style getter is ignored by ReflectionObject. Domain class: package test; import com.mongodb.ReflectionDBObject; public class Something extends ReflectionDBObject { public Something(String kk, boolean bb) { this.kk = kk; this.bb = bb; }public String getKk() { return kk; }public void setKk(String kk) { this.kk = kk; }public boolean isBb() { return bb; }public void setBb(boolean bb) { this.bb = bb; }} Application class: package test; import com.mongodb.*; import java.net.UnknownHostException; public class BooleanGetterApp { catch (UnknownHostException e) { e.printStackTrace(); } } Application output: { "_id" : { "$oid" : "4cab3c5417066088cabbebf3"}, "Kk" : "kk"} – boolean value was ignored. |
| Comments |
| Comment by Jeffrey Yemin [ 12/Jul/13 ] |
|
In 3.0 we're going to have much better support for encoding and decoding, but not through ReflectionDBObject. So we're going to just leave this alone. |
| Comment by Jeffrey Yemin [ 28/Apr/12 ] |
|
We should probably use java.beans.Introspector#getBeanInfo instead of rolling our own introspector in com.mongodb.ReflectionDBObject.JavaWrapper |