Examples of ValidationProblem


Examples of org.jibx.schema.validation.ValidationProblem

    private static boolean reportProblems(ValidationContext vctx) {
        ArrayList probs = vctx.getProblems();
        boolean error = false;
        if (probs.size() > 0) {
            for (int j = 0; j < probs.size(); j++) {
                ValidationProblem prob = (ValidationProblem)probs.get(j);
                String text;
                if (prob.getSeverity() >= ValidationProblem.ERROR_LEVEL) {
                    error = true;
                    text = "Error: " + prob.getDescription();
                    s_logger.error(text);
                } else {
                    text = "Warning: " + prob.getDescription();
                    s_logger.info(text);
                }
                System.out.println(text);
            }
        }
View Full Code Here

Examples of org.jibx.schema.validation.ValidationProblem

        StringWriter writer = new StringWriter();
        writer.append("Problems found in schema definition");
        ArrayList problems = vctx.getProblems();
        for (int i = 0; i < problems.size(); i++) {
            writer.append('\n');
            ValidationProblem prob = (ValidationProblem)problems.get(i);
            writer.append(prob.getDescription());
        }
        return writer.toString();
    }
View Full Code Here

Examples of org.jibx.schema.validation.ValidationProblem

            ((IUnmarshallable)m_customRoot).unmarshal(ictx);
        }
        ArrayList probs = vctx.getProblems();
        if (probs.size() > 0) {
            for (int i = 0; i < probs.size(); i++) {
                ValidationProblem prob = (ValidationProblem)probs.get(i);
                System.out.print(prob.getSeverity() >=
                    ValidationProblem.ERROR_LEVEL ? "Error: " : "Warning: ");
                System.out.println(prob.getDescription());
            }
            if (vctx.getErrorCount() > 0 || vctx.getFatalCount() > 0) {
                return false;
            }
        }
View Full Code Here

Examples of org.jibx.schema.validation.ValidationProblem

        GlobalCustom global = (GlobalCustom)ictx.unmarshalElement();
        List problems = vctx.getProblems();
        if (problems.size() > 0) {
            StringBuffer buff = new StringBuffer();
            for (int i = 0; i < problems.size(); i++) {
                ValidationProblem prob = (ValidationProblem)problems.get(i);
                buff.append(prob.getSeverity() >=
                    ValidationProblem.ERROR_LEVEL ? "Error: " : "Warning: ");
                buff.append(prob.getDescription());
                buff.append('\n');
            }
            fail(buff.toString());
        }
        global.fillClasses();
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.validation.ValidationProblem

    }

    private void createProblem(int severity, IBeansConfigPostProcessingContext postProcessingContext,
        String message, IJavaElement je) {
      try {
        postProcessingContext.reportProblem(new ValidationProblem(severity, message,
            je.getUnderlyingResource(), JdtUtils.getLineNumber(je)));
      }
      catch (JavaModelException e) {
        BeansCorePlugin.log(e);
      }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.validation.ValidationProblem

    if (file == null || !file.exists()) {
      modificationTimestamp = IResource.NULL_STAMP;
      String msg = "Beans config file '" + fullPath + "' not accessible";
      problems = new CopyOnWriteArraySet<ValidationProblem>();
      problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, msg, file, -1));
    }
    else {
      modificationTimestamp = file.getModificationStamp();
    }
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.validation.ValidationProblem

              if (throwables.size() > 0) {
                throw throwables.keySet().iterator().next();
              }
            }
            catch (TimeoutException e) {
              problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, "Loading of resource '"
                  + resource.getFile().getAbsolutePath() + "' took more than "
                  + BeansCorePlugin.getDefault().getPreferenceStore()
                      .getInt(BeansCorePlugin.TIMEOUT_CONFIG_LOADING_PREFERENCE_ID) + "sec",
                  file, 1));
            }
          }
          catch (Throwable e) {
            int line = -1;
            if (throwables.containsKey(e)) {
              line = throwables.get(e);
            }
            // Skip SAXParseExceptions because they're already handled by the SAX ErrorHandler
            if (e instanceof BeanDefinitionStoreException) {
              if (e.getCause() != null) {
                problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, String.format(
                    "Error occured processing XML '%s'. See Error Log for more details", e.getCause().getMessage()), file, line));
                BeansCorePlugin.log(new Status(IStatus.INFO, BeansCorePlugin.PLUGIN_ID, String.format(
                    "Error occured processing '%s'", file.getFullPath()), e.getCause()));
              }
              else {
                problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, e.getMessage(), file, line));
                BeansCorePlugin.log(new Status(IStatus.INFO, BeansCorePlugin.PLUGIN_ID, String.format(
                    "Error occured processing '%s'", file.getFullPath()), e));
              }
            }
            else if (!(e.getCause() instanceof SAXParseException)
                && !(e instanceof BeanDefinitionParsingException)) {
              problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, e.getMessage(), file, line));
              BeansCorePlugin.log(new Status(IStatus.INFO, BeansCorePlugin.PLUGIN_ID, String.format(
                  "Error occured processing '%s'", file.getFullPath()), e));
            }
          }
        }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.validation.ValidationProblem

    /**
     * {@inheritDoc}
     */
    public void warning(SAXParseException e) throws SAXException {
      problems.add(new ValidationProblem(IMarker.SEVERITY_WARNING, e.getMessage(), getCurrentResource(), e
          .getLineNumber()));
    }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.validation.ValidationProblem

    /**
     * {@inheritDoc}
     */
    public void error(SAXParseException e) throws SAXException {
      problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, e.getMessage(), getCurrentResource(), e
          .getLineNumber()));
    }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.validation.ValidationProblem

    /**
     * {@inheritDoc}
     */
    public void fatalError(SAXParseException e) throws SAXException {
      problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, e.getMessage(), getCurrentResource(), e
          .getLineNumber()));
    }
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.