## org.eclipse.ocl.parser
Class OCLProblemHandler

    java.lang.Object
      org.eclipse.ocl.lpg.AbstractProblemHandler
          org.eclipse.ocl.parser.OCLProblemHandler

All Implemented Interfaces:
  lpg.lpgjavaruntime.ParseErrorCodes, ProblemHandler

    public class OCLProblemHandler

extends AbstractProblemHandler

The `OCLProblemHandler` accumulates a `DiagnosticChain` of problems.

Nested Class Summary

Nested classes/interfaces inherited from interface org.eclipse.ocl.lpg.ProblemHandler
`ProblemHandler.Phase, ProblemHandler.Severity`

Field Summary

Fields inherited from interface org.eclipse.ocl.lpg.ProblemHandler
`ERROR_MESSAGES`

Fields inherited from interface lpg.lpgjavaruntime.ParseErrorCodes
`BEFORE_CODE, DELETION_CODE, EOF_CODE, ERROR_CODE, errorMsgText, INSERTION_CODE, INVALID_CODE, INVALID_TOKEN_CODE, LEX_ERROR_CODE, MERGE_CODE, MISPLACED_CODE, SCOPE_CODE, SECONDARY_CODE, SUBSTITUTION_CODE`

Constructor Summary
`OCLProblemHandler(AbstractParser parser)`

Method Summary
`void` `beginParse()` This default implementation does nothing.
`void` `beginValidation()` This default implementation does nothing.
`void` `clearDiagnostic()`
`Diagnostic` `getDiagnostic()`
`void` `handleProblem(ProblemHandler.Severity problemSeverity, ProblemHandler.Phase processingPhase, String problemMessage, String processingContext, int startOffset, int endOffset)` Implements the interface, invoking `addProblem` with a line comprising `processingPhase-problemSeverity in processingContext; lineNumber : problemMessage`.
`void` `lexerProblem(ProblemHandler.Severity problemSeverity, String problemMessage, String processingContext, int startOffset, int endOffset)` Dumps the error code and token info.
`void` `parserProblem(ProblemHandler.Severity problemSeverity, String problemMessage, String processingContext, int startOffset, int endOffset)` Convenience method typically invoking `handleProblem` with a `parserProblem` processing phase.

Methods inherited from class org.eclipse.ocl.lpg.AbstractProblemHandler
`addProblem, analyzerProblem, endParse, endValidation, flush, getErrorReportLineOffset, getParser, setErrorReportLineOffset, setParser, utilityProblem, validatorProblem`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OCLProblemHandler

    public OCLProblemHandler(AbstractParser parser)

Method Detail

### handleProblem

    public void handleProblem(ProblemHandler.Severity problemSeverity,
                              ProblemHandler.Phase processingPhase,
                              String problemMessage,
                              String processingContext,
                              int startOffset,
                              int endOffset)

  Description copied from class: `AbstractProblemHandler`
  Implements the interface, invoking `addProblem` with a line comprising `processingPhase-problemSeverity in processingContext; lineNumber : problemMessage`.

  Specified by:
    `handleProblem` in interface `ProblemHandler`
  Overrides:
    `handleProblem` in class `AbstractProblemHandler`
  Parameters:
    `problemSeverity` - text describing the problem severity (e.g. `errorSeverity`)
    `processingPhase` - optional text describing the processing phase (e.g. `analyzerProblem`)
    `problemMessage` - message describing the problem
    `processingContext` - optional message describing the reporting context (e.g. `"PathNameCS"`)
    `startOffset` - (inclusive) index of first source character influencing the problem, -ve if unknown
    `endOffset` - (exclusive) index of last source character influencing the problem, -ve if unknown

### getDiagnostic

    public Diagnostic getDiagnostic()

### beginParse

    public void beginParse()

  Description copied from class: `AbstractProblemHandler`
  This default implementation does nothing.

  Specified by:
    `beginParse` in interface `ProblemHandler`
  Overrides:
    `beginParse` in class `AbstractProblemHandler`

### beginValidation

    public void beginValidation()

  Description copied from class: `AbstractProblemHandler`
  This default implementation does nothing.

  Specified by:
    `beginValidation` in interface `ProblemHandler`
  Overrides:
    `beginValidation` in class `AbstractProblemHandler`

### clearDiagnostic

    public void clearDiagnostic()

### lexerProblem

    public void lexerProblem(ProblemHandler.Severity problemSeverity,
                             String problemMessage,
                             String processingContext,
                             int startOffset,
                             int endOffset)

  Dumps the error code and token info.

  Specified by:
    `lexerProblem` in interface `ProblemHandler`
  Overrides:
    `lexerProblem` in class `AbstractProblemHandler`
  Parameters:
    `leftToken` - token index
    `rightToken` - token index

### parserProblem

    public void parserProblem(ProblemHandler.Severity problemSeverity,
                              String problemMessage,
                              String processingContext,
                              int startOffset,
                              int endOffset)

  Description copied from interface: `ProblemHandler`
  Convenience method typically invoking `handleProblem` with a `parserProblem` processing phase.

  Specified by:
    `parserProblem` in interface `ProblemHandler`
  Overrides:
    `parserProblem` in class `AbstractProblemHandler`
  Parameters:
    `problemSeverity` - text describing the problem severity
    `problemMessage` - message describing the problem
    `processingContext` - optional message describing the reporting context (e.g. `"PathNameCS"`)
    `startOffset` - (inclusive) index of first source character influencing the problem, -ve if unknown
    `endOffset` - (exclusive) index of last source character influencing the problem, -ve if unknown

Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved.