org.apache.commons.validator.Var.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.apache.commons.validator.Var.<init>()方法的一些代码示例,展示了Var.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Var.<init>()方法的具体详情如下:
包路径:org.apache.commons.validator.Var
类名称:Var
方法名:<init>

Var.<init>介绍

[英]Default Constructor.
[中]默认构造函数。

代码示例

代码示例来源:origin: commons-validator/commons-validator

/**
 * Add a <code>Var</code>, based on the values passed in, to the
 * <code>Field</code>.
 * @param name Name of the validation.
 * @param value The Argument's value.
 * @param jsType The Javascript type.
 */
public void addVar(String name, String value, String jsType) {
  this.addVar(new Var(name, value, jsType));
}

代码示例来源:origin: de.knightsoft-net/gwt-commons-validator

/**
 * Add a <code>Var</code>, based on the values passed in, to the
 * <code>Field</code>.
 * @param name Name of the validation.
 * @param value The Argument's value.
 * @param jsType The Javascript type.
 */
public void addVar(String name, String value, String jsType) {
  this.addVar(new Var(name, value, jsType));
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.validator

/**
 * Add a <code>Var</code>, based on the values passed in, to the
 * <code>Field</code>.
 * @param name Name of the validation.
 * @param value The Argument's value.
 * @param jsType The Javascript type.
 */
public void addVar(String name, String value, String jsType) {
  this.addVar(new Var(name, value, jsType));
}

代码示例来源:origin: org.seasar.struts/s2-struts

public void register(Field field, Map parameter) {
  String pattern = (String) parameter.get("value");
  Var var = new Var();
  var.setName("datePattern");
  var.setValue(pattern);
  field.addVar(var);
}

代码示例来源:origin: org.seasar.struts/s2-struts

private void addVariable(Field field, Map var) {
  String name = (String) var.get("name");
  String value = (String) var.get("value");
  if (StringUtil.isEmpty(value)) {
    return;
  }
  Var v = new Var();
  v.setName(name);
  v.setValue(value);
  field.addVar(v);
}

代码示例来源:origin: org.seasar.struts/s2-struts

public void register(Field field, Map parameter) {
  String pattern = (String) parameter.get("pattern");
  if (StringUtil.isEmpty(pattern)) {
    pattern = this.defaultPattern;
  }
  String strictStr = (String) parameter.get("strict");
  boolean strict = this.defaultStrict;
  if (!StringUtil.isEmpty(strictStr)) {
    strict = BooleanConversionUtil.toPrimitiveBoolean(strictStr);
  }
  Var var = new Var();
  if (strict) {
    var.setName("datePatternStrict");
  } else {
    var.setName("datePattern");
  }
  var.setValue(pattern);
  field.addVar(var);
}

代码示例来源:origin: org.seasar.struts/s2-struts

public void register(Field field, Map parameter) {
  Object value = parameter.get("value");
  String type = getType();
  Arg arg = new Arg();
  arg.setName(type);
  arg.setKey("${var:" + type + "}");
  arg.setResource(false);
  arg.setPosition(1);
  field.addArg(arg);
  Var var = new Var();
  var.setName(type);
  var.setValue(value.toString());
  field.addVar(var);
}

代码示例来源:origin: org.seasar.struts/s2-struts

public void register(Field field, Map parameter) {
  Object value = parameter.get("value");
  String charset = (String) parameter.get("charset");
  if (StringUtil.isEmpty(charset)) {
    charset = this.defaultCharset;
  }
  String type = getType();
  Arg arg = new Arg();
  arg.setName(type);
  arg.setKey("${var:" + type + "}");
  arg.setResource(false);
  arg.setPosition(1);
  field.addArg(arg);
  Var var = new Var();
  var.setName(type);
  var.setValue(value.toString());
  field.addVar(var);
  var = new Var();
  var.setName("charset");
  var.setValue(charset);
  field.addVar(var);
}

代码示例来源:origin: org.seasar.struts/s2-struts

public void register(Field field, Map parameter) {
  String pattern = (String) parameter.get("pattern");
  String messageKey = (String) parameter.get("messageKey");
  String resourceStr = (String) parameter.get("resource");
  boolean resource = true;
  if (!StringUtil.isEmpty(resourceStr)) {
    resource = BooleanConversionUtil.toPrimitiveBoolean(resourceStr);
  }
  Var var = new Var();
  var.setName("mask");
  var.setValue(pattern);
  field.addVar(var);
  if (!StringUtil.isEmpty(messageKey)) {
    Msg message = new Msg();
    message.setName("mask");
    message.setKey(messageKey);
    message.setResource(resource);
    field.addMsg(message);
  }
}

代码示例来源:origin: org.seasar.struts/s2-struts

public void register(Field field, Map parameter) {
  Object min = parameter.get("min");
  Object max = parameter.get("max");
  String type = getType();
  Arg arg = new Arg();
  arg.setName(type);
  arg.setKey("${var:min}");
  arg.setResource(false);
  arg.setPosition(1);
  field.addArg(arg);
  arg = new Arg();
  arg.setName(type);
  arg.setKey("${var:max}");
  arg.setResource(false);
  arg.setPosition(2);
  field.addArg(arg);
  Var var = new Var();
  var.setName("min");
  var.setValue(min.toString());
  field.addVar(var);
  var = new Var();
  var.setName("max");
  var.setValue(max.toString());
  field.addVar(var);
}

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-system

Var var = new Var();
var.setName("maxlength");
var.setValue("" + length);

相关文章