public void writeEndDocument() throws XMLStreamException { if (!stack.isEmpty()) throw new XMLStreamException("Missing some closing tags."); // We know the root is a JSONPropertyObject so this cast is safe writeJSONObject((JSONObject)current.getValue()); try { writer.flush(); } catch (IOException e) { throw new XMLStreamException(e); } }
Object value = property.getValue(); boolean emptyString = value instanceof String && ((String)value).isEmpty(); if (value instanceof String && !emptyString) {
public JSONPropertyObject withProperty(JSONProperty property, boolean add) { Object value = property.getValue(); if(value instanceof String && !((String)value).isEmpty()) { value = convention.convertToJSONPrimitive((String)value);