Examples of Diagnostic


Examples of com.asakusafw.dmdl.Diagnostic

            throw new IllegalArgumentException("literalKind must not be null"); //$NON-NLS-1$
        }
        AstAttributeElement target = elements.remove(elementName);
        if (target == null) {
            if (mandatory) {
                environment.report(new Diagnostic(
                        Level.ERROR,
                        attribute.name,
                        Messages.getString("AttributeUtil.diagnosticMissingElement"), //$NON-NLS-1$
                        attribute.name.toString(),
                        elementName));
            }
            return null;
        } else if (isLiteral(target.value, literalKind) == false) {
            environment.report(new Diagnostic(
                    Level.ERROR,
                    target,
                    Messages.getString("AttributeUtil.diagnosticNotLiteral"), //$NON-NLS-1$
                    attribute.name.toString(),
                    elementName,
View Full Code Here

Examples of com.asakusafw.dmdl.Diagnostic

                if (kind == accept) {
                    return true;
                }
            }
        }
        environment.report(new Diagnostic(
                Level.ERROR,
                attribute,
                Messages.getString("AttributeUtil.diagnosticInvalidTypeElement"), //$NON-NLS-1$
                declaration.getOwner().getName().identifier,
                declaration.getName().identifier,
View Full Code Here

Examples of com.asakusafw.dmdl.Diagnostic

            DmdlSemantics environment,
            AstNode targetNode,
            String targetLabel,
            String value) {
        if (value == null || value.isEmpty()) {
            environment.report(new Diagnostic(
                    Level.ERROR,
                    targetNode,
                    Messages.getString("AttributeUtil.diagnosticEmptyString"), //$NON-NLS-1$
                    targetLabel));
            return false;
View Full Code Here

Examples of com.asakusafw.dmdl.Diagnostic

            AstNode targetNode,
            String targetLabel,
            BigInteger value,
            Long minimum, Long maximum) {
        if (maximum != null && value.compareTo(BigInteger.valueOf(maximum)) > 0) {
            environment.report(new Diagnostic(
                    Level.ERROR,
                    targetNode,
                    Messages.getString("AttributeUtil.diagnosticNumberTooLarge"), //$NON-NLS-1$
                    targetLabel,
                    maximum,
                    value));
            return false;
        } else if (minimum != null && value.compareTo(BigInteger.valueOf(minimum)) < 0) {
            environment.report(new Diagnostic(
                    Level.ERROR,
                    targetNode,
                    Messages.getString("AttributeUtil.diagnosticNumberTooSmall"), //$NON-NLS-1$
                    targetLabel,
                    minimum,
View Full Code Here

Examples of com.puppetlabs.geppetto.diagnostic.Diagnostic

          protected ForgeService getForgeService() {
            return injector.getInstance(ForgeService.class);
          }
        };
        boolean result = executeExport(exportOp);
        Diagnostic diag = exportOp.getDiagnostic();
        if(diag.getSeverity() == Diagnostic.ERROR) {
          Exception e = diag.getException();
          ErrorDialog.openError(
            getContainer().getShell(), DataTransferMessages.DataTransfer_exportProblems, null, // no special message
            UIPlugin.createStatus(IStatus.ERROR, diag.toString(), e));
        }
        else
          MessageDialog.openInformation(
            getContainer().getShell(), DataTransferMessages.DataTransfer_information, diag.toString());
        return result;
      }
      catch(CoreException e) {
        ErrorDialog.openError(
          getContainer().getShell(), DataTransferMessages.DataTransfer_exportProblems, null, // no special message
View Full Code Here

Examples of com.volantis.mcs.model.validation.Diagnostic

        if (!diagnostics.isEmpty()) {
            StringBuffer buffer = new StringBuffer();
            boolean foundError = false;
            for (int i = 0; i < diagnostics.size(); i++) {
                Diagnostic diagnostic = (Diagnostic) diagnostics.get(i);

                // Add the level.
                DiagnosticLevel level = diagnostic.getLevel();
                if (level == DiagnosticLevel.ERROR) {
                    foundError = true;
                }
                buffer.append(level);

                // Add the position in the file
                buffer.append(" ");
                SourceLocation location = diagnostic.getLocation();
                buffer.append(location.getSourceDocumentName());
                buffer.append(":(");
                buffer.append(location.getSourceLineNumber());
                buffer.append(",");
                buffer.append(location.getSourceColumnNumber());
                buffer.append(")");

                // Only add the path if debug is enabled since it is internal
                // but it can be pretty useful.
                if (logger.isDebugEnabled()) {
                    buffer.append(" ");
                    buffer.append(diagnostic.getPath());
                }

                // Add the message
                buffer.append(" - ");
                buffer.append(diagnostic.getMessage());
                buffer.append("\n");
            }

            if (foundError) {
                if (logger.isErrorEnabled()) {
View Full Code Here

Examples of org.eclipse.emf.common.util.Diagnostic

        .getInstance()
        .getInjector(
            TargetPlatformActivator.FR_OBEO_RELENG_TARGETPLATFORM_TARGETPLATFORM);
    Converter converter = new Converter();
    injector.injectMembers(converter);
    Diagnostic diagnostic = null;
    final String path = selectedElement.getLocation().toFile().getAbsolutePath();
    URI targetplatformFileURI = URI.createFileURI(path);

    try {
      diagnostic = converter.generateTargetDefinitionFile(targetplatformFileURI, subMonitor.newChild(95));
View Full Code Here

Examples of org.eclipse.emf.common.util.Diagnostic

    Converter converter = new Converter();
    injector.injectMembers(converter);

    URI uri = normalize(org.eclipse.emf.common.util.URI.createURI(path));
   
    Diagnostic diagnostic = converter.generateTargetDefinitionFile(uri, createPrintingMonitor());
   
    if (diagnostic.getSeverity() >= Diagnostic.WARNING) {
      for (Diagnostic child : diagnostic.getChildren()) {
        printDiagnostic(child, "");
      }
    }
   
    if (diagnostic.getSeverity() == Diagnostic.ERROR) {
      System.out.println("Problems occurred during generation of target platform definition file.");
      return -1;
    } else if (diagnostic.getSeverity() == Diagnostic.CANCEL) {
      System.out.println("Operation cancelled.");
      return -2;
    } else {
      System.out.println("The target platform definition file has been successfully generated.");
      return 0;
View Full Code Here

Examples of org.eclipse.emf.common.util.Diagnostic

    for (ResolvedLocation location : getLocations()) {
      if(subMonitor.isCanceled()) {
        ret.merge(BasicDiagnostic.CANCEL_INSTANCE);
        break;
      }
      Diagnostic diagnostic = location.resolve(metadataRepositoryManager, subMonitor);
      if (diagnostic.getSeverity() >= Diagnostic.WARNING) {
        ret.merge(diagnostic);
      }
      subMonitor.worked(1);
    }
    return ret;
View Full Code Here

Examples of org.eclipse.emf.common.util.Diagnostic

  public Diagnostic generateTargetDefinitionFile(URI uri, IProgressMonitor monitor) {
    BasicDiagnostic ret = new BasicDiagnostic(TargetPlatformBundleActivator.PLUGIN_ID, 0, "Diagnostic of the generation of the target platform.", null);
    if (!"targetplatform".equals(uri.fileExtension()) && !"tpd".equals(uri.fileExtension())) {
      ret.merge(new BasicDiagnostic(Diagnostic.ERROR, TargetPlatformBundleActivator.PLUGIN_ID, -1, "The target platform file '" + uri + "' must ends with '.tpd' or '.targetplatform' extensions.", null));
    } else {
      Diagnostic diagnostic = doGenerateTargetDefinitionFile(uri, monitor);
      if (diagnostic.getSeverity() >= Diagnostic.WARNING) {
        ret.merge(diagnostic);
      }
    }
    return ret;
  }
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.