本文整理了Java中org.apache.commons.validator.Var.setName()
方法的一些代码示例,展示了Var.setName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Var.setName()
方法的具体详情如下:
包路径:org.apache.commons.validator.Var
类名称:Var
方法名:setName
[英]Sets the name of the variable.
[中]设置变量的名称。
代码示例来源: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.setName("maxlength");
var.setValue("" + length);
rules.addVar(var);
内容来源于网络,如有侵权,请联系作者删除!