org.eclipse.incquery.patternlanguage.validation

## Class PatternLanguageJavaValidator

- java.lang.Object
- - org.eclipse.xtext.validation.AbstractInjectableValidator
  - - org.eclipse.xtext.validation.AbstractDeclarativeValidator
    - - org.eclipse.xtext.xbase.validation.AbstractXbaseValidator
      - - org.eclipse.xtext.xbase.validation.XbaseValidator
        - - org.eclipse.xtext.xbase.validation.XbaseJavaValidator
          - - org.eclipse.incquery.patternlanguage.validation.AbstractPatternLanguageJavaValidator
            - - org.eclipse.incquery.patternlanguage.validation.PatternLanguageJavaValidator

- All Implemented Interfaces:
    org.eclipse.emf.ecore.EValidator, IIssueCallback, org.eclipse.xtext.validation.ValidationMessageAcceptor
  Direct Known Subclasses:
    AbstractEMFPatternLanguageJavaValidator

      public class PatternLanguageJavaValidator
      extends AbstractPatternLanguageJavaValidator
      implements IIssueCallback

  Validators for Core Pattern Language.

  Validators implemented:

  - Duplicate parameter in pattern declaration
  - Duplicate pattern definition (name duplication only, better calculation is needed)
  - Pattern call parameter checking (only the number of the parameters, types not supported yet)
  - Empty PatternBody check
  - Check for recursive pattern calls
  Author:
    Mark Czotter, Tamas Szabo (itemis AG)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.xtext.validation.AbstractDeclarativeValidator

      `org.eclipse.xtext.validation.AbstractDeclarativeValidator.State, org.eclipse.xtext.validation.AbstractDeclarativeValidator.StateAccess`

    - ### Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.EValidator

      `org.eclipse.emf.ecore.EValidator.Descriptor, org.eclipse.emf.ecore.EValidator.PatternMatcher, org.eclipse.emf.ecore.EValidator.Registry, org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider, org.eclipse.emf.ecore.EValidator.ValidationDelegate`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ANNOTATION_PARAMETER_TYPE_ERROR`
    `static java.lang.String` | `DUPLICATE_PATTERN_DEFINITION_MESSAGE`
    `static java.lang.String` | `DUPLICATE_VARIABLE_MESSAGE`
    `static java.lang.String` | `MISSING_ANNOTATION_ATTRIBUTE`
    `static java.lang.String` | `RECURSIVE_PATTERN_CALL`
    `static java.lang.String` | `TRANSITIVE_CLOSURE_ARITY_IN_PATTERNCALL`
    `static java.lang.String` | `TRANSITIVE_CLOSURE_ONLY_IN_POSITIVE_COMPOSITION`
    `static java.lang.String` | `UNKNOWN_ANNOTATION_ATTRIBUTE`
    `static java.lang.String` | `UNUSED_PRIVATE_PATTERN_MESSAGE`

    - ### Fields inherited from class org.eclipse.xtext.validation.AbstractInjectableValidator

      `CURRENT_LANGUAGE_NAME, ISSUE_SEVERITIES`

    - ### Fields inherited from interface org.eclipse.xtext.validation.ValidationMessageAcceptor

      `INSIGNIFICANT_INDEX`

    - ### Fields inherited from interface org.eclipse.emf.ecore.EValidator

      `MARKER, RELATED_URIS_ATTRIBUTE, URI_ATTRIBUTE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PatternLanguageJavaValidator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkAnnotation(Annotation annotation)`
    `void` | `checkApplicabilityOfTransitiveClosureInPatternCall(PatternCall call)`
    `void` | `checkCompareConstraints(CompareConstraint constraint)`
    `void` | `checkForImpureJavaCallsInCheckConstraints(CheckConstraint checkConstraint)`
    `void` | `checkForImpureJavaCallsInEvalExpressions(FunctionEvaluationValue eval)`
    `void` | `checkPackageDeclaration(PatternModel model)`
    `void` | `checkPatternBody(PatternBody body)`
    `void` | `checkPatternCallParameters(PatternCall call)`
    `void` | `checkPatternParameters(Pattern pattern)`
    `void` | `checkPatterns(PatternModel model)`
    `void` | `checkPrivatePatternCall(PatternCall call)`
    `void` | `checkPrivatePatternUsage(Pattern pattern)`
    `void` | `checkRecursivePatternCall(PatternCall call)`
    `void` | `checkReturnTypeOfCheckConstraints(CheckConstraint checkConstraint)`
    `void` | `checkVariableNames(PatternBody body)`
    `void` | `checkVariableUsageCounters(PatternBody body)`
    `void` | `error(java.lang.String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.String code, java.lang.String... issueData)`
    `boolean` | `isNamedSingleUse(Variable variable)`
    `boolean` | `isUnnamedSingleUseVariable(Variable variable)`
    `void` | `warning(java.lang.String message, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.String code, java.lang.String... issueData)`

    - ### Methods inherited from class org.eclipse.xtext.xbase.validation.XbaseValidator

      `checkAssignment, checkAssignment, checkAssignment, checkCasts, checkCatchClausesOrder, checkClosureParameterTypes, checkClosureParams, checkConstructorArgumentsAreValid, checkDelegateConstructorIsFirst, checkDeprecated, checkDeprecated, checkDeprecated, checkDeprecated, checkDeprecated, checkDuplicatedCases, checkExplicitOperationCall, checkExplicitOperationCall, checkExplicitOperationCall, checkImports, checkIncompleteCasesOnEnum, checkInnerExpressions, checkInstanceOf, checkInstanceOfOrder, checkLocalUsageOfDeclared, checkLocalUsageOfSwitchParameter, checkNoCircularConstructorCall, checkNoForwardReferences, checkNoJavaStyleTypeCasting, checkOperandTypesForTripleEquals, checkPrimitiveComparedToNull, checkRedundantCase, checkReturn, checkTypeArguments, checkTypeArguments, checkTypeGuards, checkTypeGuardsOrder, checkTypeLiteral, checkTypeParameterConstraintIsValid, checkTypeParameterNotUsedInStaticContext, checkTypeReferenceIsNotVoid, checkTypeReferenceIsNotVoid, checkTypes, checkVariableDeclaration, checkVariableIsNotInferredAsVoid, doCheckTypeParameterForwardReference`

    - ### Methods inherited from class org.eclipse.xtext.validation.AbstractDeclarativeValidator

      `acceptError, acceptError, acceptInfo, acceptInfo, acceptWarning, acceptWarning, getMessageAcceptor, setInjector, setMessageAcceptor`

    - ### Methods inherited from class org.eclipse.xtext.validation.AbstractInjectableValidator

      `isLanguageSpecific, register, validate, validate, validate`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DUPLICATE_VARIABLE_MESSAGE

          public static final java.lang.String DUPLICATE_VARIABLE_MESSAGE

      See Also:
        Constant Field Values

    - #### DUPLICATE_PATTERN_DEFINITION_MESSAGE

          public static final java.lang.String DUPLICATE_PATTERN_DEFINITION_MESSAGE

      See Also:
        Constant Field Values

    - #### UNKNOWN_ANNOTATION_ATTRIBUTE

          public static final java.lang.String UNKNOWN_ANNOTATION_ATTRIBUTE

      See Also:
        Constant Field Values

    - #### MISSING_ANNOTATION_ATTRIBUTE

          public static final java.lang.String MISSING_ANNOTATION_ATTRIBUTE

      See Also:
        Constant Field Values

    - #### ANNOTATION_PARAMETER_TYPE_ERROR

          public static final java.lang.String ANNOTATION_PARAMETER_TYPE_ERROR

      See Also:
        Constant Field Values

    - #### TRANSITIVE_CLOSURE_ARITY_IN_PATTERNCALL

          public static final java.lang.String TRANSITIVE_CLOSURE_ARITY_IN_PATTERNCALL

      See Also:
        Constant Field Values

    - #### TRANSITIVE_CLOSURE_ONLY_IN_POSITIVE_COMPOSITION

          public static final java.lang.String TRANSITIVE_CLOSURE_ONLY_IN_POSITIVE_COMPOSITION

      See Also:
        Constant Field Values

    - #### UNUSED_PRIVATE_PATTERN_MESSAGE

          public static final java.lang.String UNUSED_PRIVATE_PATTERN_MESSAGE

      See Also:
        Constant Field Values

    - #### RECURSIVE_PATTERN_CALL

          public static final java.lang.String RECURSIVE_PATTERN_CALL

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### PatternLanguageJavaValidator

          public PatternLanguageJavaValidator()

  - ### Method Detail

    - #### checkPatternParameters

          public void checkPatternParameters(Pattern pattern)

    - #### checkPrivatePatternUsage

          public void checkPrivatePatternUsage(Pattern pattern)

    - #### checkPrivatePatternCall

          public void checkPrivatePatternCall(PatternCall call)

    - #### checkPatternCallParameters

          public void checkPatternCallParameters(PatternCall call)

    - #### checkApplicabilityOfTransitiveClosureInPatternCall

          public void checkApplicabilityOfTransitiveClosureInPatternCall(PatternCall call)

    - #### checkPatterns

          public void checkPatterns(PatternModel model)

    - #### checkPatternBody

          public void checkPatternBody(PatternBody body)

    - #### checkAnnotation

          public void checkAnnotation(Annotation annotation)

    - #### checkCompareConstraints

          public void checkCompareConstraints(CompareConstraint constraint)

    - #### checkRecursivePatternCall

          public void checkRecursivePatternCall(PatternCall call)

    - #### checkPackageDeclaration

          public void checkPackageDeclaration(PatternModel model)

    - #### checkReturnTypeOfCheckConstraints

          public void checkReturnTypeOfCheckConstraints(CheckConstraint checkConstraint)

    - #### checkVariableNames

          public void checkVariableNames(PatternBody body)

    - #### checkVariableUsageCounters

          public void checkVariableUsageCounters(PatternBody body)

    - #### isNamedSingleUse

          public boolean isNamedSingleUse(Variable variable)

      Returns:
        true if the variable is single-use a named variable

    - #### isUnnamedSingleUseVariable

          public boolean isUnnamedSingleUseVariable(Variable variable)

      Returns:
        true if the variable is an unnamed single-use variable

    - #### checkForImpureJavaCallsInCheckConstraints

          public void checkForImpureJavaCallsInCheckConstraints(CheckConstraint checkConstraint)

    - #### checkForImpureJavaCallsInEvalExpressions

          public void checkForImpureJavaCallsInEvalExpressions(FunctionEvaluationValue eval)

    - #### warning

          public void warning(java.lang.String message,
                              org.eclipse.emf.ecore.EObject source,
                              org.eclipse.emf.ecore.EStructuralFeature feature,
                              java.lang.String code,
                              java.lang.String... issueData)

      Specified by:
        `warning` in interface `IIssueCallback`
      Overrides:
        `warning` in class `org.eclipse.xtext.validation.AbstractDeclarativeValidator`

    - #### error

          public void error(java.lang.String message,
                            org.eclipse.emf.ecore.EObject source,
                            org.eclipse.emf.ecore.EStructuralFeature feature,
                            java.lang.String code,
                            java.lang.String... issueData)

      Specified by:
        `error` in interface `IIssueCallback`
      Overrides:
        `error` in class `org.eclipse.xtext.validation.AbstractDeclarativeValidator`