Package org.eclipse.emf.common.util

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


          // Validate the contents of the loaded resource.
          //
          for (Iterator j = resource.getContents().iterator(); j.hasNext(); ) {
            EObject eObject = (EObject)j.next();
            Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject);
            if (diagnostic.getSeverity() != Diagnostic.OK) {
              printDiagnostic(diagnostic, "");
            }
          }
        }
        catch (RuntimeException exception) {
View Full Code Here


           "fr.tm.elibel.smartqvt.smartgen.emfimplem.editor",
           0,
           null,
           new Object [] { editingDomain.getResourceSet() });
      for (Iterator i = resourceToDiagnosticMap.values().iterator(); i.hasNext(); ) {
        Diagnostic childDiagnostic = (Diagnostic)i.next();
        if (childDiagnostic.getSeverity() != Diagnostic.OK) {
          diagnostic.add(childDiagnostic);
        }
      }

      int lastEditorPage = getPageCount() - 1;
View Full Code Here

    catch (Exception e) {
      exception = e;
      resource = editingDomain.getResourceSet().getResource(resourceURI, false);
    }

    Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
    if (diagnostic.getSeverity() != Diagnostic.OK) {
      resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
    }
    editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
  }
View Full Code Here

          // Validate the contents of the loaded resource.
          //
          for (Iterator j = resource.getContents().iterator(); j.hasNext(); ) {
            EObject eObject = (EObject)j.next();
            Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject);
            if (diagnostic.getSeverity() != Diagnostic.OK) {
              printDiagnostic(diagnostic, "");
            }
          }
        }
        catch (RuntimeException exception) {
View Full Code Here

   * @generated NOT
   */
  public boolean validateEClassifier_WellFormedInstanceTypeName(EClassifier eClassifier, DiagnosticChain diagnostics, final Map<Object, Object> context)
  {
    String instanceTypeName = eClassifier.getInstanceTypeName();
    Diagnostic typeBuilderDiagnostic =
      instanceTypeName == null ?
        null :
        new EGenericTypeBuilder()
        {
          @Override
          protected BasicDiagnostic createDiagnostic(int severity, String source, int code, String messageKey, Object[] messageSubstitutions, Object[] data)
          {
            return EcoreValidator.this.createDiagnostic(severity, source, code, messageKey, messageSubstitutions, data, context);
          }

          @Override
          protected ResourceLocator getResourceLocator()
          {
            return EcoreValidator.this.getResourceLocator();
          }

          @Override
          protected String getString(String key, Object[] substitutions)
          {
            return EcoreValidator.this.getString(key, substitutions);
          }

          @Override
          protected void report(DiagnosticChain diagnostics, String key, Object[] substitutions, int index)
          {
            EcoreValidator.this.report(diagnostics, key, substitutions, index, context);
          }
        }.parseInstanceTypeName(instanceTypeName);
    String formattedName = null;
    boolean result =
      instanceTypeName != null ?
        typeBuilderDiagnostic.getSeverity() == Diagnostic.OK  &&
          instanceTypeName.equals(formattedName = EcoreUtil.toJavaInstanceTypeName((EGenericType)typeBuilderDiagnostic.getData().get(0))) :
        eClassifier instanceof EClass || eClassifier instanceof EEnum;
    if (!result && diagnostics != null)
    {
      BasicDiagnostic diagnosic =
        createDiagnostic
          (Diagnostic.ERROR,
           DIAGNOSTIC_SOURCE,
           WELL_FORMED_INSTANCE_TYPE_NAME,
           "_UI_EClassifierInstanceTypeNameNotWellFormed_diagnostic",
           new Object[] { getValueLabel(EcorePackage.Literals.ESTRING, instanceTypeName, context) },
           new Object[] { eClassifier },
           context);
      if (typeBuilderDiagnostic != null)
      {
        if (!typeBuilderDiagnostic.getChildren().isEmpty())
        {
          diagnosic.addAll(typeBuilderDiagnostic);
        }
        else if (instanceTypeName != null && formattedName != null)
        {
View Full Code Here

    else
    {
      BasicDiagnostic basicDiagnostic = new BasicDiagnostic();
      for (Resource.Diagnostic resourceDiagnostic : resource.getErrors())
      {
        Diagnostic diagnostic = null;
        if (resourceDiagnostic instanceof Throwable)
        {
          diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic);
        }
        else
        {
          diagnostic = new BasicDiagnostic(
            Diagnostic.ERROR,
            "org.eclipse.emf.ecore.resource",
            0,
            resourceDiagnostic.getMessage(),
            new Object[]{resourceDiagnostic});
        }
        basicDiagnostic.add(diagnostic);
      }
     
      if (includeWarnings)
      {
        for (Resource.Diagnostic resourceDiagnostic : resource.getWarnings())
        {
          Diagnostic diagnostic = null;
          if (resourceDiagnostic instanceof Throwable)
          {
            diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic);
          }
          else
View Full Code Here

    catch (Exception e) {
      exception = e;
      resource = editingDomain.getResourceSet().getResource(resourceURI, false);
    }

    Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
    if (diagnostic.getSeverity() != Diagnostic.OK) {
      resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
    }
    editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
  }
View Full Code Here

    catch (Exception e) {
      exception = e;
      resource = editingDomain.getResourceSet().getResource(resourceURI, false);
    }

    Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
    if (diagnostic.getSeverity() != Diagnostic.OK) {
      resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
    }
    editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
  }
View Full Code Here

    catch (Exception e) {
      exception = e;
      resource = editingDomain.getResourceSet().getResource(resourceURI, false);
    }

    Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
    if (diagnostic.getSeverity() != Diagnostic.OK) {
      resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
    }
    editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
  }
View Full Code Here

    catch (Exception e) {
      exception = e;
      resource = editingDomain.getResourceSet().getResource(resourceURI, false);
    }

    Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
    if (diagnostic.getSeverity() != Diagnostic.OK) {
      resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
    }
    editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.util.Diagnostic

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.