@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; } }
@Override public final boolean read(ReadingContext aContext) { if (aContext.isTextNode()) { read(aContext, aContext.getParser().getText()); return true; } 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); } }
public void read(ReadingContext aContext, String aText) { T _currentContext = aContext.peek(); try { ValueSetter _vs = getSetter(aContext, _currentContext.getClass(), fieldName); _vs.invoke(fieldName, _currentContext, aText); } catch (ParsingException anExc) { throw anExc; } catch (Exception anExc) { throw new ParsingException(anExc); } }
private void maybePopContext(ReadingContext aContext) { if (type != null) { aContext.pop(); } }