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


Java Assert类代码示例

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


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

示例1: increase

import net.sf.oval.constraint.Assert; //导入依赖的package包/类
@Pre(expr = "_this.value!=null && value2add!=null && _args[0]!=null", lang = "ognl", message = "PRE")
@Post(expr = "_this.value>_old.value", old = "#{\"value\":_this.value}", lang = "ognl", message = "POST")
public void increase(@Assert(expr = "_value!=null", lang = "ognl", message = "ASSERT") final BigDecimal value2add) {
    if (buggyMode)
        value = value.subtract(value2add);
    else
        value = value.add(value2add);
}
 
开发者ID:sebthom,项目名称:oval,代码行数:9,代码来源:PrePostOGNLTest.java

示例2: increase

import net.sf.oval.constraint.Assert; //导入依赖的package包/类
@Pre(expr = "_this.value!=null && value2add!=null && _args[0]!=null", lang = "js", message = "PRE")
@Post(expr = "_this.value>_old", old = "_this.value", lang = "javascript", message = "POST")
public void increase(@Assert(expr = "_value!=null", lang = "js", message = "ASSERT") final BigDecimal value2add) {
    if (buggyMode)
        value = value.subtract(value2add);
    else
        value = value.add(value2add);
}
 
开发者ID:sebthom,项目名称:oval,代码行数:9,代码来源:PrePostJavascriptTest.java

示例3: increase

import net.sf.oval.constraint.Assert; //导入依赖的package包/类
@Pre(expr = "_this.value!=null && value2add!=null && _args[0]!=null", lang = "bsh", message = "PRE")
@Post(expr = "_this.value.longValue()>_old.longValue()", old = "_this.value", lang = "beanshell", message = "POST")
public void increase(@Assert(expr = "_value!=null", lang = "bsh", message = "ASSERT") final BigDecimal value2add) {
    if (buggyMode)
        value = value.subtract(value2add);
    else
        value = value.add(value2add);
}
 
开发者ID:sebthom,项目名称:oval,代码行数:9,代码来源:PrePostBeanShellTest.java

示例4: increase

import net.sf.oval.constraint.Assert; //导入依赖的package包/类
@Pre(expr = "_this.value!=null && value2add!=null && _args[0]!=null", lang = "jexl", message = "PRE")
@Post(expr = "_this.value>_old.value", old = "{\"value\" : _this.value}", lang = "jexl", message = "POST")
public void increase(@Assert(expr = "_value!=null", lang = "jexl", message = "ASSERT") final BigDecimal value2add) {
    if (buggyMode)
        value = value.subtract(value2add);
    else
        value = value.add(value2add);
}
 
开发者ID:sebthom,项目名称:oval,代码行数:9,代码来源:PrePostJEXLTest.java

示例5: increase

import net.sf.oval.constraint.Assert; //导入依赖的package包/类
@Pre(expr = "_this.value!=null && value2add!=null && _args[0]!=null", lang = "groovy", message = "PRE")
@Post(expr = "_this.value>_old.value", old = "[value:_this.value]", lang = "groovy", message = "POST")
public void increase(@Assert(expr = "_value!=null", lang = "groovy", message = "ASSERT") final BigDecimal value2add) {
    if (buggyMode)
        value = value.subtract(value2add);
    else
        value = value.add(value2add);
}
 
开发者ID:sebthom,项目名称:oval,代码行数:9,代码来源:PrePostGroovyTest.java

示例6: increase

import net.sf.oval.constraint.Assert; //导入依赖的package包/类
@Pre(expr = "!_this.value.nil? && !value2add.nil? && !_args[0].nil?", lang = "ruby", message = "PRE")
@Post(expr = "_this.value>_old['value']", old = "{ 'value' => _this.value }", lang = "ruby", message = "POST")
public void increase(@Assert(expr = "!_value.nil?", lang = "ruby", message = "ASSERT") final BigDecimal value2add) {
    if (buggyMode)
        value = value.subtract(value2add);
    else
        value = value.add(value2add);
}
 
开发者ID:sebthom,项目名称:oval,代码行数:9,代码来源:PrePostRubyTest.java

示例7: increase

import net.sf.oval.constraint.Assert; //导入依赖的package包/类
@Pre(expr = "_this.value!=null && value2add!=null && _args[0]!=null", lang = "mvel", message = "PRE")
@Post(expr = "_this.value>_old.value", old = "[\"value\":_this.value]", lang = "mvel", message = "POST")
public void increase(@Assert(expr = "_value!=null", lang = "mvel", message = "ASSERT") final BigDecimal value2add) {
    if (buggyMode)
        value = value.subtract(value2add);
    else
        value = value.add(value2add);
}
 
开发者ID:sebthom,项目名称:oval,代码行数:9,代码来源:PrePostMVELTest.java

示例8: getName

import net.sf.oval.constraint.Assert; //导入依赖的package包/类
@Assert(expr = "_this.name != null", lang = "bsh", message = "NOT_NULL")
@Length(max = 4, message = "LENGTH")
public String getName() {
    return name;
}
 
开发者ID:sebthom,项目名称:oval,代码行数:6,代码来源:MethodReturnValueConstraintsValidationTest.java


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