Examples of Required


Examples of com.almende.eve.agent.annotation.Required

   * @param param
   * @return required
   */
  private static boolean isRequired(AnnotatedParam param) {
    boolean required = true;
    Required requiredAnnotation = param.getAnnotation(Required.class);
    if (requiredAnnotation != null) {
      required = requiredAnnotation.value();
    }
    return required;
  }
View Full Code Here

Examples of com.almende.eve.agent.annotation.Required

   * @param param
   * @return required
   */
  private static boolean isRequired(AnnotatedParam param) {
    boolean required = true;
    Required requiredAnnotation = param.getAnnotation(Required.class);
    if (requiredAnnotation != null) {
      required = requiredAnnotation.value();
    }
    return required;
  }
View Full Code Here

Examples of com.almende.eve.rpc.annotation.Required

   * @param param
   * @return required
   */
  private static boolean isRequired(AnnotatedParam param) {
    boolean required = true;
    Required requiredAnnotation = param.getAnnotation(Required.class);
    if (requiredAnnotation != null) {
      required = requiredAnnotation.value();
    }
    return required;
  }
View Full Code Here

Examples of com.bleujin.framework.valid.validator.Required

  public void testRequired() throws Exception {

    // assertEquals(false, new RequiredValidator(b, "_value").isValid());

    assertEquals(false, new Required(b, SVALUE).isValid());
   
    b.setSvalue("") ;
    assertEquals(false, new Required(b, SVALUE).isValid());

    b.setSvalue(" \t\n") ;
    assertEquals(false, new Required(b, SVALUE).isValid());

    b.setSvalue("a") ;
    assertEquals(true, new Required(b, SVALUE).isValid());
  }
View Full Code Here

Examples of com.bleujin.framework.valid.validator.Required

  public void testSet() throws Exception {
   
   
    b.setSvalue("abc") ;
   
    assertEquals(true, (new Required(b, SVALIE)).isValid()) ;

   
    ValidSet s = new ValidSet() ;
    assertEquals(true, s.isValid()) ;
   
    s.add(new Required(b, SVALIE)) ;
   
    assertEquals(true, s.isValid()) ;

    s.add(new MoreEqualInteger(b, IVALIE, 3)) ;
    assertEquals(false, s.isValid()) ;
View Full Code Here

Examples of com.intellij.util.xml.Required

    if (type instanceof Class && Enum.class.isAssignableFrom(rawType)) {
      return new ComboControl(stringWrapper, rawType);
    }
    if (DomElement.class.isAssignableFrom(rawType)) {
      final ComboControl control = new ComboControl(element);
      final Required annotation = element.getAnnotation(Required.class);
      if (annotation == null || !annotation.value() || !annotation.nonEmpty()) {
        control.setNullable(true);
      }
      return control;
    }
View Full Code Here

Examples of org.apache.camel.spi.Required

          if (propertyDescriptors != null) {
            for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
              if (propertyName.equals(propertyDescriptor.getName())) {
                Method writeMethod = propertyDescriptor.getWriteMethod();
                if (writeMethod != null) {
                  Required annotation = writeMethod.getAnnotation(Required.class);
                  if (annotation != null) {
                    return true;
                  }
                  if (useMethods) {
                    XmlElement element = writeMethod.getAnnotation(XmlElement.class);
                    if (element != null && element.required()) {
                      return true;
                    }
                    XmlAttribute attribute = writeMethod.getAnnotation(XmlAttribute.class);
                    if (attribute != null && attribute.required()) {
                      return true;
                    }
                  }
                }
                break;
              }
            }
          }
          if (!useMethods) {
            Field[] fields = camelClass.getDeclaredFields();
            for (Field field : fields) {
              if (propertyName.equals(field.getName())) {
                Required annotation = field.getAnnotation(Required.class);
                if (annotation != null) {
                  return true;
                }
                XmlElement element = field.getAnnotation(XmlElement.class);
                if (element != null && element.required()) {
View Full Code Here

Examples of org.apache.camel.spi.Required

          if (propertyDescriptors != null) {
            for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
              if (propertyName.equals(propertyDescriptor.getName())) {
                Method writeMethod = propertyDescriptor.getWriteMethod();
                if (writeMethod != null) {
                  Required annotation = writeMethod.getAnnotation(Required.class);
                  if (annotation != null) {
                    return true;
                  }
                  if (useMethods) {
                    XmlElement element = writeMethod.getAnnotation(XmlElement.class);
                    if (element != null && element.required()) {
                      return true;
                    }
                    XmlAttribute attribute = writeMethod.getAnnotation(XmlAttribute.class);
                    if (attribute != null && attribute.required()) {
                      return true;
                    }
                  }
                }
                break;
              }
            }
          }
          if (!useMethods) {
            Field[] fields = camelClass.getDeclaredFields();
            for (Field field : fields) {
              if (propertyName.equals(field.getName())) {
                Required annotation = field.getAnnotation(Required.class);
                if (annotation != null) {
                  return true;
                }
                XmlElement element = field.getAnnotation(XmlElement.class);
                if (element != null && element.required()) {
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.Required

    public void testParameterStyleOne() throws Exception
    {
        ValidationParameterExtractor extractor = new DefaultValidationParameterExtractor();

        TestPerson person = new TestPerson();
        Required required = person.getClass().getDeclaredField("firstName").getAnnotation(Required.class);

        assertNotNull(extractor.extract(required).containsKey(ViolationSeverity.class));
        assertNotNull(extractor.extract(required, ViolationSeverity.class).iterator().next());
        assertEquals(FacesMessage.SEVERITY_WARN, extractor.extract(required, ViolationSeverity.class).iterator().next());
    }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.Required

    public void testParameterStyleTwo() throws Exception
    {
        ValidationParameterExtractor extractor = new DefaultValidationParameterExtractor();

        TestPerson person = new TestPerson();
        Required required = person.getClass().getDeclaredField("lastName").getAnnotation(Required.class);

        assertNotNull(extractor.extract(required).containsKey("client_side_validation_support"));
        assertNotNull(extractor.extract(required, "client_side_validation_support").iterator().next());
        assertEquals(false, extractor.extract(required, "client_side_validation_support").iterator().next());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.