public class JSONBySentenceFormatter extends JSONFormatter
Modifier and Type | Field and Description |
---|---|
static Comparator<ValidationError> |
BY_SENTENCE_COMPARATOR
Reusable comparator to compare errors by their position in the document, starting with the line number, followed by the offset within the line, and finally the sentence content
|
Constructor and Description |
---|
JSONBySentenceFormatter() |
Modifier and Type | Method and Description |
---|---|
protected org.json.JSONObject |
asJSON(Document document,
List<ValidationError> errors)
Render as a JSON object a list of errors for a given document
|
protected org.json.JSONObject |
asJSON(ValidationError error)
Render a single redpen error as JSON
|
asJSON, asJSON, asJSON, asJSON, format, format, formatError
public static final Comparator<ValidationError> BY_SENTENCE_COMPARATOR
protected org.json.JSONObject asJSON(ValidationError error) throws org.json.JSONException
asJSON
in class JSONFormatter
error
- the redpen errororg.json.JSONException
protected org.json.JSONObject asJSON(Document document, List<ValidationError> errors)
asJSON
in class JSONFormatter
document
- the document that has the errorserrors
- a list of errorsCopyright © 2015. All rights reserved.