## org.eclipse.ocl.lpg
Class StringProblemHandler

    java.lang.Object
      org.eclipse.ocl.lpg.AbstractProblemHandler
          org.eclipse.ocl.lpg.StringProblemHandler

All Implemented Interfaces:
  lpg.lpgjavaruntime.ParseErrorCodes, ProblemHandler

    public class StringProblemHandler

extends AbstractProblemHandler

A `StringProblemHandler` counts and accumulates all problem reports, so that all problems may be processed on completion of semantic/syntactic/lexical analysis.

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
`StringProblemHandler(AbstractParser parser)`

Method Summary
`protected void` `addProblem(String problemMessage)` Accumulate the problemMessage followed by new-line.
`int` `getProblemCount()` Return the number of reported problems.
`String` `getProblemString()` Return the accumulated problem report, corresponding the concatenation of each `addProblem` invocation argument with a new-line following each.

Methods inherited from class org.eclipse.ocl.lpg.AbstractProblemHandler
`analyzerProblem, beginParse, beginValidation, endParse, endValidation, flush, getErrorReportLineOffset, getParser, handleProblem, lexerProblem, parserProblem, setErrorReportLineOffset, setParser, utilityProblem, validatorProblem`

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

Constructor Detail

### StringProblemHandler

    public StringProblemHandler(AbstractParser parser)

Method Detail

### addProblem

    protected void addProblem(String problemMessage)

  Accumulate the problemMessage followed by new-line.

  Overrides:
    `addProblem` in class `AbstractProblemHandler`
  Parameters:
    `problemMessage` - the problem description

### getProblemCount

    public int getProblemCount()

  Return the number of reported problems.

  Returns:
    number of problems

### getProblemString

    public String getProblemString()

  Return the accumulated problem report, corresponding the concatenation of each `addProblem` invocation argument with a new-line following each.

  Returns:
    the accumulated problem report

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