[ http://jira.codehaus.org/browse/JIBX-95?page=all ]
Dennis Sosnoski resolved JIBX-95:
---------------------------------
Resolution: Cannot Reproduce
> Binding compiler should check for class assignability instead of exact type.
> ----------------------------------------------------------------------------
>
> Key: JIBX-95
> URL: http://jira.codehaus.org/browse/JIBX-95
> Project: JiBX
> Type: Bug
> Components: core
> Versions: 1.0-RC2
> Environment: jdk 1.5
> Reporter: Maros Ivanco
> Assignee: Dennis Sosnoski
>
>
> Binding compiler should check for class assignability instead of exact type
> name matching between structure type and mapping class. In the mapping:
> <structure field="..." type="ParentType"/>
> <mapping name="child1" type="Child1" ...>...</mapping>
> <mapping name="child2" type="Child2" ...>...</mapping>
> .
> .
> .
> the compiler generates error. I workaround this by using custom un/marshaller
> for structure:
> public class ConfigHandler implements IMarshaller, IUnmarshaller{
> protected String uri="http://www.datalan.sk/search/robot-config/1.1";
> public boolean isExtension(int index) {
> return false;
> }
> public void marshal(Object obj, IMarshallingContext ictx) throws
> JiBXException {
> if(!(ictx instanceof MarshallingContext)) throw new
> JiBXException("Invalid object type for marshaller");
> ((IMarshallable)obj).marshal(ictx);
> }
> public boolean isPresent(IUnmarshallingContext ctx) throws
> JiBXException {
> return ctx.isAt(uri, "processing-option")||ctx.isAt(uri,
> "processing-chain")||ctx.isAt(uri, "processor");
> }
> public Object unmarshal(Object obj, IUnmarshallingContext ctx) throws
> JiBXException {
> return ctx.unmarshalElement();
> }
> } // end of type
> Even though the un/marshaller is that trivial, (or perhaps because of it) the
> behaviour should be implemented directly by JiBX.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs