当前位置: 首页>>代码示例>>Java>>正文


Java Validator类代码示例

本文整理汇总了Java中org.jdesktop.beansbinding.Validator的典型用法代码示例。如果您正苦于以下问题:Java Validator类的具体用法?Java Validator怎么用?Java Validator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Validator类属于org.jdesktop.beansbinding包,在下文中一共展示了Validator类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate

import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
public Validator.Result validate(Object arg) {

        if (((String) arg).length() < MIN_LENGTH) {
            return new Validator.Result(null, "Password is too short. Min length is " + String.valueOf(MIN_LENGTH));  // NOI18N
        } else {
            return null;
        }
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:LoginLengthValidator.java

示例2: validate

import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
public Validator.Result validate(Integer arg) {        
    if ((arg < 1) || (arg > 199)) {
        return new Result(null, "Age range is 1-199");
    }
    
    return null;    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:AgeValidator.java

示例3: validate

import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
@Override
public Validator.Result validate(Object arg0) {
    if (arg0.equals(true)) {
        formValidation.setComboBoxState(false);
        formValidation.setTextFieldState(true);
    }
    return null;
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:9,代码来源:ValidatoreConstantStrNum.java

示例4: validate

import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
@Override
public Validator.Result validate(Object arg0) {
    if (arg0.equals(true)) {
        formValidation.setComboBoxState(true);
        formValidation.setTextFieldState(false);
        formValidation.setButtonState(true);
    }
    return null;
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:10,代码来源:ValidatoreConstantFun.java

示例5: validate

import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
public Validator<String>.Result validate(String arg0) {
    if (ValidationUtils.isEmpty(arg0)) {
        if (formValidation != null) {
            formValidation.setButtonState(false);
        }
        return new Result(null, NbBundle.getMessage(Costanti.class, Costanti.CAMPO_NULLO));
    }
    if (formValidation != null) {
        formValidation.setButtonState(true);
    }
    return null;

}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:14,代码来源:ValidatoreCampoTesto.java

示例6: validate

import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
@Override
public Validator<Double>.Result validate(Double numero) {
    if (numero < 0 || numero > 1.0) {
        formValidation.setButtonState(false);
        return new Result(null, NbBundle.getMessage(Costanti.class, Costanti.ERROR_LABEL_CONFIDENCE));
    }
    formValidation.setButtonState(true);
    return null;
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:10,代码来源:ValidatoreConfidence.java

示例7: validate

import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
public Validator.Result validate(String arg) {
    if ((arg == null) || (arg.length() == 0)) {
        return new Validator.Result(null, "Empty value");
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:RequiredStringValidator.java

示例8: validate

import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
public Validator.Result validate(String arg) {
    if ((arg.length() < 4) || !arg.contains("@") || !arg.contains(".")) {
        return new Result(null, "Please enter a valid email");
    }
    return null;    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:EmailValidator.java

示例9: getValidatorClass

import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
@Override
public Class getValidatorClass() {
    return Validator.class;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:BindingDesignSupportImpl.java

示例10: validate

import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
@Override
public Validator.Result validate(Object arg0) {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:5,代码来源:ValidatoreFunction.java


注:本文中的org.jdesktop.beansbinding.Validator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。