With both approaches, a null reference was passed to the respective method,
independent of whether the empty tag <ISBLACK/> was present or not.
The approach "specify set-method" in combination with this custom Unmarshaller worked:
<structure name="black" set-method="setBlackString" usage="optional" unmarshaller="MyUnmarshaller"/>
public class MyUnmarshaller implements IUnmarshaller, IAliasable {
private String m_uri;
private String m_name;
public MyUnmarshaller(String uri, int index, String name) {
m_uri = uri;
m_name = name;
}
public boolean isPresent(IUnmarshallingContext ctx) throws JiBXException {
return ctx.isAt(m_uri, m_name);
}
public Object unmarshal(Object obj, IUnmarshallingContext ictx) throws JiBXException {
UnmarshallingContext ctx = (UnmarshallingContext)ictx;
ctx.parsePastEndTag(m_uri, m_name);
return "";
}
}
Quality/correctness: is this MyUnmarshaller code fine or do I disregard some JiBX best practice?
Mark.
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
