Validates that a given field has a numeric value

@param name The field to check
@param message A custom error message instead of the default one
199476
public void expectNumeric(String name, String message) {
        String value = Optional.ofNullable(get(name)).orElse("");

        if (!StringUtils.isNumeric(value)) {
            addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.NUMERIC_KEY.name(), name)));
        }
    }
156948
public void expectMatch(String name, String message, List<String> values) {
        String value = Optional.ofNullable(get(name)).orElse("");

        if (!(values).contains(value)) {
            addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.MATCH_VALUES_KEY.name(), name)));
        }
    }
1339120
public void expectRange(String name, int minLength, int maxLength) {
        expectRange(name, minLength, maxLength, messages.get(Validation.RANGE_KEY.name(), name, minLength, maxLength));
    }
316484
static void checkDefaultValueIsLegal(Field field,
                                                              List<Message> messages,
                                                              String name) {
        if(field == null) {
            throw new IllegalArgumentException("Field must be non-null. Name=" + name);
        }

        if(field.defaultValue() != null) {
            // Get the type schema. If this is a UNION, the default must be of
            // the leading type
            Schema fieldSchema = field.schema();
            if(fieldSchema.getType() == Schema.Type.UNION) {
                fieldSchema = fieldSchema.getTypes().get(0);
            }

            // Get the default value
            JsonNode defaultJson = field.defaultValue();

            String expectedVal = checkDefaultJson(defaultJson, field.schema());

            if(expectedVal != null) {
                messages.add(new Message(Level.ERROR, "Illegal default value for field " + name
                                                      + ". The default must be of type "
                                                      + expectedVal + "."));
            }
        }
    }
1052133
public void error(String message, Map<String, Object> custom) {
    error(null, custom, message);
  }
351154
protected IStatus validateNameAgainstOtherSREs(String name) {
		IStatus nameStatus = SARLEclipsePlugin.getDefault().createOkStatus();
		if (isDuplicateName(name)) {
			nameStatus = SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR,
					ISREInstall.CODE_NAME,
					Messages.SREInstallWizard_1);
		} else {
			final IStatus status = ResourcesPlugin.getWorkspace().validateName(name, IResource.FILE);
			if (!status.isOK()) {
				nameStatus = SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR,
						ISREInstall.CODE_NAME,
						MessageFormat.format(Messages.SREInstallWizard_2, status.getMessage()));
			}
		}
		return nameStatus;
	}
538939
public final Number evaluateNumeric( Message message ) throws JMSException
    {
        Object value = evaluate(message);
        if (value == null)
            return null;
 
        if (value instanceof Number)
            return ArithmeticUtils.normalize((Number)value);
        
        throw new FFMQException("Expected a numeric but got : "+value.toString(),"INVALID_SELECTOR_EXPRESSION");
    }
305683
protected String handleError(final String message) {
        notifier().error(formatMessage(message));
        return formatMessage(message);
    }
613320
public void setErrorMessage(String message) {

        m_messageText.setInnerHTML(message);
        addStyleName(formCss().hasError());
        m_hasError = true;
    }
10444
private void validateName(String name) throws DDFException {
    Boolean isNameExisted;
    try {
      this.getManager().getDDFByName(name);
      isNameExisted = true;
    } catch (DDFException e) {
      isNameExisted = false;
    }
    if(isNameExisted) {
      throw new DDFException(String.format("DDF with name %s already exists", name));
    }

    Pattern p = Pattern.compile("^[a-zA-Z0-9_-]*$");
    Matcher m = p.matcher(name);
    if(!m.find()) {
      throw new DDFException(String.format("Invalid name %s, only allow alphanumeric (uppercase and lowercase a-z, " +
          "numbers 0-9) and dash (\"-\") and underscore (\"_\")", name));
    }
  }
997762
@Deprecated
    public static void addIntHeader(HttpMessage message, CharSequence name, int value) {
        message.headers().addInt(name, value);
    }
7064
protected void validateInteger(String field, String errorKey, String errorMessage) {
		validateIntegerValue(controller.getPara(field), errorKey, errorMessage);
	}
321067
public void validateTrue(boolean value, String name) {
        validateTrue(value, name, messages.get(Validation.TRUE_KEY.name(), name));
    }
243000
public function notifyError($name, $message, callable $callback = null)
    {
        $report = Report::fromNamedError($this->config, $name, $message);

        $this->notify($report, $callback);
    }
121162
private static boolean isValid(String name) {
    return !name.isEmpty() && name.length() <= MAX_LENGTH && StringUtils.isPrintableString(name);
  }
419402
public void expectEmail(String name, String message) {
        String value = Optional.ofNullable(get(name)).orElse("");

        if (!EmailValidator.getInstance().isValid(value)) {
            addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.EMAIL_KEY.name(), name)));
        }
    }
404686
public void expectIpv6(String name, String message) {
        String value = Optional.ofNullable(get(name)).orElse("");

        if (!InetAddressValidator.getInstance().isValidInet6Address(value)) {
            addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.IPV6_KEY.name(), name)));
        }
    }