public class ErrorDescriptionFactory extends Object
Modifier and Type | Method and Description |
---|---|
static Fix |
attachSubfixes(Fix to,
Iterable<? extends Fix> subfixes)
Attach given sub-fixes to the given fix.
|
static ErrorDescription |
createErrorDescription(Severity severity,
String description,
Document doc,
int lineNumber)
Create a new
ErrorDescription with the given parameters. |
static ErrorDescription |
createErrorDescription(Severity severity,
String description,
Document doc,
Position start,
Position end)
Acquires read lock on the provided document to assure consistency
|
static ErrorDescription |
createErrorDescription(Severity severity,
String description,
FileObject file,
int start,
int end)
Should be called inside document read lock to assure consistency
|
static ErrorDescription |
createErrorDescription(Severity severity,
String description,
LazyFixList fixes,
Document doc,
int lineNumber)
Create a new
ErrorDescription with the given parameters. |
static ErrorDescription |
createErrorDescription(Severity severity,
String description,
LazyFixList fixes,
Document doc,
Position start,
Position end)
Acquires read lock on the provided document to assure consistency
|
static ErrorDescription |
createErrorDescription(Severity severity,
String description,
LazyFixList fixes,
FileObject file,
int start,
int end)
Should be called inside document read lock to assure consistency
|
static ErrorDescription |
createErrorDescription(Severity severity,
String description,
List<Fix> fixes,
Document doc,
int lineNumber)
Create a new
ErrorDescription with the given parameters. |
static ErrorDescription |
createErrorDescription(Severity severity,
String description,
List<Fix> fixes,
Document doc,
Position start,
Position end)
Acquires read lock on the provided document to assure consistency
|
static ErrorDescription |
createErrorDescription(Severity severity,
String description,
List<Fix> fixes,
FileObject file,
int start,
int end)
Should be called inside document read lock to assure consistency
|
static ErrorDescription |
createErrorDescription(String id,
Severity severity,
String description,
CharSequence details,
LazyFixList fixes,
Document doc,
int lineNumber)
Create a new
ErrorDescription with the given parameters. |
static ErrorDescription |
createErrorDescription(String id,
Severity severity,
String description,
CharSequence details,
LazyFixList fixes,
Document doc,
Position start,
Position end)
Create a new
ErrorDescription with the given parameters. |
static ErrorDescription |
createErrorDescription(String id,
Severity severity,
String description,
CharSequence details,
LazyFixList fixes,
FileObject file,
int start,
int end)
Create a new
ErrorDescription with the given parameters. |
static ErrorDescription |
createErrorDescription(String id,
Severity severity,
String description,
CharSequence details,
LazyFixList fixes,
FileObject file,
PositionBounds errorBounds)
Create a new
ErrorDescription with the given parameters. |
static ErrorDescription |
createErrorDescription(String id,
Severity severity,
String customType,
String description,
CharSequence details,
LazyFixList fixes,
FileObject file,
int[] starts,
int[] ends)
Create a new
ErrorDescription with the given parameters. |
static ErrorDescription |
createErrorDescription(String id,
Severity severity,
String customType,
String description,
CharSequence details,
List<Fix> fixes,
Document doc,
int[] starts,
int[] ends)
Create a new
ErrorDescription with the given parameters. |
static ErrorDescription |
createErrorDescription(String id,
Severity severity,
String customType,
String description,
CharSequence details,
List<Fix> fixes,
Document doc,
Position start,
Position end)
Create a new
ErrorDescription with the given parameters. |
static LazyFixList |
lazyListForDelegates(List<LazyFixList> delegates)
Concatenates several
LazyFixList s into one. |
static LazyFixList |
lazyListForFixes(List<Fix> fixes)
Converts "normal" list of
Fix es into LazyFixList |
@NonNull public static ErrorDescription createErrorDescription(@NonNull Severity severity, @NonNull String description, @NonNull Document doc, int lineNumber)
ErrorDescription
with the given parameters.
Call from inside a document read lock to ensure the meaning of lineNumber
does not change while this method runs.
If the lineNumber is greater than the number of lines in the given document,
the very last line will be used.@NonNull public static ErrorDescription createErrorDescription(@NonNull Severity severity, @NonNull String description, @NonNull List<Fix> fixes, @NonNull Document doc, int lineNumber)
ErrorDescription
with the given parameters.
Call from inside a document read lock to ensure the meaning of lineNumber
does not change while this method runs.
If the lineNumber is greater than the number of lines in the given document,
the very last line will be used.@NonNull public static ErrorDescription createErrorDescription(@NonNull Severity severity, @NonNull String description, @NonNull LazyFixList fixes, @NonNull Document doc, int lineNumber)
ErrorDescription
with the given parameters.
Call from inside a document read lock to ensure the meaning of lineNumber
does not change while this method runs.
If the lineNumber is greater than the number of lines in the given document,
the very last line will be used.@NonNull public static ErrorDescription createErrorDescription(@NullAllowed String id, @NonNull Severity severity, @NonNull String description, @NullAllowed CharSequence details, @NonNull LazyFixList fixes, @NonNull Document doc, int lineNumber)
ErrorDescription
with the given parameters.
Call from inside a document read lock to ensure the meaning of lineNumber
does not change while this method runs.
If the lineNumber is greater than the number of lines in the given document,
the very last line will be used.id
- an optional ID of the ErrorDescription
. Should represent a "type" of an error/warning.
It is recommended that providers prefix the ID with their unique prefix.severity
- the desired Severity
description
- the text of the error/warningdetails
- optional "more details" describing the error/warningfixes
- a collection of Fix
es that should be shown for the error/warningdoc
- document for which the ErrorDescription
should be createdlineNumber
- line on which the error/warning should be shownErrorDescription
based on the given parameters@NonNull public static ErrorDescription createErrorDescription(@NonNull Severity severity, @NonNull String description, @NonNull Document doc, @NonNull Position start, @NonNull Position end)
@NonNull public static ErrorDescription createErrorDescription(@NonNull Severity severity, @NonNull String description, @NonNull List<Fix> fixes, @NonNull Document doc, @NonNull Position start, @NonNull Position end)
@NonNull public static ErrorDescription createErrorDescription(@NonNull Severity severity, @NonNull String description, @NonNull LazyFixList fixes, @NonNull Document doc, @NonNull Position start, @NonNull Position end)
@NonNull public static ErrorDescription createErrorDescription(@NullAllowed String id, @NonNull Severity severity, @NonNull String description, @NullAllowed CharSequence details, @NonNull LazyFixList fixes, @NonNull Document doc, @NonNull Position start, @NonNull Position end)
ErrorDescription
with the given parameters.
Acquires read lock on the provided document to assure consistencyid
- an optional ID of the ErrorDescription
. Should represent a "type" of an error/warning.
It is recommended that providers prefix the ID with their unique prefix.severity
- the desired Severity
description
- the text of the error/warningdetails
- optional "more details" describing the error/warningfixes
- a collection of Fix
es that should be shown for the error/warningdoc
- document for which the ErrorDescription
should be createdstart
- starting offset of the error/warningend
- ending offset of the error/warningErrorDescription
based on the given parameters@NonNull public static ErrorDescription createErrorDescription(@NonNull Severity severity, @NonNull String description, @NonNull FileObject file, int start, int end)
@NonNull public static ErrorDescription createErrorDescription(@NonNull Severity severity, @NonNull String description, @NonNull List<Fix> fixes, @NonNull FileObject file, int start, int end)
@NonNull public static ErrorDescription createErrorDescription(@NonNull Severity severity, @NonNull String description, @NonNull LazyFixList fixes, @NonNull FileObject file, int start, int end)
@NonNull public static ErrorDescription createErrorDescription(@NullAllowed String id, @NonNull Severity severity, @NonNull String description, @NullAllowed CharSequence details, @NonNull LazyFixList fixes, @NonNull FileObject file, int start, int end)
ErrorDescription
with the given parameters.
Should be called inside document read lock to assure consistencyid
- an optional ID of the ErrorDescription
. Should represent a "type" of an error/warning.
It is recommended that providers prefix the ID with their unique prefix.severity
- the desired Severity
description
- the text of the error/warningdetails
- optional "more details" describing the error/warningfixes
- a collection of Fix
es that should be shown for the error/warningfile
- for which the ErrorDescription
should be createdstart
- starting offset of the error/warningend
- ending offset of the error/warningErrorDescription
based on the given parameters@NonNull public static ErrorDescription createErrorDescription(@NullAllowed String id, @NonNull Severity severity, @NullAllowed String customType, @NonNull String description, @NullAllowed CharSequence details, @NonNull LazyFixList fixes, @NonNull FileObject file, int[] starts, int[] ends)
ErrorDescription
with the given parameters.
Should be called inside document read lock to assure consistencyid
- an optional ID of the ErrorDescription
. Should represent a "type" of an error/warning.
It is recommended that providers prefix the ID with their unique prefix.severity
- the desired Severity
customType
- description
- the text of the error/warningdetails
- optional "more details" describing the error/warningfixes
- a collection of Fix
es that should be shown for the error/warningfile
- for which the ErrorDescription
should be createdstarts
- the array of start offsets for error/warningends
- the array of end offsets for error/warningErrorDescription
based on the given parameters@NonNull public static ErrorDescription createErrorDescription(@NullAllowed String id, @NonNull Severity severity, @NonNull String description, @NullAllowed CharSequence details, @NonNull LazyFixList fixes, @NonNull FileObject file, @NonNull PositionBounds errorBounds)
ErrorDescription
with the given parameters.id
- an optional ID of the ErrorDescription
. Should represent a "type" of an error/warning.
It is recommended that providers prefix the ID with their unique prefix.severity
- the desired Severity
description
- the text of the error/warningdetails
- optional "more details" describing the error/warningfixes
- a collection of Fix
es that should be shown for the error/warningfile
- for which the ErrorDescription
should be createderrorBounds
- start and end position of the error/warningErrorDescription
based on the given parameters@NonNull public static ErrorDescription createErrorDescription(@NullAllowed String id, @NonNull Severity severity, @NullAllowed String customType, @NonNull String description, @NullAllowed CharSequence details, @NonNull List<Fix> fixes, @NonNull Document doc, @NonNull Position start, @NonNull Position end)
ErrorDescription
with the given parameters.id
- an optional ID of the ErrorDescription
. Should represent a "type" of an error/warning.
It is recommended that providers prefix the ID with their unique prefix.severity
- the desired Severity
customType
- custom annotation typedescription
- the text of the error/warningdetails
- optional "more details" describing the error/warningfixes
- a collection of Fix
es that should be shown for the error/warningdoc
- for which the ErrorDescription
should be createdstart
- start position of the error/warningend
- end position of the error/warningErrorDescription
based on the given parameters@NonNull public static ErrorDescription createErrorDescription(@NullAllowed String id, @NonNull Severity severity, @NullAllowed String customType, @NonNull String description, @NullAllowed CharSequence details, @NonNull List<Fix> fixes, @NonNull Document doc, int[] starts, int[] ends)
ErrorDescription
with the given parameters.id
- an optional ID of the ErrorDescription
. Should represent a "type" of an error/warning.
It is recommended that providers prefix the ID with their unique prefix.severity
- the desired Severity
customType
- custom annotation typedescription
- the text of the error/warningdetails
- optional "more details" describing the error/warningfixes
- a collection of Fix
es that should be shown for the error/warningdoc
- document for which the ErrorDescription
should be createdstarts
- the array of start offsets for error/warningends
- the array of end offsets for error/warningErrorDescription
based on the given parameters@NonNull public static LazyFixList lazyListForFixes(@NonNull List<Fix> fixes)
Fix
es into LazyFixList
fixes
- @NonNull public static LazyFixList lazyListForDelegates(@NonNull List<LazyFixList> delegates)
LazyFixList
s into one.delegates
- the lists to be delegated to@NonNull public static Fix attachSubfixes(@NonNull Fix to, @NonNull Iterable<? extends Fix> subfixes)
to
- fix to which should be the sub-fixes attachedsubfixes
- the sub-fixes to attach