@Override protected void _verifyValueWrite(String typeMsg) throws IOException { // first, check that name/value cadence works if (!_jpropContext.writeValue()) { _reportError("Can not "+typeMsg+", expecting field name"); } // and if so, update path if we are in array if (_jpropContext.inArray()) { // remove possible path remnants from an earlier sibling _jpropContext.truncatePath(_basePath); int ix = _jpropContext.getCurrentIndex() + _schema.firstArrayOffset(); if (_schema.writeIndexUsingMarkers()) { Markers m = _schema.indexMarker(); // no leading path separator, if using enclosed indexes _basePath.append(m.getStart()); _basePath.append(ix); _basePath.append(m.getEnd()); } else { // leading path separator, if using "simple" index markers if (_basePath.length() > 0) { String sep = _schema.pathSeparator(); if (!sep.isEmpty()) { _basePath.append(sep); } } _basePath.append(ix); } } }
@Override protected void _verifyValueWrite(String typeMsg) throws IOException { // first, check that name/value cadence works if (!_jpropContext.writeValue()) { _reportError("Can not "+typeMsg+", expecting field name"); } // and if so, update path if we are in array if (_jpropContext.inArray()) { // remove possible path remnants from an earlier sibling _jpropContext.truncatePath(_basePath); int ix = _jpropContext.getCurrentIndex() + _schema.firstArrayOffset(); if (_schema.writeIndexUsingMarkers()) { Markers m = _schema.indexMarker(); // no leading path separator, if using enclosed indexes _basePath.append(m.getStart()); _basePath.append(ix); _basePath.append(m.getEnd()); } else { // leading path separator, if using "simple" index markers if (_basePath.length() > 0) { String sep = _schema.pathSeparator(); if (!sep.isEmpty()) { _basePath.append(sep); } } _basePath.append(ix); } } }