org.eclipse.mylyn.wikitext.core.validation
Class ValidationProblem

java.lang.Object
  extended by org.eclipse.mylyn.wikitext.core.validation.ValidationProblem
All Implemented Interfaces:
Comparable<ValidationProblem>

public class ValidationProblem
extends Object
implements Comparable<ValidationProblem>

A validation problem is an indication of an error or warning that occurred while validating a document. A problem has a marker id, severity, message, and optional offset and length. Default comparison semantics order problems by increasing offset.

Since:
1.0
Author:
David Green

Nested Class Summary
static class ValidationProblem.Severity
           
 
Field Summary
static String DEFAULT_MARKER_ID
          The default marker id for a WikiText validation problem.
 
Constructor Summary
ValidationProblem(ValidationProblem.Severity severity, String message, int offset, int length)
          create a validation problem
 
Method Summary
 int compareTo(ValidationProblem o2)
           
 int getLength()
          the length of the problem in characters
 String getMarkerId()
           
 String getMessage()
          the text message as it is displayed to the user
 int getOffset()
          the character offset in the document of the problem
 ValidationProblem.Severity getSeverity()
           
 void setLength(int length)
           
 void setMarkerId(String markerId)
           
 void setMessage(String message)
           
 void setOffset(int offset)
           
 void setSeverity(ValidationProblem.Severity severity)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MARKER_ID

public static final String DEFAULT_MARKER_ID
The default marker id for a WikiText validation problem.

See Also:
Constant Field Values
Constructor Detail

ValidationProblem

public ValidationProblem(ValidationProblem.Severity severity,
                         String message,
                         int offset,
                         int length)
create a validation problem

Parameters:
severity - a severity indicating the severity of the problem
message - the message describing the problem
offset - the offset into the document that the problem starts
length - the length of the problem, which may be 0
Throws:
IllegalArgumentException - if the severity is invalid, the offset is < 0, the length is < 0, or if no message is provided
Method Detail

getMarkerId

public String getMarkerId()

setMarkerId

public void setMarkerId(String markerId)

getSeverity

public ValidationProblem.Severity getSeverity()

setSeverity

public void setSeverity(ValidationProblem.Severity severity)
Parameters:
severity - a severity

getMessage

public String getMessage()
the text message as it is displayed to the user


setMessage

public void setMessage(String message)
Parameters:
message - the text message as it is displayed to the user

getOffset

public int getOffset()
the character offset in the document of the problem


setOffset

public void setOffset(int offset)

getLength

public int getLength()
the length of the problem in characters


setLength

public void setLength(int length)

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(ValidationProblem o2)
Specified by:
compareTo in interface Comparable<ValidationProblem>


Copyright © 2011 FuseSource, Corp.. All Rights Reserved.