本文整理匯總了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;
}
示例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());
}
示例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);
}
示例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);
}