package jetbrains.mps.baseLanguage.lightweightdsl.typesystem;
/*Generated by MPS */
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.baseLanguage.closures.runtime._FunctionTypes;
public class ClassLikeMethodErrorNotifier implements ClassLikeMethodProblemVisitor {
private ClassLikeMethodChecker.ErrorState myState = ClassLikeMethodChecker.ErrorState.OK;
private String myMessage = "";
public void visitName(SNode method, String corrected) throws ClassLikeMethodChecker.StopMethodCheckerException {
myState = ClassLikeMethodChecker.ErrorState.REPAIRABLE;
throw new ClassLikeMethodChecker.StopMethodCheckerException();
}
public void visitReturnType(SNode method, _FunctionTypes._return_P0_E0<? extends SNode> getCorrected) throws ClassLikeMethodChecker.StopMethodCheckerException {
myState = ClassLikeMethodChecker.ErrorState.REPAIRABLE;
throw new ClassLikeMethodChecker.StopMethodCheckerException();
}
public void visitMissingParam(SNode method, int index, _FunctionTypes._return_P0_E0<? extends SNode> getCorrected) throws ClassLikeMethodChecker.StopMethodCheckerException {
myState = ClassLikeMethodChecker.ErrorState.REPAIRABLE;
throw new ClassLikeMethodChecker.StopMethodCheckerException();
}
public void visitOddParam(SNode param) throws ClassLikeMethodChecker.StopMethodCheckerException {
myState = ClassLikeMethodChecker.ErrorState.REPAIRABLE;
throw new ClassLikeMethodChecker.StopMethodCheckerException();
}
public void visitUnknownParam(SNode method, int index) throws ClassLikeMethodChecker.StopMethodCheckerException {
myMessage = "Wrong method signature. Can't repair automatically. Error in parameter with index " + index;
myState = ClassLikeMethodChecker.ErrorState.NON_REPAIRABLE;
throw new ClassLikeMethodChecker.StopMethodCheckerException();
}
public void visitParamName(SNode param, String corrected) throws ClassLikeMethodChecker.StopMethodCheckerException {
myState = ClassLikeMethodChecker.ErrorState.REPAIRABLE;
throw new ClassLikeMethodChecker.StopMethodCheckerException();
}
public void visitParamType(SNode param, _FunctionTypes._return_P0_E0<? extends SNode> getCorrected) throws ClassLikeMethodChecker.StopMethodCheckerException {
myState = ClassLikeMethodChecker.ErrorState.REPAIRABLE;
throw new ClassLikeMethodChecker.StopMethodCheckerException();
}
public ClassLikeMethodChecker.ErrorState getErrorState() {
return myState;
}
public String getErrorMessage() {
return myMessage;
}
}