org.apache.tapestry5.beaneditor.Validate.value()方法的使用及代码示例

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

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

Validate.value介绍

暂无

代码示例

代码示例来源:origin: apache/tapestry-5

public List<String> buildConstraints(Class propertyType, AnnotationProvider annotationProvider)
{
  Validate annotation = annotationProvider.getAnnotation(Validate.class);
  if (annotation == null)
    return null;
  //TAP5-520: Commas within regular expressions like {n,m} or {n,} or a\,b .
  //We use Negative Lookahead to avoid matching the case a\,b .
  //We use Positive Lookahead to avoid matching cases {n,m} and {n,}.
  //http://www.regular-expressions.info/lookaround.html
  return Arrays.asList(validatorPattern.split(annotation.value()));
}

代码示例来源:origin: apache/tapestry-5

private Validate newValidate(String value)
  {
    Validate annotation = newMock(Validate.class);

    expect(annotation.value()).andReturn(value).atLeastOnce();

    return annotation;
  }
}

代码示例来源:origin: apache/tapestry-5

@Test
public void field_annotations_are_visible()
{
  PropertyConduit conduit = source.create(CompositeBean.class, "simple.firstName");
  Validate annotation = conduit.getAnnotation(Validate.class);
  assertNotNull(annotation);
  assertEquals(annotation.value(), "required");
}

代码示例来源:origin: apache/tapestry-5

@Test
public void annotation_from_write_only_property()
{
  TargetBean bean = new TargetBean();
  ComponentResources resources = newComponentResources(bean);
  Location l = mockLocation();
  replay();
  Binding binding = factory.newBinding("test binding", resources, null, "writeOnly", l);
  assertEquals(binding.getAnnotation(Validate.class).value(), "writeonly");
  verify();
}

代码示例来源:origin: apache/tapestry-5

@Test
public void annotation_from_read_only_property()
{
  TargetBean bean = new TargetBean();
  ComponentResources resources = newComponentResources(bean);
  Location l = mockLocation();
  replay();
  Binding binding = factory.newBinding("test binding", resources, null, "readOnly", l);
  assertEquals(binding.getAnnotation(Validate.class).value(), "readonly");
  verify();
}

代码示例来源:origin: apache/tapestry-5

@Test
public void annnotation_on_read_method_takes_precedence_over_write_method()
{
  TargetBean bean = new TargetBean();
  ComponentResources resources = newComponentResources(bean);
  Location l = mockLocation();
  replay();
  Binding binding = factory.newBinding("test binding", resources, null, "objectValue", l);
  assertEquals(binding.getAnnotation(Validate.class).value(), "getObjectValue");
  verify();
}

相关文章

微信公众号

最新文章

更多