*/
public Object unmarshal(Object o,
IUnmarshallingContext iUnmarshallingContext)
throws JiBXException {
UnmarshallingContext ctx = (UnmarshallingContext) iUnmarshallingContext;
preprocessUnmarshallingContext(ctx);
final String nextElement = ctx.toStart();
IBindingFactory delegateFactory =
BindingDirectory.getFactory("metadata", JIBX_FACTORY_CLASS);
UnmarshallingContext delegateContext =
(UnmarshallingContext) delegateFactory.createUnmarshallingContext();
delegateContext.setFromContext(ctx);
// note that this is not checking that the namespace matches
final int pos = findIndex(
delegateFactory.getElementNames(),
delegateFactory.getElementNamespaces(),
nextElement, ctx.getElementNamespace());
if (pos < 0) {
throw new JiBXException(
EXCEPTION_LOCALIZER.format("unmarshaller-not-found",
"{" + uri + "} " + JIBX_FACTORY_CLASS.getName()));
}
IUnmarshaller unmarshaller = delegateContext.getUnmarshaller(pos);
final Object value = unmarshaller.unmarshal(o, delegateContext);
postprocessUnmarshallingContext(ctx);
return value;
}