public List<Diagnostic> getChildren() { return diagnostic.getChildren(); }
public boolean isMultiStatus() { return !diagnostic.getChildren().isEmpty(); }
public Diagnostic next() { Diagnostic d = iteratorStack.get(iteratorStack.size() - 1).next(); if (d.getChildren().size() > 0) iteratorStack.add(d.getChildren().iterator()); return d; }
public DiagnosticTreeIterator(Diagnostic root) { super(); iteratorStack.add(root.getChildren().iterator()); }
public DiagnosticTreeIterator(Diagnostic root) { super(); iteratorStack.add(root.getChildren().iterator()); }
@Override public Diagnostic next() { Diagnostic d = iteratorStack.get(iteratorStack.size() - 1).next(); if (d.getChildren().size() > 0) iteratorStack.add(d.getChildren().iterator()); return d; }
public Diagnostic next() { Diagnostic d = iteratorStack.get(iteratorStack.size() - 1).next(); if (d.getChildren().size() > 0) iteratorStack.add(d.getChildren().iterator()); return d; }
public DiagnosticTreeIterator(Diagnostic root) { super(); iteratorStack.add(root.getChildren().iterator()); }
public void assertOK() { if (diag.getChildren().size() != 0) fail("There are expected to be no diagnostics."); }
@Override public String toString() { StringBuffer b = new StringBuffer(); for (Diagnostic d : diag.getChildren()) printDiagnostic(b, "", d); return b.toString(); } }
public void assertOK() { if (diag.getChildren().size() != 0) fail("There are expected to be no diagnostics."); }
@Override public String toString() { StringBuffer b = new StringBuffer(); for (Diagnostic d : diag.getChildren()) printDiagnostic(b, "", d); return b.toString(); } }
@Override public String toString() { StringBuffer b = new StringBuffer(); for (Diagnostic d : diag.getChildren()) printDiagnostic(b, "", d); return b.toString(); } }
public void addAll(Diagnostic diagnostic) { for (Diagnostic child : diagnostic.getChildren()) { add(child); } }
public void assertOK() { if (diag.getChildren().size() != 0) fail("There are expected to be no diagnostics."); }
private static void processDiagnostic(Diagnostic diagnostic, ValidationHandler handler) { Queue<Diagnostic> queue = new LinkedList<Diagnostic>(); queue.add(diagnostic); // root while (!queue.isEmpty()) { Diagnostic d = queue.remove(); if (shouldHandle(d)) { handleDiagnostic(d, handler); // visit } for (Diagnostic childDiagnostic : d.getChildren()) { // process successors queue.add(childDiagnostic); } } }
public IStatus[] getChildren() { if (wrappedChildren == null) { List<Diagnostic> children = diagnostic.getChildren(); if (children.isEmpty()) { wrappedChildren = EMPTY_CHILDREN; } else { wrappedChildren = new IStatus [children.size()]; for (int i = 0; i < wrappedChildren.length; ++i) { wrappedChildren[i] = toIStatus(children.get(i)); } } } return wrappedChildren; }
public void merge(Diagnostic diagnostic) { if (diagnostic.getChildren().isEmpty()) { add(diagnostic); } else { addAll(diagnostic); } }
public static int computeActionCode(Diagnostic diagnostic) { if (ConverterPlugin.ID.equals(diagnostic.getSource())) { int actionCode = diagnostic.getCode(); for (Diagnostic child : diagnostic.getChildren()) { actionCode |= computeActionCode(child); } return actionCode; } else { return ACTION_DEFAULT; } }
private void propageValidationResult(Diagnostic diagnostic, GeneratedMetamodel metamodel, ValidationMessageAcceptor acceptor) { if (diagnostic.getSeverity() != Diagnostic.OK) { if (diagnostic.getCode() != 0) { List<?> data = diagnostic.getData(); if (!data.isEmpty() && data.get(0) instanceof EObject) { doPropagateValidationResult(diagnostic, metamodel, acceptor); } } for(Diagnostic child: diagnostic.getChildren()) propageValidationResult(child, metamodel, acceptor); } }