@Override public final void writeEndObject() throws IOException { if (!_outputContext.inObject()) { _reportError("Current context not Object but "+_outputContext.typeDesc()); } _outputContext = _outputContext.getParent(); if (_xmlPrettyPrinter != null) { // as per [Issue#45], need to suppress indentation if only attributes written: int count = _nextIsAttribute ? 0 : _outputContext.getEntryCount(); _xmlPrettyPrinter.writeEndObject(this, count); } else { _handleEndObject(); } }