本文整理汇总了Java中org.eclipse.emf.common.util.Diagnostic.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java Diagnostic.getChildren方法的具体用法?Java Diagnostic.getChildren怎么用?Java Diagnostic.getChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.common.util.Diagnostic
的用法示例。
在下文中一共展示了Diagnostic.getChildren方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateDevice
import org.eclipse.emf.common.util.Diagnostic; //导入方法依赖的package包/类
/**
* Validates a object instance and its children using the EMF core validator
* API.
*
* @param element
* the element to validate
* @param label
* the type label of the element
* @throws IllegalStateException
* if validation errors are encountered
*/
protected static void validateDevice ( final EObject object, final String label )
{
final Diagnostic diag = Diagnostician.INSTANCE.validate ( object );
if ( diag.getSeverity () == Diagnostic.ERROR )
{
final StringBuilder sb = new StringBuilder ( "Invalid " + label );
for ( final Diagnostic child : diag.getChildren () )
{
if ( child.getSeverity () == Diagnostic.ERROR )
{
sb.append ( System.lineSeparator () );
sb.append ( child.getMessage () );
}
}
throw new IllegalStateException ( sb.toString () );
}
}
示例2: printDiagnostic
import org.eclipse.emf.common.util.Diagnostic; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* Prints diagnostics with indentation.
* <!-- end-user-doc -->
* @param diagnostic the diagnostic to print.
* @param indent the indentation for printing.
* @generated
*/
protected static void printDiagnostic ( Diagnostic diagnostic, String indent )
{
System.out.print ( indent );
System.out.println ( diagnostic.getMessage () );
for ( Diagnostic child : diagnostic.getChildren () )
{
printDiagnostic ( child, indent + " " ); //$NON-NLS-1$
}
}
示例3: printDiagnostic
import org.eclipse.emf.common.util.Diagnostic; //导入方法依赖的package包/类
/**
* Print an EMF validation diagnostic.
*
* @param diagnostic
* @param indent
* @param stringBuffer
* @return
*/
private static StringBuffer printDiagnostic(Diagnostic diagnostic, String indent, StringBuffer stringBuffer) {
stringBuffer.append(indent);
stringBuffer.append(diagnostic.getMessage());
stringBuffer.append("\n");
for (Diagnostic child : diagnostic.getChildren()) {
printDiagnostic(child, indent + " ", stringBuffer);
}
return stringBuffer;
}
示例4: printDiagnostic
import org.eclipse.emf.common.util.Diagnostic; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* Prints diagnostics with indentation.
* <!-- end-user-doc -->
* @param diagnostic the diagnostic to print.
* @param indent the indentation for printing.
* @generated
*/
protected static void printDiagnostic(Diagnostic diagnostic, String indent) {
System.out.print(indent);
System.out.println(diagnostic.getMessage());
for (Diagnostic child : diagnostic.getChildren()) {
printDiagnostic(child, indent + " ");
}
}