Examples of Validator


Examples of org.sintef.umt.transgen.Validator

  private void doValidateModel(){
   
    pimviewer.clearLineColors();

    output.addLine("Validation : initializing");
    Validator theValidator = new Validator(output);
    XmiSchema theSchema = new DOMXmiSchema(UMTMain.resource_dir + "extxmi.xsd");
    PropertyGroup theProfile = profileeditor.getChosenProfile();
    Profile2XSD transformer = new Profile2XSD();

    try{
      DocumentBuilderFactory theFact = DocumentBuilderFactory.newInstance();   
      DocumentBuilder bobTheBuilder = theFact.newDocumentBuilder();
     
      InputSource toParse = new InputSource(new StringReader(pimviewer.getHutnBuffer()));
         
      Document theModel = bobTheBuilder.parse(toParse);
   
      theSchema = transformer.doTransformation(theProfile,theModel);
      String theProfileName = "No profile selected.";
      if (theProfile != null)
        theProfileName = theProfile.getName();
      if (theProfileName == null || theProfileName.equals(""))
        theProfileName = "(no profile)";
      output.addLine("Validation : starting validation. Profile = " + theProfileName);
      theValidator.validateAgainstSchema(theModel,theSchema);
      output.addLine("Validation : validation done")      ;
     
      Iterator it = output.getErrorLines().iterator();
      while (it.hasNext())
        pimviewer.colorTextLine(((Integer)it.next()).intValue());

Examples of org.sonatype.nexus.capability.Validator

                                 final Provider<CapabilityDescriptorRegistry> capabilityDescriptorRegistryProvider,
                                 final @Assisted CapabilityType type)
  {
    super(capabilityDescriptorRegistryProvider, type);
    checkNotNull(validators);
    Validator descriptorValidator = validators.capability().alwaysValid();
    final List<FormField> formFields = capabilityDescriptor().formFields();
    if (formFields != null) {
      final List<Validator> fieldValidators = Lists.newArrayList();
      for (final FormField formField : formFields) {
        if (formField.isRequired()) {

Examples of org.springframework.binding.validation.Validator

   * the last call to validateAfterPropertyChange or <code>null</code> if
   * this is not known/available.
   */
  protected void validateAfterPropertyChanged(String formProperty) {
    if (isValidating()) {
      Validator validator = getValidator();
      if (validator != null) {
        DefaultValidationResults validationResults = new DefaultValidationResults(bindingErrorMessages.values());
        if (formProperty != null && validator instanceof RichValidator) {
          validationResults.addAllMessages(((RichValidator) validator)
              .validate(getFormObject(), formProperty));
        }
        else {
          validationResults.addAllMessages(validator.validate(getFormObject()));
        }
        validationResults.addAllMessages(additionalValidationResults);
        validationResultsModel.updateValidationResults(validationResults);
      }
    }

Examples of org.springsource.ide.eclipse.commons.livexp.core.Validator

   * build type is supported.
   */
  private void addBuildTypeValidator() {
    RadioGroup buildTypeGroup = getRadioGroups().getGroup("type");
    if (buildTypeGroup!=null) {
      buildTypeGroup.validator(new Validator() {
        @Override
        protected ValidationResult compute() {
          BuildType bt = getBuildType();
          if (!bt.getImportStrategy().isSupported()) {
            //This means some required STS component like m2e or gradle tooling is not installed

Examples of org.strecks.validator.Validator

          gotRawValue = true;
        }

        boolean validate = true;

        Validator validator = wrapper.getValidator();

        if (wrapper.getUsesConvertedValue())
        {
          if (convertedValue != null)
          {

Examples of org.switchyard.admin.Validator

        transformers.add(t);
        when(app.getTransformers()).thenReturn(transformers);
       
        // Validators
        List<Validator> validators = new ArrayList<Validator>();
        Validator v = mock(Validator.class);
        when(v.getName()).thenReturn(new QName("foo"));
        validators.add(v);
        when(app.getValidators()).thenReturn(validators);
       
        // Components
        List<ComponentService> compSvcs = new ArrayList<ComponentService>();

Examples of org.switchyard.validate.Validator

        }
    }

    @Test(expected=SwitchYardException.class)
    public void test_invalid_schemafile() throws IOException, SAXException {
        Validator validator = getValidator("sw-config-invalid-schemafile.xml");
        ValidationResult result = validator.validate(new DefaultMessage().setContent("<order type='A' />"));
    }

Examples of org.zkoss.bind.Validator

    return service;
  }
 
  //validators for prompt
  public Validator getPriceValidator(){
    return new Validator(){
      public void validate(ValidationContext ctx) {
        Double price = (Double)ctx.getProperty().getValue();
        if(price==null || price<=0){
          ctx.setInvalid(); // mark invalid
          validationMessages.put("price", "must large than 0");

Examples of pivot.wtk.text.validation.Validator

     *
     * @param validator
     * The validator to use, or <tt>null</tt> to use no validator.
     */
    public void setValidator(Validator validator) {
        Validator previousValidator = this.validator;

        if (validator != previousValidator) {
            this.validator = validator;
            textInputListeners.textValidatorChanged(this, previousValidator);
            updateTextValid();

Examples of slash.navigation.download.actions.Validator

        updateState(download, Downloading);
        Long contentLength = download.getFile().getExpectedChecksum() != null ? download.getFile().getExpectedChecksum().getContentLength() : null;
        log.info(format("Downloading %d bytes from %s with ETag %s", contentLength, download.getUrl(), download.getETag()));

        get = new Get(download.getUrl());
        if (new Validator(download).existTargets() && download.getETag() != null)
            get.setIfNoneMatch(download.getETag());

        InputStream inputStream = get.executeAsStream();
        log.info(format("Download from %s returned with status code %s", download.getUrl(), get.getStatusCode()));
        if (get.isSuccessful() && inputStream != null) {
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.