* @generated NOT
*/
public boolean validateEClassifier_WellFormedInstanceTypeName(EClassifier eClassifier, DiagnosticChain diagnostics, final Map<Object, Object> context)
{
String instanceTypeName = eClassifier.getInstanceTypeName();
Diagnostic typeBuilderDiagnostic =
instanceTypeName == null ?
null :
new EGenericTypeBuilder()
{
@Override
protected BasicDiagnostic createDiagnostic(int severity, String source, int code, String messageKey, Object[] messageSubstitutions, Object[] data)
{
return EcoreValidator.this.createDiagnostic(severity, source, code, messageKey, messageSubstitutions, data, context);
}
@Override
protected ResourceLocator getResourceLocator()
{
return EcoreValidator.this.getResourceLocator();
}
@Override
protected String getString(String key, Object[] substitutions)
{
return EcoreValidator.this.getString(key, substitutions);
}
@Override
protected void report(DiagnosticChain diagnostics, String key, Object[] substitutions, int index)
{
EcoreValidator.this.report(diagnostics, key, substitutions, index, context);
}
}.parseInstanceTypeName(instanceTypeName);
String formattedName = null;
boolean result =
instanceTypeName != null ?
typeBuilderDiagnostic.getSeverity() == Diagnostic.OK &&
instanceTypeName.equals(formattedName = EcoreUtil.toJavaInstanceTypeName((EGenericType)typeBuilderDiagnostic.getData().get(0))) :
eClassifier instanceof EClass || eClassifier instanceof EEnum;
if (!result && diagnostics != null)
{
BasicDiagnostic diagnosic =
createDiagnostic
(Diagnostic.ERROR,
DIAGNOSTIC_SOURCE,
WELL_FORMED_INSTANCE_TYPE_NAME,
"_UI_EClassifierInstanceTypeNameNotWellFormed_diagnostic",
new Object[] { getValueLabel(EcorePackage.Literals.ESTRING, instanceTypeName, context) },
new Object[] { eClassifier },
context);
if (typeBuilderDiagnostic != null)
{
if (!typeBuilderDiagnostic.getChildren().isEmpty())
{
diagnosic.addAll(typeBuilderDiagnostic);
}
else if (instanceTypeName != null && formattedName != null)
{