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 of
ValidationMessageAcceptor for creating validation diagnostics for Bsl language.
This class has some useful methods for creating validation diagnostics by language model object and its EStructuralFeature-
Field Summary
Fields inherited from interface org.eclipse.xtext.validation.ValidationMessageAcceptor
INSIGNIFICANT_INDEX -
Constructor Summary
ConstructorsConstructorDescriptionCustomValidationMessageAcceptor(org.eclipse.emf.common.util.DiagnosticChain diagnostic, org.eclipse.xtext.validation.CheckType checkType) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptError(String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData) voidacceptError(String message, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData) voidacceptInfo(String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData) voidacceptInfo(String message, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData) voidacceptWarning(String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData) voidacceptWarning(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.DiagnosticcreateDiagnostic(org.eclipse.xtext.diagnostics.Severity severity, String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData) CreatesDiagnosticby model objectprotected org.eclipse.emf.common.util.DiagnosticcreateDiagnostic(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) CreatesDiagnosticby model object and itsEStructuralFeaturevoiderror(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature) Creates error diagnostic withmessagefor value corresponding tofeatureof objectsourcevoiderror(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index) Creates error diagnostic withmessagefor value corresponding tofeatureof objectsourcevoiderror(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData) Creates error diagnostic withmessagefor value corresponding tofeatureof objectsourcevoiderror(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, String code, String... issueData) Creates error diagnostic withmessagefor value corresponding tofeatureof objectsourcevoidinfo(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature) Creates information diagnostic withmessagefor value corresponding tofeatureof objectsourcevoidinfo(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index) Creates information diagnostic withmessagefor value corresponding tofeatureof objectsourcevoidinfo(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData) Creates information diagnostic withmessagefor value corresponding tofeatureof objectsourcestatic inttoDiagnosticSeverity(org.eclipse.xtext.diagnostics.Severity severity) Returns code of validation diagnostic bySeverityvoidwarning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature) Creates warning diagnostic withmessagefor value corresponding tofeatureof objectsourcevoidwarning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index) Creates warning diagnostic withmessagefor value corresponding tofeatureof objectsourcevoidwarning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, int index, String code, String... issueData) Creates warning diagnostic withmessagefor value corresponding tofeatureof objectsourcevoidwarning(String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, String code, String... issueData) Creates warning diagnostic withmessagefor value corresponding tofeatureof objectsource
-
Constructor Details
-
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 benullcheckType- actual validation type, can't benull
-
-
Method Details
-
toDiagnosticSeverity
public static int toDiagnosticSeverity(org.eclipse.xtext.diagnostics.Severity severity) Returns code of validation diagnostic bySeverity- Parameters:
severity- convertingSeverityto code of validation diagnostic, cannot benull- Returns:
- code of validation diagnostic by
Severity. Supports onlyDiagnostic.ERROR,Diagnostic.WARNING,Diagnostic.INFOin other casesIllegalArgumentExceptionwill be thrown
-
acceptError
public void acceptError(String message, org.eclipse.emf.ecore.EObject object, int offset, int length, String code, String... issueData) - Specified by:
acceptErrorin 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:
acceptWarningin 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:
acceptInfoin 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:
acceptErrorin 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:
acceptWarningin 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:
acceptInfoin 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 withmessagefor value corresponding tofeatureof objectsource- Parameters:
message- diagnostic message, can't benullsource- model object each value corresponding tofeaturewill be annotated, can'benullfeature- 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 withmessagefor value corresponding tofeatureof objectsource- Parameters:
message- diagnostic message, can't benullsource- model object each value corresponding tofeaturewill be annotated, can'benullfeature- feature of the objectsource. Value corresponding for it will be annotated, can'benullindex- 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 withmessagefor value corresponding tofeatureof objectsource- Parameters:
message- diagnostic message, can't benullsource- model object each value corresponding tofeaturewill be annotated, can'benullfeature- feature of the objectsource. Value corresponding for it will be annotated, can'benullindex- index of annotating object in collection of values corresponding tofeature. Default value is-1code- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benullissueData- 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 withmessagefor value corresponding tofeatureof objectsource- Parameters:
message- diagnostic message, can't benullsource- model object each value corresponding tofeaturewill be annotated, can'benullfeature- 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 withmessagefor value corresponding tofeatureof objectsource- Parameters:
message- diagnostic message, can't benullsource- model object each value corresponding tofeaturewill be annotated, can'benullfeature- feature of the objectsource. Value corresponding for it will be annotated, can'benullindex- 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 withmessagefor value corresponding tofeatureof objectsource- Parameters:
message- diagnostic message, can't benullsource- model object each value corresponding tofeaturewill be annotated, can'benullfeature- feature of the objectsource. Value corresponding for it will be annotated, can'benullindex- index of annotating object in collection of values corresponding tofeature. Default value is-1code- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benullissueData- 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 withmessagefor value corresponding tofeatureof objectsource- Parameters:
message- diagnostic message, can't benullsource- model object each value corresponding tofeaturewill be annotated, can'benullfeature- feature of the objectsource. Value corresponding for it will be annotated, can'benullcode- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benullissueData- 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 withmessagefor value corresponding tofeatureof objectsource- Parameters:
message- diagnostic message, can't benullsource- model object each value corresponding tofeaturewill be annotated, can'benullfeature- 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 withmessagefor value corresponding tofeatureof objectsource- Parameters:
message- diagnostic message, can't benullsource- model object each value corresponding tofeaturewill be annotated, can'benullfeature- feature of the objectsource. Value corresponding for it will be annotated, can'benullindex- 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 withmessagefor value corresponding tofeatureof objectsource- Parameters:
message- diagnostic message, can't benullsource- model object each value corresponding tofeaturewill be annotated, can'benullfeature- feature of the objectsource. Value corresponding for it will be annotated, can'benullcode- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benullissueData- 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 withmessagefor value corresponding tofeatureof objectsource- Parameters:
message- diagnostic message, can't benullsource- model object each value corresponding tofeaturewill be annotated, can'benullfeature- feature of the objectsource. Value corresponding for it will be annotated, can'benullindex- index of annotating object in collection of values corresponding tofeature. Default value is-1code- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benullissueData- 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) CreatesDiagnosticby model object- Parameters:
severity- type of creating diagnostic, can't benullmessage- message of creating diagnostic, can't benullobject- annotated model object by creating diagnostic, can't benulloffset- 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 benullissueData- 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) CreatesDiagnosticby model object and itsEStructuralFeature- Parameters:
severity- type of creating diagnostic, can't benullmessage- message of creating diagnostic, can't benullobject- annotated model object by creating diagnostic, can't benullfeature- feature of the objectsource. Value corresponding for it will be annotated, can'benullindex- index of annotating object in collection of values corresponding tofeature. Default value is-1code- error code corresponding to creating diagnostic. This code can be used for creating quick fixes, can benullissueData- additional data attaching to diagnostic, can't benull- Returns:
- creating diagnostic, never
null
-