Examples of Validator


Examples of hirondelle.web4j.model.Validator

  private static final Pattern ACCEPTED_PATTERN = Pattern.compile("(?:\\S){6,50}");
  private static final Logger fLogger = Util.getLogger(User.class);

  private void validateState() throws ModelCtorException {
    ModelCtorException ex = new ModelCtorException();
    Validator validPattern = Check.pattern(ACCEPTED_PATTERN);
    if ( FAILS == Check.required(fName, validPattern) ) {
      ex.add("Name is required, 6..50 chars, no spaces.");
    }
    if ( FAILS == Check.required(fHashedPassword, validPattern)) {
      ex.add("Password is required, 6..50 chars, no spaces.");

Examples of javax.faces.validator.Validator

            final Validator[] validators = valueHolder.getValidators();
            if (validators != null)
            {
                for (int ctr = 0; ctr < validators.length; ctr++)
                {
                    final Validator test = validators[ctr];
                    if (test instanceof JSFValidator)
                    {
                        present = test.toString().equals(validator.toString());
                        if (present)
                        {
                            break;
                        }
                    }

Examples of javax.validation.Validator

        interpolator = new ResourceBundleMessageInterpolator(clientDefaultMessages);
      }
      localesMap.put(clientLocale.toString(), interpolator);
    }

    Validator validator = factory.usingContext().messageInterpolator(interpolator).getValidator();
   
    Set<ConstraintViolation<ActionSupport>> constraintViolations = validator.validate(actionAs);
   
    List<Path> invalidFieldNames = new ArrayList<Path>();
    Map parameters = ActionContext.getContext().getParameters();
    for (ConstraintViolation<ActionSupport> constrantViolation : constraintViolations) {
      Path fieldPath = constrantViolation.getPropertyPath();

Examples of javax.xml.validation.Validator

            throw new ConfigurationException(new Message("PARSE_ERROR_EXC", LOG), ex);
        }

        if (doValidate) {
            try {
                Validator v = getMetadataValidator();
                v.validate(new DOMSource(document));
            } catch (SAXException ex) {
                Message msg = new Message("METADATA_VALIDATION_ERROR_EXC", LOG);
                throw new ConfigurationException(msg, ex);
            }
        }

Examples of net.sf.oval.Validator

    protected void performOValValidation(Object action, ValueStack valueStack, String methodName, String context) throws NoSuchMethodException {
        Class clazz = action.getClass();
        //read validation from xmls
        List<Configurer> configurers = validationManager.getConfigurers(clazz, context, validateJPAAnnotations);

        Validator validator = configurers.isEmpty() ? new Validator() : new Validator(configurers);
        //if the method is annotated with a @Profiles annotation, use those profiles
        Method method = clazz.getMethod(methodName, new Class[0]);
        if (method != null) {
            Profiles profiles = method.getAnnotation(Profiles.class);
            if (profiles != null) {
                String[] profileNames = profiles.value();
                if (profileNames != null && profileNames.length > 0) {
                    validator.disableAllProfiles();
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Enabling profiles [#0]", StringUtils.join(profileNames, ","));
                    }
                    for (String profileName : profileNames)
                        validator.enableProfile(profileName);
                }
            }
        }

        //perform validation
        List<ConstraintViolation> violations = validator.validate(action);
        addValidationErrors(violations.toArray(new ConstraintViolation[violations.size()]), action, valueStack, null);
    }

Examples of net.sourceforge.turtlescript.validator.Validator

public class ValidatorTest {
  static Logger logger = Logger.getLogger(ValidatorTest.class);

  @Test
  public void exampleTest() throws IOException, RecognitionException {
    Validator validator = new Validator();
    Model model =
        validator.validate(this.getClass().getResourceAsStream("/html/example.html"));
   
    Assert.assertFalse(model.isEmpty());
  }

Examples of org.apache.any23.validator.Validator

        try {
            dURI = new URI(documentURI);
        } catch (URISyntaxException urise) {
            throw new ValidatorException("Error while performing validation, invalid document URI.", urise);
        }
        Validator validator = new DefaultValidator();
        Document document = getDOM();
        return new DocumentReport( validator.validate(dURI, document, applyFix), document );
    }

Examples of org.apache.cassandra.repair.Validator

    }

    private void testValidationCompleteWrite() throws IOException
    {
        // empty validation
        Validator v0 = new Validator(DESC, FBUtilities.getBroadcastAddress(),  -1);
        ValidationComplete c0 = new ValidationComplete(DESC, v0.tree);

        // validation with a tree
        IPartitioner p = new RandomPartitioner();
        MerkleTree mt = new MerkleTree(p, FULL_RANGE, MerkleTree.RECOMMENDED_DEPTH, Integer.MAX_VALUE);
        for (int i = 0; i < 10; i++)
            mt.split(p.getRandomToken());
        Validator v1 = new Validator(DESC, FBUtilities.getBroadcastAddress(), mt, -1);
        ValidationComplete c1 = new ValidationComplete(DESC, v1.tree);

        // validation failed
        ValidationComplete c3 = new ValidationComplete(DESC);

Examples of org.apache.cayenne.project.validator.Validator

    /**
     * Creates an instance of Validator for validating this project.
     */
    public Validator getValidator() {
        return new Validator(this);
    }

Examples of org.apache.cocoon.components.validation.Validator

        if (form!=null) {
            return form;
        } else {
            // create new form
            form = new Form(getFormId(), getFormModel());
            Validator v = getFormValidator();

            form.setValidator(v);
            form.save(getObjectModel(), getFormScope());
            return form;
        }
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.