Examples of BeanValidationContext


Examples of org.apache.tapestry5.internal.BeanValidationContext

        }
    }

    protected void removePropertyNameFromBeanValidationContext()
    {
        BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class);

        if (beanValidationContext == null)
            return;

        beanValidationContext.setCurrentProperty(null);
    }
View Full Code Here

Examples of org.apache.tapestry5.internal.BeanValidationContext

    return false;
  }

  public void render(final MarkupWriter writer)
  {
    final BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class);

    if (beanValidationContext == null)
    {
      return;
    }
   
    final Validator validator = validatorFactory.getValidator();
   
    BeanDescriptor beanDescriptor = validator.getConstraintsForClass(beanValidationContext.getBeanType());
   
    String currentProperty = beanValidationContext.getCurrentProperty();
   
    if(currentProperty == null) return;
   
    PropertyDescriptor propertyDescriptor = beanDescriptor.getConstraintsForProperty(currentProperty);
   
View Full Code Here

Examples of org.apache.tapestry5.internal.BeanValidationContext

  @SuppressWarnings("unchecked")
  public void validate(final Object value) throws ValidationException
  {

    final BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class);

    if (beanValidationContext == null)
    {
      return;
    }
   
    final Validator validator = validatorFactory.getValidator();
   
    String currentProperty = beanValidationContext.getCurrentProperty();
   
    if(currentProperty == null) return;
   
    BeanDescriptor beanDescriptor = validator.getConstraintsForClass(beanValidationContext.getBeanType());
   
    PropertyDescriptor propertyDescriptor = beanDescriptor.getConstraintsForProperty(currentProperty);
   
    if(propertyDescriptor == null) return;
   
    final Set<ConstraintViolation<Object>> violations = validator.validateValue(
            (Class<Object>) beanValidationContext.getBeanType(), currentProperty,
            value, beanValidationGroupSource.get());
   
    if (violations.isEmpty())
    {
      return;
View Full Code Here

Examples of org.apache.tapestry5.internal.BeanValidationContext

        BeanModel model = mockBeanModel();
        Environment env = mockEnvironment();
        RegistrationData data = new RegistrationData();
        Messages messages = mockMessages();
        PropertyOverrides overrides = mockPropertyOverrides();
        BeanValidationContext beanValidationContext = newMock(BeanValidationContext.class);

        train_getBoundType(resources, "object", RegistrationData.class);

        train_createEditModel(source, RegistrationData.class, messages, model);
View Full Code Here

Examples of org.apache.tapestry5.internal.BeanValidationContext

            }
        };

        environment.push(PropertyEditContext.class, context);
       
        BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class);
       
        if(beanValidationContext != null)
        {
          beanValidationContext.setCurrentProperty(propertyName);
        }
    }
View Full Code Here

Examples of org.apache.tapestry5.internal.BeanValidationContext

   
    protected void putPropertyNameIntoBeanValidationContext(String parameterName)
    {
        String propertyName = ((InternalComponentResources)resources).getPropertyName(parameterName);
       
        BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class);
       
        if(beanValidationContext == null) return;

        //If field is inside BeanEditForm, then property is already set
        if(beanValidationContext.getCurrentProperty()==null)
        {
          beanValidationContext.setCurrentProperty(propertyName);
        }
    }
View Full Code Here

Examples of org.apache.tapestry5.internal.BeanValidationContext

        }
    }
   
    protected void removePropertyNameFromBeanValidationContext()
    {  
      BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class);
     
      if(beanValidationContext == null) return;
     
      beanValidationContext.setCurrentProperty(null);
    }
View Full Code Here

Examples of org.apache.tapestry5.internal.BeanValidationContext

   
    protected void putPropertyNameIntoBeanValidationContext(String parameterName)
    {
        String propertyName = ((InternalComponentResources)resources).getPropertyName(parameterName);
       
        BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class);
       
        if(beanValidationContext == null) return;

        //If field is inside BeanEditForm, then property is already set
        if(beanValidationContext.getCurrentProperty()==null)
        {
          beanValidationContext.setCurrentProperty(propertyName);
        }
    }
View Full Code Here

Examples of org.apache.tapestry5.internal.BeanValidationContext

        }
    }
   
    protected void removePropertyNameFromBeanValidationContext()
    {  
      BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class);
     
      if(beanValidationContext == null) return;
     
      beanValidationContext.setCurrentProperty(null);
    }
View Full Code Here

Examples of org.apache.tapestry5.internal.BeanValidationContext

        return false;
    }

    public void render(final MarkupWriter writer)
    {
        final BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class);

        if (beanValidationContext == null)
        {
            return;
        }

        final Validator validator = validatorFactory.getValidator();

        BeanDescriptor beanDescriptor = validator.getConstraintsForClass(beanValidationContext.getBeanType());

        String currentProperty = beanValidationContext.getCurrentProperty();

        if (currentProperty == null) return;

        PropertyDescriptor propertyDescriptor = beanDescriptor.getConstraintsForProperty(currentProperty);
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.