

package com.google.gxp.compiler.validate;

import com.google.gxp.compiler.alerts.ErrorAlert;
import com.google.gxp.compiler.alerts.SourcePosition;
import com.google.gxp.compiler.base.Parameter;

/**
 * {@code ErrorAlert} indicating that an interface param required a
 * constructor and the template param didn't provide it.
 */
public class ParamConstructorMismatchError extends ErrorAlert {
  public ParamConstructorMismatchError(SourcePosition pos, String displayName, String paramName) {
    super(pos, displayName + " " + paramName +
          " requires a constructor and none was set in the template.");
  }

  public ParamConstructorMismatchError(Parameter templateParam) {
    this(templateParam.getSourcePosition(), templateParam.getDisplayName(),
         templateParam.getPrimaryName());
  }
}
