JiBX bind value with getter only -
I have a complex method that gives boolean (no property field or setter for this area). I need to force this class with GBBX, the result of this method can be for XML element / attribute and when left without any effect. So I have to do something like this:
& lt; Mapping name = "bizarre" class = "com.test.Freak" & gt; & Lt; Namesphere Yuri = "http://www.test.com/schemas/test" default = "Element" /> & Lt; Value name = "id" field = "id" style = "attribute" /> & Lt; Value name = "real-bizarre" get-method = "isRealFreak" style = "attribute" use = "optional" /> & Lt; / Mapping & gt;
PS I can not fix this square to add a stub setter, it has to use it.
Because boolean (a primitive) will always be a value, this will not be possible unless you have a boolean (Which allows a null) switch over.
The output can be only binding in your sole solution:
Will ensure that binding is a method, which is guessing that you are okay because you do not have any mechanism to set that value anyway. If you need both directions and you can not modify your class, you will have to increase your class and use boolean and use a different input only binding.
Comments
Post a Comment