Java XMLStreamWriter writeInsertPos(XMLStreamWriter w, boolean isBefore, int[] pos)

Here you can find the source of writeInsertPos(XMLStreamWriter w, boolean isBefore, int[] pos)

Description

write Insert Pos

License

LGPL

Declaration

private static void writeInsertPos(XMLStreamWriter w, boolean isBefore, int[] pos) throws XMLStreamException 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

public class Main {
    private static void writeInsertPos(XMLStreamWriter w, boolean isBefore, int[] pos) throws XMLStreamException {
        if (isBefore)
            w.writeEmptyElement("before");
        else/*from w w w  .  ja v a 2s  . c  om*/
            w.writeEmptyElement("after");
        w.writeAttribute("begin_line", Integer.toString(pos[0]));
        w.writeAttribute("begin_col", Integer.toString(pos[1]));
        w.writeAttribute("end_line", Integer.toString(pos[0]));
        w.writeAttribute("end_col", Integer.toString(pos[1]));
    }
}

Related

  1. writeComment(String comment, XMLStreamWriter xmlsw)
  2. writeEndElement(XMLStreamWriter out, QName name)
  3. writeFloat(String name, float value, XMLStreamWriter writer)
  4. writeFooter(XMLStreamWriter w)
  5. writeIndent(XMLStreamWriter xmlsw, String indent)
  6. writePath(XMLStreamWriter w, Supplier cssClass, Supplier fill, Supplier stroke, Supplier path)
  7. writeSimpleTag(XMLStreamWriter writer, String tag, Object value, boolean asCData)
  8. writeStartElement(XMLStreamWriter writer, QName name)
  9. writeTag(XMLStreamWriter xmlWriter, String tag, Object value)