當前位置: 首頁>>代碼示例>>Java>>正文


Java EValidator.validate方法代碼示例

本文整理匯總了Java中org.eclipse.emf.ecore.EValidator.validate方法的典型用法代碼示例。如果您正苦於以下問題:Java EValidator.validate方法的具體用法?Java EValidator.validate怎麽用?Java EValidator.validate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.emf.ecore.EValidator的用法示例。


在下文中一共展示了EValidator.validate方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: validate

import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
@Override
public boolean validate ( final EObject eObject, final DiagnosticChain diagnostics, final Map<Object, Object> context )
{
    boolean result = true;
    for ( final EValidator v : this.otherValidators )
    {
        if ( !v.validate ( eObject, diagnostics, context ) )
        {
            result = false;
        }
    }

    ValidationPlugin.runValidation ( eObject, diagnostics, context );

    return result;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:17,代碼來源:ExtensibleValidator.java

示例2: testBug_279962

import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
@Test public void testBug_279962() {
	EValidator validator = registry.getEValidator(pack);
	assertTrue(validator instanceof CompositeEValidator);
	CompositeEValidator composite = (CompositeEValidator) validator;
	
	int prevSize = composite.getContents().size();
	
	get(Val_279962_01.class);
	get(Val_279962_04.class);
	assertEquals(prevSize + 2, composite.getContents().size());
	assertNotNull(validator);
	Resource resource = get(XtextResource.class);
	Model model = EnumRulesTestLanguageFactory.eINSTANCE.createModel();
	resource.getContents().add(model);
	// do not expect an exception
	validator.validate(model, new BasicDiagnostic(), null);
	assertEquals(prevSize + 4, composite.getContents().size());
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:19,代碼來源:AbstractCompositeValidatorTest.java

示例3: catalogValidates

import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
/**
 * Catalog validates.
 *
 * @param catalog
 *          the catalog
 * @return true, if successful
 */
private boolean catalogValidates(final CheckCatalog catalog) {
  EValidator.Registry eValidatorRegistry = EValidator.Registry.INSTANCE;
  EValidator eValidator = eValidatorRegistry.getEValidator(catalog.eClass().getEPackage());
  BasicDiagnostic diag = new BasicDiagnostic();
  eValidator.validate(catalog, diag, Maps.newHashMap());
  Iterable<Diagnostic> children = diag.getChildren();
  Iterable<Diagnostic> errors = Iterables.filter(children, new Predicate<Diagnostic>() {
    @Override
    public boolean apply(final Diagnostic input) {
      return input.getSeverity() == Diagnostic.ERROR;
    }
  });
  return Iterables.isEmpty(errors);
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:22,代碼來源:CheckExtensionGenerator.java

示例4: doValidate

import org.eclipse.emf.ecore.EValidator; //導入方法依賴的package包/類
/**
 * @since 2.9
 */
protected boolean doValidate(EValidator eValidator, EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context)
{
  return eValidator.validate(eClass, eObject, diagnostics, context);
}
 
開發者ID:LangleyStudios,項目名稱:eclipse-avro,代碼行數:8,代碼來源:Diagnostician.java


注:本文中的org.eclipse.emf.ecore.EValidator.validate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。