public TreeEvent peekLast() { return eventQueue.peekLast(); }
private JSONObject getContext() { return contextStack.peekLast(); }
private JSONObject getContext() { return contextStack.peekLast(); }
public SilkContext peekLastContext() { return contextNodeStack.peekLast(); }
public TreeEvent peekLast() { return eventQueue.peekLast(); }
public SilkContext peekLastContext() { return contextNodeStack.peekLast(); }
public void replaceLast(TreeEvent e) { if (e.event != eventQueue.peekLast().event) throw new XerialError(XerialErrorCode.INVALID_STATE, String .format("replace Last must be applied for the same event type: %s, %s", e.event, eventQueue .getLast().event)); eventQueue.removeLast(); eventQueue.addLast(e); }
public void replaceLast(TreeEvent e) { if (e.event != eventQueue.peekLast().event) throw new XerialError(XerialErrorCode.INVALID_STATE, String .format("replace Last must be applied for the same event type: %s, %s", e.event, eventQueue .getLast().event)); eventQueue.removeLast(); eventQueue.addLast(e); }
public void text(String nodeName, String nodeValue, TreeWalker walker) throws XerialException { Object parentBean = getContextBean(currentLevel - 2); if (parentBean != null) { BeanBinderSet bindRuleSet = getBindRuleSet(parentBean.getClass()); BeanUpdator updator = getUpdator(bindRuleSet, nodeName); if (updator != null && updator.getType() == BeanUpdatorType.APPENDER) { // use appender bindValue(parentBean, updator, nodeValue); } else { // use internal string buffer StringBuilder textBuffer = textStack.peekLast(); if (textBuffer == EMPTY_TEXT_BUILDER) { textStack.removeLast(); textBuffer = new StringBuilder(); textStack.addLast(textBuffer); } textBuffer.append(nodeValue); } } }