下面列出了怎么用org.eclipse.emf.ecore.util.EObjectValidator的API类实例代码及写法,或者点击链接到github查看源代码。
protected void diagnose(Diagnostic diagnostic, URI[] expectedUnresolvedProxies) {
if (diagnostic.getChildren().isEmpty()) {
if (diagnostic.getSeverity() != Diagnostic.OK) {
if (diagnostic.getCode() == EObjectValidator.EOBJECT__EVERY_PROXY_RESOLVES) {
EObject proxy = (EObject) diagnostic.getData().get(2); // magic number ...
if (org.eclipse.xtext.util.Arrays.contains(expectedUnresolvedProxies, EcoreUtil.getURI(proxy))) {
return;
}
}
assertEquals(String.valueOf(diagnostic), diagnostic.getSeverity() == Diagnostic.OK);
}
} else {
for (Diagnostic child : diagnostic.getChildren()) {
diagnose(child, expectedUnresolvedProxies);
}
}
}
protected void diagnose(Diagnostic diagnostic, URI[] expectedUnresolvedProxies) {
if (diagnostic.getChildren().isEmpty()) {
if (diagnostic.getSeverity() != Diagnostic.OK) {
if (diagnostic.getCode() == EObjectValidator.EOBJECT__EVERY_PROXY_RESOLVES) {
EObject proxy = (EObject) diagnostic.getData().get(2); // magic number ...
if (org.eclipse.xtext.util.Arrays.contains(expectedUnresolvedProxies, EcoreUtil.getURI(proxy))) {
return;
}
}
assertEquals(String.valueOf(diagnostic), diagnostic.getSeverity() == Diagnostic.OK);
}
} else {
for (Diagnostic child : diagnostic.getChildren()) {
diagnose(child, expectedUnresolvedProxies);
}
}
}
protected void diagnose(Diagnostic diagnostic, URI[] expectedUnresolvedProxies) {
if (diagnostic.getChildren().isEmpty()) {
if (diagnostic.getSeverity() != Diagnostic.OK) {
if (diagnostic.getCode() == EObjectValidator.EOBJECT__EVERY_PROXY_RESOLVES) {
EObject proxy = (EObject) diagnostic.getData().get(2); // magic number ...
if (org.eclipse.xtext.util.Arrays.contains(expectedUnresolvedProxies, EcoreUtil.getURI(proxy))) {
return;
}
}
assertEquals(String.valueOf(diagnostic), diagnostic.getSeverity() == Diagnostic.OK);
}
} else {
for (Diagnostic child : diagnostic.getChildren()) {
diagnose(child, expectedUnresolvedProxies);
}
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean plane_element_type(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR,
DiValidator.DIAGNOSTIC_SOURCE, DiValidator.PLANE__PLANE_ELEMENT_TYPE,
EcorePlugin.INSTANCE.getString(
"_UI_GenericInvariant_diagnostic",
new Object[] { "plane_element_type",
EObjectValidator.getObjectLabel(this, context) }),
new Object[] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean non_negative_size(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR,
DcValidator.DIAGNOSTIC_SOURCE, DcValidator.FONT__NON_NEGATIVE_SIZE,
EcorePlugin.INSTANCE.getString(
"_UI_GenericInvariant_diagnostic",
new Object[] { "non_negative_size",
EObjectValidator.getObjectLabel(this, context) }),
new Object[] { this }));
}
return false;
}
return true;
}
@Before
public void setUp() throws Exception {
EValidator.Registry registry = new EValidatorRegistryImpl(EValidator.Registry.INSTANCE);
registry.put(TypesPackage.eINSTANCE, new EObjectValidator());
diagnostician = new Diagnostician(registry);
}
@Before
public void setUp() throws Exception {
EValidator.Registry registry = new EValidatorRegistryImpl(EValidator.Registry.INSTANCE);
registry.put(TypesPackage.eINSTANCE, new EObjectValidator());
diagnostician = new Diagnostician(registry);
}
@Before
public void setUp() throws Exception {
EValidator.Registry registry = new EValidatorRegistryImpl(EValidator.Registry.INSTANCE);
registry.put(TypesPackage.eINSTANCE, new EObjectValidator());
diagnostician = new Diagnostician(registry);
}