Example usage for org.eclipse.jdt.core IJavaModelMarker FLAGS

List of usage examples for org.eclipse.jdt.core IJavaModelMarker FLAGS

Introduction

In this page you can find the example usage for org.eclipse.jdt.core IJavaModelMarker FLAGS.

Prototype

String FLAGS

To view the source code for org.eclipse.jdt.core IJavaModelMarker FLAGS.

Click Source Link

Document

Flags marker attribute (value "flags").

Usage

From source file:edu.brown.cs.bubbles.bedrock.BedrockUtil.java

License:Open Source License

static void outputMarker(IMarker xmk, File fil, IvyXmlWriter xw) {
    if (xmk instanceof IProblem) {
        BedrockUtil.outputProblem(null, (IProblem) xmk, xw);
    } else {/*  w  ww.  jav a2  s .com*/
        String mtyp = null;
        try {
            mtyp = xmk.getType();
        } catch (CoreException e) {
            return;
        }
        if (mtyp.contains("Breakpoint"))
            return;

        xw.begin("PROBLEM");
        xw.field("TYPE", mtyp);
        xw.field("ID", xmk.getId());
        int sev = xmk.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);
        if (sev == IMarker.SEVERITY_ERROR)
            xw.field("ERROR", true);
        else if (sev == IMarker.SEVERITY_WARNING)
            xw.field("WARNING", true);
        int lno = xmk.getAttribute(IMarker.LINE_NUMBER, -1);
        if (lno >= 0) {
            xw.field("LINE", lno);
            xw.field("START", xmk.getAttribute(IMarker.CHAR_START, 0));
            xw.field("END", xmk.getAttribute(IMarker.CHAR_END, 0));
        }
        xw.field("MSGID", xmk.getAttribute(IJavaModelMarker.ID, 0));
        xw.field("FLAGS", xmk.getAttribute(IJavaModelMarker.FLAGS, 0));
        xw.textElement("FILE", fil.getPath());
        String msg = xmk.getAttribute(IMarker.MESSAGE, "");
        msg = IvyXml.xmlSanitize(msg, false);
        xw.textElement("MESSAGE", msg);
        String args = xmk.getAttribute(IJavaModelMarker.ARGUMENTS, null);
        if (args != null) {
            StringTokenizer tok = new StringTokenizer(args, ":#");
            if (tok.hasMoreTokens())
                tok.nextToken(); // skip count
            while (tok.hasMoreTokens()) {
                xw.cdataElement("ARG", tok.nextToken());
            }
        }
        BedrockPlugin.getPlugin().addFixes(xmk, xw);
        xw.end("PROBLEM");
    }
}