Java Code Examples for org.eclipse.emf.ecore.util.EObjectValidator

The following are top voted examples for showing how to use org.eclipse.emf.ecore.util.EObjectValidator. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: time4sys   File: SchedulingPolicyImpl.java   View source code 6 votes vote down vote up
/**
 * @generated NOT
 */
public boolean hasValidPolicy(DiagnosticChain diagnostics, Map<?, ?> context) {
	if (policy != null && policy == SchedPolicyKind.OTHER
			&& (otherSchedPolicy == null || otherSchedPolicy.isEmpty())) {
		if (diagnostics != null) {
			diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR, GrmValidator.DIAGNOSTIC_SOURCE,
					GrmValidator.SCHEDULING_POLICY__HAS_VALID_POLICY,

					GrmValidator.INSTANCE.getResourceLocator().getString("_UI_SchedPolicyInvariant_diagnostic",
							new Object[] { "hasValidPolicy",
									EObjectValidator.getObjectLabel(this, (Map<Object, Object>) context) }),

					new Object[] { this }));
		}
		return false;
	}
	return true;
}
 
Example 2
Project: xtext-extras   File: AbstractTypeProviderTest.java   View source code 6 votes vote down vote up
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);
		}
	}
}
 
Example 3
Project: xtext-extras   File: AbstractTypeProviderTest.java   View source code 6 votes vote down vote up
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);
		}
	}
}
 
Example 4
Project: SecureBPMN   File: PlaneImpl.java   View source code 6 votes vote down vote up
/**
 * <!-- 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;
}
 
Example 5
Project: SecureBPMN   File: FontImpl.java   View source code 6 votes vote down vote up
/**
 * <!-- 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;
}
 
Example 6
Project: RCP-Demo-Application   File: PersonImpl.java   View source code 6 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
public boolean hasName(DiagnosticChain chain, Map<?, ?> 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 (chain != null) {
			chain.add
				(new BasicDiagnostic
					(Diagnostic.ERROR,
					 DemomodelValidator.DIAGNOSTIC_SOURCE,
					 DemomodelValidator.PERSON__HAS_NAME,
					 EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "hasName", EObjectValidator.getObjectLabel(this, (Map<Object, Object>) context) }),
					 new Object [] { this }));
		}
		return false;
	}
	return true;
}
 
Example 7
Project: fixflow   File: PlaneImpl.java   View source code 6 votes vote down vote up
/**
 * <!-- 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;
}
 
Example 8
Project: fixflow   File: FontImpl.java   View source code 6 votes vote down vote up
/**
 * <!-- 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;
}
 
Example 9
Project: eclipse-avro   File: EValidatorRegistryImpl.java   View source code 5 votes vote down vote up
protected Object delegatedGet(Object key)
{
  if (delegateRegistry != null)
  {
    return delegateRegistry.get(key);
  }

  return key == null ? EObjectValidator.INSTANCE : null;
}
 
Example 10
Project: clickwatch   File: EValidatorRegistryImpl.java   View source code 5 votes vote down vote up
protected Object delegatedGet(Object key)
{
  if (delegateRegistry != null)
  {
    return delegateRegistry.get(key);
  }

  return key == null ? EObjectValidator.INSTANCE : null;
}
 
Example 11
Project: xtext-extras   File: AbstractTypeProviderTest.java   View source code 4 votes vote down vote up
@Before
public void setUp() throws Exception {
	EValidator.Registry registry = new EValidatorRegistryImpl(EValidator.Registry.INSTANCE);
	registry.put(TypesPackage.eINSTANCE, new EObjectValidator());
	diagnostician = new Diagnostician(registry);
}
 
Example 12
Project: xtext-extras   File: AbstractTypeProviderTest.java   View source code 4 votes vote down vote up
@Before
public void setUp() throws Exception {
	EValidator.Registry registry = new EValidatorRegistryImpl(EValidator.Registry.INSTANCE);
	registry.put(TypesPackage.eINSTANCE, new EObjectValidator());
	diagnostician = new Diagnostician(registry);
}