Examples of Validator


Examples of org.apache.cocoon.validation.Validator

      if ( !file.exists () ) throw new Exception("Error: schema file not found !");
     InputStream istrm = new FileInputStream ( file );
     InputSource is = new InputSource ( istrm );
     SchemaFactory schf = SchemaFactory.lookup( SchemaFactory.NAMESPACE_SCHEMATRON );
     Schema sch = schf.compileSchema( is );
     Validator validator = sch.newValidator();

     // set preprocessor parameters
      if (args.length > 1)
         validator.setProperty("phase", new String(args[1]));

      ZTestBean tbean = new ZTestBean();
     
      // measure validation speed
      long time = System.currentTimeMillis ();
      int i = 0;
      SortedSet violations = null;
      for (; i < 100; i++)
      {
        // perform validation
        violations = validator.validate( tbean );
      }
      time = System.currentTimeMillis () - time;
      System.out.println( "\nValidation performance:");
      System.out.println( " validate() executed " + i + " times for a total of " + time + " ms");
      System.out.println( "Avarage validation time: " + (time/i) + " ms " );

Examples of org.apache.commons.cli2.validation.Validator

    fValidator.setFile(false);
    // fValidator.setReadable(true);
    gBuilder.withOption(aBuilder.reset().withName(CONF_FILE).withDescription("is the wrapper.conf to use.  Name must be absolute or relative")
        .withMinimum(0).withMaximum(10).create());

    Validator pValidator = new Validator()
    {

      public void validate(List values) throws InvalidArgumentException
      {
        for (Iterator it = values.iterator(); it.hasNext();)

Examples of org.apache.commons.validator.Validator

      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.
    validator.setParameter(Validator.BEAN_PARAM, testBean);
    validator.setParameter(Globals.ERRORS_KEY, errors);

    // Get results of the validation.
    try {
      validator.validate();
    } catch (final ValidatorException e) {
      fail();
    }
    return errors;
  }

Examples of org.apache.etch.bindings.java.msg.Validator

    {
      Field key = readField( t );
      if (key == null)
        break;
     
      Validator v = t.getValidator( key );
      if (v != null)
      {
        sv.put( key, readValue( v ) );
      }
      else

Examples of org.apache.felix.scrplugin.helper.Validator

        // now validate
        final DescriptionContainer module = new DescriptionContainer(this.options);
        for (final ComponentContainer container : processedContainers) {
            final int errorCount = iLog.getNumberOfErrors();

            final Validator validator = new Validator(container, project, options, iLog);
            validator.validate();

            // ignore component if it has errors
            if (iLog.getNumberOfErrors() == errorCount) {
                module.add(container);
            }

Examples of org.apache.geronimo.validator.Validator

        try {
            ClassLoader loader = new URLClassLoader(new URL[]{new File(args[0]).toURL()});
            InputStream in = loader.getResourceAsStream("META-INF/ejb-jar.xml");

            EjbJarDocument jar = EjbJarDocument.Factory.parse(in);
            Validator v =new EjbValidator();
            v.initialize(new PrintWriter(new OutputStreamWriter(System.out), true), args[0], loader, ModuleType.EJB, new XmlObject[]{jar}, null);
            System.out.println("Validation Result: "+v.validate());
        } catch(Exception e) {
            e.printStackTrace();
        }
    }

Examples of org.apache.jackrabbit.oak.spi.commit.Validator

    @Nonnull
    private Validator nextValidator(@Nullable ImmutableTree parentBefore,
                                    @Nullable ImmutableTree parentAfter,
                                    @Nonnull TreePermission treePermission) {
        Validator validator = createValidator(parentBefore, parentAfter, treePermission, this);
        return new VisibleValidator(validator, true, false);
    }

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

public class ValidatorMetaDataTransformer  extends AbstractValidationParameterAwareTransformer
{
    protected Map<String, Object> transformMetaData(MetaDataEntry metaDataEntry)
    {
        Map<String, Object> results = new HashMap<String, Object>();
        Validator annotation = metaDataEntry.getValue(Validator.class);

        Class[] validators = annotation.value();

        List<String> value = new ArrayList<String>();

        for(Class currentClass : validators)
        {

Examples of org.apache.myfaces.tobago.apt.annotation.Validator

    converter.addContent(converterClass);
    newConverters.add(converter);
  }

  private void addValidator(ClassDeclaration decl, List<Element> newValidators, Namespace namespace) {
    Validator validatorAnn = decl.getAnnotation(Validator.class);
    Element validator = new Element(VALIDATOR, namespace);
    if (validatorAnn.id().length() > 0) {
      Element validatorId = new Element(VALIDATOR_ID, namespace);
      validatorId.setText(validatorAnn.id());
      validator.addContent(validatorId);
    } else if (validatorAnn.forClass().length() > 0) {
      Element validatorForClass = new Element(VALIDATOR_FOR_CLASS, namespace);
      validatorForClass.setText(validatorAnn.forClass());
      validator.addContent(validatorForClass);
    }

    Element validatorClass = new Element(VALIDATOR_CLASS, namespace);
    validatorClass.setText(decl.getQualifiedName());

Examples of org.apache.pivot.wtk.text.validation.Validator

                if (textInput.getSelectionLength() == 0
                    && textNode.getCharacterCount() == textInput.getMaximumLength()) {
                    Toolkit.getDefaultToolkit().beep();
                } else {
                    int index = textInput.getSelectionStart();
                    Validator validator = textInput.getValidator();

                    if (validator != null
                        && strictValidation) {
                        StringBuilder buf = new StringBuilder(textNode.getText());
                        buf.insert(index, character);

                        if (validator.isValid(buf.toString())) {
                            textInput.insertText(character, index);
                        } else {
                            Toolkit.getDefaultToolkit().beep();
                        }
                    } else {
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.