Package org.springframework.ide.eclipse.core.model.validation

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


    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

              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

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

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

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

    /**
     * {@inheritDoc}
     */
    public void fatal(Problem problem) {
      problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, getMessage(problem), getCurrentResource(),
          getLine(problem)));
      throw new BeanDefinitionParsingException(problem);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void error(Problem problem) {
      problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, getMessage(problem), getCurrentResource(),
          getLine(problem)));
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void warning(Problem problem) {
      problems.add(new ValidationProblem(IMarker.SEVERITY_WARNING, getMessage(problem), getCurrentResource(),
          getLine(problem)));
    }
View Full Code Here

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

TOP

Related Classes of org.springframework.ide.eclipse.core.model.validation.ValidationProblem

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.