Collections are giving me a bit of a fit and I'm looking for some help!
I have a bit of problem with some pre-defined Java classes (I don't
control the source code) and JibX collections.
I'm trying to get a mapping to work against the structure of these Java
classes (i.e. let's assume I can't change the Java source code).
private class ClaimSearchReply {
private Claim _Claims;
private class Claims {
private ArrayList _ClaimSummary;
private class ClaimSummary {
private String _InternalControlNumber;
}
}
<binding>
<mapping name="ClaimSearchReply"
class="com.bcbsma.seebeyond.chs008reply.elements.ClaimSearchReply">
<structure name="Claims" field="_Claims">
<collection field="_ClaimSummary" >
<structure name="ClaimSummary"
type="com.bcbsma.seebeyond.chs008reply.elements.ClaimSearchReply$Claims$
ClaimSummary">
<value name="InternalControlNumber"
field="_InternalControlNumber"/>
</structure>
</collection>
</structure>
</mapping>
</binding>
<ClaimSearchReply>
<Claims>
<ClaimSummary order="1">
<InternalControlNumber>01070403120000</InternalControlNumber>
</ClaimSummary>
<ClaimSummary order="2">
<InternalControlNumber>01070168000100</InternalControlNumber>
</ClaimSummary>
<ClaimSummary order="3">
<InternalControlNumber>01070168000000</InternalControlNumber>
</ClaimSummary>
</Claims>
</ClaimSearchReply>
This setup yields me the following error during runtime:
*** Error during code generation for file 'testBinding2.xml' - please
enter a bu
g report for this error in Jira if the problem is not listed as fixed on
the onl
ine status page ***
org.jibx.runtime.JiBXException: One or more <mapping> elements for
modifiable cl
asses must be defined in <binding>
at org.jibx.binding.Utility.loadBinding(Utility.java:317)
at org.jibx.binding.Utility.loadFileBinding(Utility.java:408)
at org.jibx.binding.Loader.loadFileBinding(Loader.java:201)
at org.jibx.binding.Run.main(Run.java:163)
I also tried:
<binding>
<mapping name="ClaimSearchReply"
class="com.bcbsma.seebeyond.chs008reply.elements.ClaimSearchReply">
<structure name="Claims" field="_Claims">
<collection field="_ClaimSummary"
type="com.bcbsma.seebeyond.chs008reply.elements.ClaimSearchReply$Claims$
ClaimSummary">
<structure name="ClaimSummary">
<value
name="InternalControlNumber" field="_InternalControlNumber"/>
</structure>
</collection>
</structure>
</mapping>
</binding>
which gives me this validation error:
Error: Incompatible types used in property definition; on collection
element at (line 5, col 125, in testBinding2.xml)
Error: Need store-method or add-method for input binding; on collection
element at (line 5, col 125, in testBinding2.xml)
Error: Need load-method and size-method, or iter-method, for output
binding; on collection element at (line 5, col 125, in testBinding2.xml)
Error: Nonstatic field _InternalControlNumber not found in class
java.lang.Object; on value element at (line 7, col 74, in
testBinding2.xml)
Any thoughts? I realize the class structure is hoping. I'm hoping JibX's
extreme flexibility in mappings will allow me to overcome. :)
Any help is appreciated.
Dan
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users