How can I use my interfaces in classes with which I want to use JiBX binding?
Example: I have this very simple model in java:
public interface A {
B getB();
void setB(B b);
}
public interface B {
String getData();
void setData(String data);
}
public class AImpl implements A {
B b;
@Override
public B getB() {
return b;
}
@Override
public void setB(B b) {
this.b = b;
}
}
public class BImpl implements B {
private String data;
@Override
public String getData() {
return data;
}
@Override
public void setData(String data) {
this.data = data;
}
}
And this required document:
<binding>
<mapping name="A"
class="com.test.AImpl">
<structure name="B" usage="optional" get-method="getB" set-method="setB"/>
</mapping>
<mapping name="B"
class="com.test.BImpl">
<value name="data" set-method="setData" get-method="getData" usage="optional"/>
</mapping>
</binding>
When I try to run my code, I get this exception:
java.lang.ClassFormatError: method in class com / test / B has illegal modifiers: 0x1001
I tried using 'abstract = "true"' for both mappings, only to get this exception:
... caused by: org.jibx.runtime.JiBXException: Unable to access required information for class com.test.A Make sure that the binding was compiled ...
, , , AImpl BImpl B BImpl getter return, BImpl. , .
? , ( , JiBX ) - .
? JiBX ( , ?)
, " AbstractB", , .