Package com._1c.g5.v8.dt.bsl.validation
Class CustomValidationMessageAcceptor
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.validation.CustomValidationMessageAcceptor
-
- All Implemented Interfaces:
org.eclipse.xtext.validation.ValidationMessageAcceptor
public class CustomValidationMessageAcceptor extends Object implements org.eclipse.xtext.validation.ValidationMessageAcceptor
Implementation ofValidationMessageAcceptor
for creating validation diagnostics for Bsl language. This class has some useful methods for creating validation diagnostics by language model object and itsEStructuralFeature
-
-
Constructor Summary
Constructors Constructor Description CustomValidationMessageAcceptor(org.eclipse.emf.common.util.DiagnosticChain diagnostic, org.eclipse.xtext.validation.CheckType checkType)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptError(String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData)
void
acceptError(String message, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
void
acceptInfo(String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData)
void
acceptInfo(String message, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
void
acceptWarning(String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData)
void
acceptWarning(String message, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
protected org.eclipse.emf.common.util.Diagnostic
createDiagnostic(org.eclipse.xtext.diagnostics.Severity severity, String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData)
CreatesDiagnostic
by model objectprotected org.eclipse.emf.common.util.Diagnostic
createDiagnostic(org.eclipse.xtext.diagnostics.Severity severity, String message, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
CreatesDiagnostic
by model object and itsEStructuralFeature
void
error(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature)
Creates error diagnostic withmessage
for value corresponding tofeature
of objectsource
void
error(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index)
Creates error diagnostic withmessage
for value corresponding tofeature
of objectsource
void
error(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
Creates error diagnostic withmessage
for value corresponding tofeature
of objectsource
void
error(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, String code, String... issueData)
Creates error diagnostic withmessage
for value corresponding tofeature
of objectsource
void
info(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature)
Creates information diagnostic withmessage
for value corresponding tofeature
of objectsource
void
info(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index)
Creates information diagnostic withmessage
for value corresponding tofeature
of objectsource
void
info(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
Creates information diagnostic withmessage
for value corresponding tofeature
of objectsource
static int
toDiagnosticSeverity(org.eclipse.xtext.diagnostics.Severity severity)
Returns code of validation diagnostic bySeverity
void
warning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature)
Creates warning diagnostic withmessage
for value corresponding tofeature
of objectsource
void
warning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index)
Creates warning diagnostic withmessage
for value corresponding tofeature
of objectsource
void
warning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
Creates warning diagnostic withmessage
for value corresponding tofeature
of objectsource
void
warning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, String code, String... issueData)
Creates warning diagnostic withmessage
for value corresponding tofeature
of objectsource
-
-
-
Constructor Detail
-
CustomValidationMessageAcceptor
public CustomValidationMessageAcceptor(org.eclipse.emf.common.util.DiagnosticChain diagnostic, org.eclipse.xtext.validation.CheckType checkType)
Constructor- Parameters:
diagnostic
- accumulator of validation diagnostics. All of creating diagnostic will be added to it. Can't benull
checkType
- actual validation type, can't benull
-
-
Method Detail
-
toDiagnosticSeverity
public static int toDiagnosticSeverity(org.eclipse.xtext.diagnostics.Severity severity)
Returns code of validation diagnostic bySeverity
- Parameters:
severity
- convertingSeverity
to code of validation diagnostic, cannot benull
- Returns:
- code of validation diagnostic by
Severity
. Supports onlyDiagnostic.ERROR
,Diagnostic.WARNING
,Diagnostic.INFO
in other casesIllegalArgumentException
will be thrown
-
acceptError
public void acceptError(String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData)
- Specified by:
acceptError
in interfaceorg.eclipse.xtext.validation.ValidationMessageAcceptor
-
acceptWarning
public void acceptWarning(String message, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
- Specified by:
acceptWarning
in interfaceorg.eclipse.xtext.validation.ValidationMessageAcceptor
-
acceptInfo
public void acceptInfo(String message, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
- Specified by:
acceptInfo
in interfaceorg.eclipse.xtext.validation.ValidationMessageAcceptor
-
acceptError
public void acceptError(String message, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
- Specified by:
acceptError
in interfaceorg.eclipse.xtext.validation.ValidationMessageAcceptor
-
acceptWarning
public void acceptWarning(String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData)
- Specified by:
acceptWarning
in interfaceorg.eclipse.xtext.validation.ValidationMessageAcceptor
-
acceptInfo
public void acceptInfo(String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData)
- Specified by:
acceptInfo
in interfaceorg.eclipse.xtext.validation.ValidationMessageAcceptor
-
info
public void info(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature)
Creates information diagnostic withmessage
for value corresponding tofeature
of objectsource
- Parameters:
message
- diagnostic message, can't benull
source
- model object each value corresponding tofeature
will be annotated, can'benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
-
info
public void info(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index)
Creates information diagnostic withmessage
for value corresponding tofeature
of objectsource
- Parameters:
message
- diagnostic message, can't benull
source
- model object each value corresponding tofeature
will be annotated, can'benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
index
- index of annotating object in collection of values corresponding tofeature
. Default value is-1
-
info
public void info(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
Creates information diagnostic withmessage
for value corresponding tofeature
of objectsource
- Parameters:
message
- diagnostic message, can't benull
source
- model object each value corresponding tofeature
will be annotated, can'benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
index
- index of annotating object in collection of values corresponding tofeature
. Default value is-1
code
- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benull
issueData
- additional data attaching to diagnostic, can't benull
-
warning
public void warning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature)
Creates warning diagnostic withmessage
for value corresponding tofeature
of objectsource
- Parameters:
message
- diagnostic message, can't benull
source
- model object each value corresponding tofeature
will be annotated, can'benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
-
warning
public void warning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index)
Creates warning diagnostic withmessage
for value corresponding tofeature
of objectsource
- Parameters:
message
- diagnostic message, can't benull
source
- model object each value corresponding tofeature
will be annotated, can'benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
index
- index of annotating object in collection of values corresponding tofeature
. Default value is-1
-
warning
public void warning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
Creates warning diagnostic withmessage
for value corresponding tofeature
of objectsource
- Parameters:
message
- diagnostic message, can't benull
source
- model object each value corresponding tofeature
will be annotated, can'benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
index
- index of annotating object in collection of values corresponding tofeature
. Default value is-1
code
- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benull
issueData
- additional data attaching to diagnostic, can't benull
-
warning
public void warning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, String code, String... issueData)
Creates warning diagnostic withmessage
for value corresponding tofeature
of objectsource
- Parameters:
message
- diagnostic message, can't benull
source
- model object each value corresponding tofeature
will be annotated, can'benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
code
- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benull
issueData
- additional data attaching to diagnostic, can't benull
-
error
public void error(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature)
Creates error diagnostic withmessage
for value corresponding tofeature
of objectsource
- Parameters:
message
- diagnostic message, can't benull
source
- model object each value corresponding tofeature
will be annotated, can'benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
-
error
public void error(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index)
Creates error diagnostic withmessage
for value corresponding tofeature
of objectsource
- Parameters:
message
- diagnostic message, can't benull
source
- model object each value corresponding tofeature
will be annotated, can'benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
index
- index of annotating object in collection of values corresponding tofeature
. Default value is-1
-
error
public void error(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, String code, String... issueData)
Creates error diagnostic withmessage
for value corresponding tofeature
of objectsource
- Parameters:
message
- diagnostic message, can't benull
source
- model object each value corresponding tofeature
will be annotated, can'benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
code
- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benull
issueData
- additional data attaching to diagnostic, can't benull
-
error
public void error(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
Creates error diagnostic withmessage
for value corresponding tofeature
of objectsource
- Parameters:
message
- diagnostic message, can't benull
source
- model object each value corresponding tofeature
will be annotated, can'benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
index
- index of annotating object in collection of values corresponding tofeature
. Default value is-1
code
- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benull
issueData
- additional data attaching to diagnostic, can't benull
-
createDiagnostic
protected org.eclipse.emf.common.util.Diagnostic createDiagnostic(org.eclipse.xtext.diagnostics.Severity severity, String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData)
CreatesDiagnostic
by model object- Parameters:
severity
- type of creating diagnostic, can't benull
message
- message of creating diagnostic, can't benull
object
- annotated model object by creating diagnostic, can't benull
offset
- the starting offset of creating diagnostic in annotating resourcelength
- the length of creating diagnostic in annotating resourcecode
- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benull
issueData
- additional data attaching to diagnostic, can't benull
- Returns:
- creating diagnostic, never
null
-
createDiagnostic
protected org.eclipse.emf.common.util.Diagnostic createDiagnostic(org.eclipse.xtext.diagnostics.Severity severity, String message, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData)
CreatesDiagnostic
by model object and itsEStructuralFeature
- Parameters:
severity
- type of creating diagnostic, can't benull
message
- message of creating diagnostic, can't benull
object
- annotated model object by creating diagnostic, can't benull
feature
- feature of the objectsource
. Value corresponding for it will be annotated, can'benull
index
- index of annotating object in collection of values corresponding tofeature
. Default value is-1
code
- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benull
issueData
- additional data attaching to diagnostic, can't benull
- Returns:
- creating diagnostic, never
null
-
-