当前位置: 首页>>代码示例>>Java>>正文


Java Diagnostic.getChildren方法代码示例

本文整理汇总了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 () );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:29,代码来源:ExporterProcessor.java

示例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$
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:18,代码来源:ChartExample.java

示例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;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:18,代码来源:OcciHelper.java

示例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 + "  ");
	}
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:16,代码来源:OCCIExample.java


注:本文中的org.eclipse.emf.common.util.Diagnostic.getChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。