acc.set(bean,t);
}
public void parse(final BeanT bean, CharSequence lexical) throws AccessorException, SAXException {
final String idref = WhiteSpaceProcessor.trim(lexical).toString();
final UnmarshallingContext context = UnmarshallingContext.getInstance();
final Callable callable = context.getObjectFromId(idref,acc.valueType);
if(callable==null) {
// the IDResolver decided to abort it now
context.errorUnresolvedIDREF(bean,idref,context.getLocator());
return;
}
TargetT t;
try {
t = (TargetT)callable.call();
} catch (SAXException e) {// from callable.call
throw e;
} catch (RuntimeException e) {// from callable.call
throw e;
} catch (Exception e) {// from callable.call
throw new SAXException2(e);
}
if(t!=null) {
assign(bean,t,context);
} else {
// try again later
final LocatorEx loc = new LocatorEx.Snapshot(context.getLocator());
context.addPatcher(new Patcher() {
public void run() throws SAXException {
try {
TargetT t = (TargetT)callable.call();
if(t==null) {
context.errorUnresolvedIDREF(bean,idref,loc);
} else {
assign(bean,t,context);
}
} catch (AccessorException e) {
context.handleError(e);
} catch (SAXException e) {// from callable.call
throw e;
} catch (RuntimeException e) {// from callable.call
throw e;
} catch (Exception e) {// from callable.call