Package org.megatome.frame2.jaxbgen

Examples of org.megatome.frame2.jaxbgen.Items$Item


                throw new ParserException("Error finding config file "); //$NON-NLS-1$
            }

            reader.parse(this.is);
        } catch (ParserException e) {
            throw new Frame2Exception("Unable to load configuration", e); //$NON-NLS-1$
        }
    }
View Full Code Here


    Arg arg = field.getArg(0);
    String validatorKey = va.getMsg();
    if (arg != null) {
      String fieldMsgKey = arg.getKey();
      if (fieldMsgKey != null) {
        Error fieldMsg = ErrorFactory.createError(fieldMsgKey);
        Error validateError = ErrorFactory.createError(validatorKey,
            fieldMsg, validatorErrorValue1, validatorErrorValue2);
        errors.add(validateError);
      }
    }
  }
View Full Code Here

    String value2 = ValidatorUtils.getValueAsString(bean, sProperty2);
    if (!GenericValidator.isBlankOrNull(value)) {
      try {
        if (!value.equals(value2)) {
          Arg arg = field.getArg(1);
          Error fieldMsg = null;
          if (arg != null) {
            String fieldMsgKey = arg.getKey();
            if (fieldMsgKey != null) {
              fieldMsg = ErrorFactory.createError(fieldMsgKey);
            }
View Full Code Here

     * @param value2 Second value to insert into message
     * @param value3 Third value to insert into message
     */
    public Error add(final String key, final Object value1,
            final Object value2, final Object value3) {
        Error e = ErrorFactory.createError(key, value1, value2, value3);
        add(e);
        return e;
    }
View Full Code Here

     * @param value3 Third value to insert into message
     * @see org.megatome.frame2.errors.Errors#add(String,Object,Object,Object)
     */
    public Error addIfUnique(final String key, final Object value1,
            final Object value2, final Object value3) {
        Error error = new ErrorImpl(key, value1, value2, value3);

        if (!contains(error)) {
            add(error);
        }

View Full Code Here

  }

  private boolean setupEmailTest(final String emailAddr) {
    this.testBean.setEmail(emailAddr);
    this.testBean.setEmpty("dude"); //$NON-NLS-1$
    final Errors errors = setupAndRunValidate(this.testBean,
        EMAIL_BEAN_NAME);
    return validateErrors(errors);
  }
View Full Code Here

  }

  private Errors setupAndRunValidate(final CommonsValidatorBean testBean,
      final String fieldBeanName) {
    // Add an error to verify the error is passed in..
    final Errors errors = ErrorsFactory.newInstance();
    errors.add("seed", "dude"); //$NON-NLS-1$ //$NON-NLS-2$

    final Validator validator = new Validator(this.validatorResources,
        fieldBeanName);
    // add the name bean to the validator as a resource
    // for the validations to be performed on.
View Full Code Here

  public void testNullEmailNotRequired() {
    this.validatorResources = buildValidatorResources();

    this.testBean.setEmpty("dude"); //$NON-NLS-1$

    final Errors errors = setupAndRunValidate(this.testBean,
        EMAIL_BEAN_NAME);
    assertEquals(DEF_ERRORS_SIZE, errors.size());

  }
View Full Code Here

    this.validatorResources = buildValidatorResources();

    this.testBean.setRequired("required"); //$NON-NLS-1$

    final Errors errors = setupAndRunValidate(this.testBean,
        REQUIRED_BEAN_NAME);
    assertEquals(DEF_ERRORS_SIZE, errors.size());
  }
View Full Code Here

  @Test
  public void testNegativeRequired() {

    this.validatorResources = buildValidatorResources();

    final Errors errors = setupAndRunValidate(this.testBean,
        REQUIRED_BEAN_NAME);

    assertTrue(validateErrors(errors));
  }
View Full Code Here

TOP

Related Classes of org.megatome.frame2.jaxbgen.Items$Item

Copyright © 2018 www.massapicom. 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.