protected JSONTokener createNewJSONTokener(String doc) { return new JSONTokener(doc, depthProps.getInnerElementCountThreshold()); } }
protected JSONTokener createNewJSONTokener(String doc) { return new JSONTokener(doc, depthProps.getInnerElementCountThreshold()); } }
protected JSONTokener createNewJSONTokener(String doc) { return new JSONTokener(doc, depthProps.getInnerElementCountThreshold()); } }
@Override public int next() throws XMLStreamException { int next = super.next(); if (next == START_ELEMENT) { if (props.getInnerElementLevelThreshold() != -1 && getDepth() >= props.getInnerElementLevelThreshold()) { throw new DepthExceededStaxException(); } if (props.getElementCountThreshold() != -1 && ++totalElementCount >= props.getElementCountThreshold()) { throw new DepthExceededStaxException(); } if (props.getInnerElementCountThreshold() != -1) { if (!stack.empty()) { int currentCount = stack.pop(); if (++currentCount >= props.getInnerElementCountThreshold()) { throw new DepthExceededStaxException(); } else { stack.push(currentCount); } } stack.push(0); } } else if (next == END_ELEMENT && props.getInnerElementCountThreshold() != -1) { stack.pop(); } return next; } }
@Override public int next() throws XMLStreamException { int next = super.next(); if (next == START_ELEMENT) { if (props.getInnerElementLevelThreshold() != -1 && getDepth() >= props.getInnerElementLevelThreshold()) { throw new DepthExceededStaxException(); } if (props.getElementCountThreshold() != -1 && ++totalElementCount >= props.getElementCountThreshold()) { throw new DepthExceededStaxException(); } if (props.getInnerElementCountThreshold() != -1) { if (!stack.empty()) { int currentCount = stack.pop(); if (++currentCount >= props.getInnerElementCountThreshold()) { throw new DepthExceededStaxException(); } stack.push(currentCount); } stack.push(0); } } else if (next == END_ELEMENT && props.getInnerElementCountThreshold() != -1) { stack.pop(); } return next; } }
@Override public int next() throws XMLStreamException { int next = super.next(); if (next == START_ELEMENT) { if (props.getInnerElementLevelThreshold() != -1 && getDepth() >= props.getInnerElementLevelThreshold()) { throw new DepthExceededStaxException(); } if (props.getElementCountThreshold() != -1 && ++totalElementCount >= props.getElementCountThreshold()) { throw new DepthExceededStaxException(); } if (props.getInnerElementCountThreshold() != -1) { if (!stack.empty()) { int currentCount = stack.pop(); if (++currentCount >= props.getInnerElementCountThreshold()) { throw new DepthExceededStaxException(); } stack.push(currentCount); } stack.push(0); } } else if (next == END_ELEMENT && props.getInnerElementCountThreshold() != -1) { stack.pop(); } return next; } }
@Override public int next() throws XMLStreamException { int next = super.next(); if (next == START_ELEMENT) { if (props.getInnerElementLevelThreshold() != -1 && getDepth() >= props.getInnerElementLevelThreshold()) { throw new DepthExceededStaxException(); } if (props.getElementCountThreshold() != -1 && ++totalElementCount >= props.getElementCountThreshold()) { throw new DepthExceededStaxException(); } if (props.getInnerElementCountThreshold() != -1) { if (!stack.empty()) { int currentCount = stack.pop(); if (++currentCount >= props.getInnerElementCountThreshold()) { throw new DepthExceededStaxException(); } else { stack.push(currentCount); } } stack.push(0); } } else if (next == END_ELEMENT && props.getInnerElementCountThreshold() != -1) { stack.pop(); } return next; } }
@Override public int next() throws XMLStreamException { int next = super.next(); if (next == START_ELEMENT) { if (props.getInnerElementLevelThreshold() != -1 && getDepth() >= props.getInnerElementLevelThreshold()) { throw new DepthExceededStaxException(); } if (props.getElementCountThreshold() != -1 && ++totalElementCount >= props.getElementCountThreshold()) { throw new DepthExceededStaxException(); } if (props.getInnerElementCountThreshold() != -1) { if (!stack.empty()) { int currentCount = stack.pop(); if (++currentCount >= props.getInnerElementCountThreshold()) { throw new DepthExceededStaxException(); } else { stack.push(currentCount); } } stack.push(0); } } else if (next == END_ELEMENT && props.getInnerElementCountThreshold() != -1) { stack.pop(); } return next; } }