Ejemplo n.º 1
0
 @Override
 public void writeStartDocument(String encoding, String version) throws XMLStreamException {
   super.writeStartDocument(encoding, version);
   try {
     target.startObject();
   } catch (IOException e) {
     throw new XMLStreamException("Cannot start document", e);
   }
   getScope().getInfo().startObjectWritten = true;
 }
Ejemplo n.º 2
0
 @Override
 public void close() throws XMLStreamException {
   super.close();
   try {
     if (documentArray) {
       target.endArray();
     }
     target.close();
   } catch (IOException e) {
     throw new XMLStreamException("Close failed", e);
   }
 }
Ejemplo n.º 3
0
 @Override
 public void writeEndDocument() throws XMLStreamException {
   super.writeEndDocument();
   try {
     if (getScope().getInfo().isArray()) {
       target.endArray();
     }
     target.endObject();
   } catch (IOException e) {
     throw new XMLStreamException("Cannot end document", e);
   }
   getScope().getInfo().startObjectWritten = false;
 }
Ejemplo n.º 4
0
 /**
  * Write boolean value.
  *
  * @param value
  * @throws XMLStreamException
  */
 public void writeBoolean(Boolean value) throws XMLStreamException {
   if (getScope().getInfo().hasData()) {
     throw new XMLStreamException("Cannot write boolean value");
   }
   super.writeCharacters(value, XMLStreamConstants.CHARACTERS);
 }