@Override public boolean read(ReadingContext aContext) { if (mappers == null) { withPCDataMappedTo(tagName); } if (aContext.isStartTagNamed(namespace, tagName)) { maybePushNewContextObject(aContext); try { if (attributes != null) attributes.read(aContext); while (aContext.isNotEndTag(namespace, tagName)) { for (XmlReader _m : mappers) { if (_m.read(aContext)) { break; } } aContext.next(); } return true; } catch (XmlReadingException anExc) { throw anExc; } catch (Exception anExc) { throw new XmlReadingException(anExc); } finally { maybePopContext(aContext); } } else { return false; } }
private void maybePushNewContextObject(ReadingContext aContext) { if (type != null) { Object _ctx = aContext.peek(); T _nestedCtx = newContextObject(); getMutator(_ctx.getClass(), type, tagName).apply(_ctx, _nestedCtx); aContext.push(_nestedCtx); } }
private void maybePopContext(ReadingContext aContext) { if (type != null) { aContext.pop(); } }