All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.java.com.ctc.wstx.evt.WComment Maven / Gradle / Ivy

There is a newer version: 4.0.6
Show newest version
package com.ctc.wstx.evt;

import java.io.IOException;
import java.io.Writer;

import javax.xml.stream.Location;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.stream.events.Comment;

public class WComment
    extends WEvent
    implements Comment
{
    final String mContent;

    public WComment(Location loc, String content)
    {
        super(loc);
        mContent = content;
    }

    public String getText() {
        return mContent;
    }

    /*
    ///////////////////////////////////////////
    // Implementation of abstract base methods
    ///////////////////////////////////////////
     */

    public int getEventType() {
        return COMMENT;
    }

    public void writeAsEncodedUnicode(Writer w)
        throws XMLStreamException
    {
        try {
            w.write("");
        } catch (IOException ie) {
            throwFromIOE(ie);
        }
    }

    public void writeUsing(XMLStreamWriter w) throws XMLStreamException
    {
        w.writeComment(mContent);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy