stringBuffer.append(TEXT_405);
stringBuffer.append(TEXT_415);
  public String generate(Object argument)  {    StringBuffer stringBuffer = new StringBuffer();    /** * <copyright> * * Copyright (c) 2002-2005 IBM Corporation and others. * All rights reserved.   This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: *   IBM - Initial API and implementation * * </copyright> */    GenPackage genPackage = (GenPackage)argument; GenModel genModel=genPackage.getGenModel();    stringBuffer.append(TEXT_1);    stringBuffer.append(TEXT_2);    stringBuffer.append("$");    stringBuffer.append(TEXT_3);    stringBuffer.append("$");    stringBuffer.append(TEXT_4);    stringBuffer.append(genPackage.getUtilitiesPackageName());    stringBuffer.append(TEXT_5);    genModel.addImport("java.util.Map");    genModel.addImport("org.eclipse.emf.common.util.DiagnosticChain");    genModel.addImport("org.eclipse.emf.ecore.EPackage");    if (!genPackage.hasJavaLangConflict() && !genPackage.getUtilitiesPackageName().equals(genPackage.getInterfacePackageName())) genModel.addImport(genPackage.getInterfacePackageName() + ".*");    genModel.markImportLocation(stringBuffer);    genModel.addPseudoImport("org.eclipse.emf.ecore.EValidator.Registry");    genModel.addPseudoImport("org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider");    genModel.addPseudoImport("org.eclipse.emf.ecore.EValidator.PatternMatcher");    stringBuffer.append(TEXT_6);    stringBuffer.append(genPackage.getQualifiedPackageInterfaceName());    stringBuffer.append(TEXT_7);    stringBuffer.append(genPackage.getValidatorClassName());    stringBuffer.append(TEXT_8);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.EObjectValidator"));    stringBuffer.append(TEXT_9);    if (genModel.getCopyrightText() != null) {    stringBuffer.append(TEXT_10);    stringBuffer.append(genModel.getImportedName("java.lang.String"));    stringBuffer.append(TEXT_11);    stringBuffer.append(genModel.getCopyrightText());    stringBuffer.append(TEXT_12);    stringBuffer.append(genModel.getNonNLS());    stringBuffer.append(TEXT_13);    }    stringBuffer.append(TEXT_14);    stringBuffer.append(genPackage.getValidatorClassName());    stringBuffer.append(TEXT_15);    stringBuffer.append(genPackage.getValidatorClassName());    stringBuffer.append(TEXT_16);    stringBuffer.append(genPackage.getInterfacePackageName());    stringBuffer.append(TEXT_17);    stringBuffer.append(genModel.getNonNLS());    stringBuffer.append(TEXT_18);    int count = 0; for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();    for (Iterator j=genClass.getInvariantOperations().iterator(); j.hasNext();) { GenOperation genOperation = (GenOperation)j.next();    stringBuffer.append(TEXT_19);    stringBuffer.append(genOperation.getFormattedName());    stringBuffer.append(TEXT_20);    stringBuffer.append(genClass.getFormattedName());    stringBuffer.append(TEXT_21);    stringBuffer.append(genClass.getOperationID(genOperation));    stringBuffer.append(TEXT_22);    stringBuffer.append(++count);    stringBuffer.append(TEXT_23);    }}    stringBuffer.append(TEXT_24);    stringBuffer.append(count);    stringBuffer.append(TEXT_25);    for (Iterator i = genPackage.getAllValidatorBaseGenPackages().iterator(); i.hasNext(); ) { GenPackage baseGenPackage = (GenPackage)i.next();     stringBuffer.append(TEXT_26);    stringBuffer.append(baseGenPackage.getImportedValidatorClassName());    stringBuffer.append(TEXT_27);    stringBuffer.append(genPackage.getValidatorPackageUniqueSafeName(baseGenPackage));    stringBuffer.append(TEXT_28);    }    stringBuffer.append(TEXT_29);    stringBuffer.append(genPackage.getValidatorClassName());    stringBuffer.append(TEXT_30);    for (Iterator i = genPackage.getAllValidatorBaseGenPackages().iterator(); i.hasNext(); ) { GenPackage baseGenPackage = (GenPackage)i.next();     stringBuffer.append(TEXT_31);    stringBuffer.append(genPackage.getValidatorPackageUniqueSafeName(baseGenPackage));    stringBuffer.append(TEXT_32);    stringBuffer.append(baseGenPackage.getImportedValidatorClassName());    stringBuffer.append(TEXT_33);    }    stringBuffer.append(TEXT_34);    stringBuffer.append(genPackage.getImportedPackageInterfaceName());    stringBuffer.append(TEXT_35);    for (Iterator i=genPackage.getGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next();    stringBuffer.append(TEXT_36);    stringBuffer.append(genPackage.getImportedPackageInterfaceName());    stringBuffer.append(TEXT_37);    stringBuffer.append(genPackage.getClassifierID(genClassifier));    stringBuffer.append(TEXT_38);    if (genClassifier instanceof GenDataType) { GenDataType genDataType = (GenDataType)genClassifier;    if (genDataType.isPrimitiveType()) {    stringBuffer.append(TEXT_39);    stringBuffer.append(genDataType.getName());    stringBuffer.append(TEXT_40);    stringBuffer.append(genDataType.getObjectInstanceClassName());    stringBuffer.append(TEXT_41);    stringBuffer.append(genDataType.getPrimitiveValueFunction());    stringBuffer.append(TEXT_42);    } else if (genDataType.isObjectType()) {    stringBuffer.append(TEXT_43);    stringBuffer.append(genDataType.getName());    stringBuffer.append(TEXT_44);    } else {    stringBuffer.append(TEXT_45);    stringBuffer.append(genDataType.getName());    stringBuffer.append(TEXT_46);    stringBuffer.append(genDataType.getImportedInstanceClassName());    stringBuffer.append(TEXT_47);    }    } else { GenClass genClass = (GenClass)genClassifier;    stringBuffer.append(TEXT_48);    stringBuffer.append(genClass.getName());    stringBuffer.append(TEXT_49);    stringBuffer.append(genClass.getImportedInterfaceName());    stringBuffer.append(TEXT_50);    }    }    stringBuffer.append(TEXT_51);    for (Iterator i=genPackage.getGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next(); String result = "result".equals(genClassifier.getSafeUncapName()) ? "theResult" : "result"; String diagnostics = "diagnostics".equals(genClassifier.getSafeUncapName()) ? "theDiagnostics" : "diagnostics"; String item = "item".equals(genClassifier.getSafeUncapName()) ? "theItem" : "item"; String context = "context".equals(genClassifier.getSafeUncapName()) ? "theContext" : "context";    stringBuffer.append(TEXT_52);    stringBuffer.append(genClassifier.getName());    stringBuffer.append(TEXT_53);    stringBuffer.append(genClassifier.getImportedInstanceClassName());    stringBuffer.append(TEXT_54);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_55);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_56);    stringBuffer.append(context);    stringBuffer.append(TEXT_57);    if (genClassifier.getAllGenConstraints().isEmpty()) {    stringBuffer.append(TEXT_58);    } else if (genClassifier.hasOnlyDefaultConstraints()) {    stringBuffer.append(TEXT_59);    if (!((GenClass)genClassifier).isEObjectExtension()){    stringBuffer.append(TEXT_60);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EObject"));    stringBuffer.append(TEXT_61);    }    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_62);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_63);    stringBuffer.append(context);    stringBuffer.append(TEXT_64);    } else { boolean first = true;    for (Iterator j=genClassifier.getAllGenConstraints().iterator(); j.hasNext(); ) { String constraint = (String)j.next();   GenClassifier constraintImplementor = genClassifier.getConstraintImplementor(constraint);   String delegate = constraintImplementor == null || constraintImplementor.getGenPackage() == genPackage ? "" : genPackage.getValidatorPackageUniqueSafeName(constraintImplementor.getGenPackage()) + "Validator.";   String cast = constraintImplementor == null && genClassifier instanceof GenClass && !((GenClass)genClassifier).isEObjectExtension() ? "(" + genModel.getImportedName("org.eclipse.emf.ecore.EObject") + ")" : "";  String accessor = constraintImplementor != null && genClassifier instanceof GenDataType && !((GenDataType)genClassifier).isPrimitiveType() && ((GenDataType)constraintImplementor).isPrimitiveType() ? "." + ((GenDataType)constraintImplementor).getPrimitiveValueFunction() + "()" : "";    if (first) { first = false;    stringBuffer.append(TEXT_65);    stringBuffer.append(result);    stringBuffer.append(TEXT_66);    stringBuffer.append(delegate);    stringBuffer.append(TEXT_67);    stringBuffer.append(constraintImplementor == null ? "" : constraintImplementor.getName());    stringBuffer.append(TEXT_68);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_69);    stringBuffer.append(cast);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(accessor);    stringBuffer.append(TEXT_70);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_71);    stringBuffer.append(context);    stringBuffer.append(TEXT_72);    } else {    stringBuffer.append(TEXT_73);    stringBuffer.append(result);    stringBuffer.append(TEXT_74);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_75);    stringBuffer.append(delegate);    stringBuffer.append(TEXT_76);    stringBuffer.append(constraintImplementor == null ? "" : constraintImplementor.getName());    stringBuffer.append(TEXT_77);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_78);    stringBuffer.append(cast);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(accessor);    stringBuffer.append(TEXT_79);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_80);    stringBuffer.append(context);    stringBuffer.append(TEXT_81);    }    }    stringBuffer.append(TEXT_82);    stringBuffer.append(result);    stringBuffer.append(TEXT_83);    }    stringBuffer.append(TEXT_84);    for (Iterator j=genClassifier.getGenConstraints().iterator(); j.hasNext();) { String constraint = (String)j.next();  GenClassifier constraintDelegate = genClassifier.getConstraintDelegate(constraint);   String constant = genClassifier.getClassifierID() + "__" + CodeGenUtil.format(constraint, '_', null, false, false).toUpperCase();  String delegate = constraintDelegate == null || constraintDelegate.getGenPackage() == genPackage ? "" : genPackage.getValidatorPackageUniqueSafeName(constraintDelegate.getGenPackage()) + "Validator.";   String cast = constraintDelegate == null && genClassifier instanceof GenClass && !((GenClass)genClassifier).isEObjectExtension() ? "(" + genModel.getImportedName("org.eclipse.emf.ecore.EObject") + ")" : "";  String accessor = constraintDelegate != null && genClassifier instanceof GenDataType && !((GenDataType)genClassifier).isPrimitiveType() && ((GenDataType)constraintDelegate).isPrimitiveType() ? "." + ((GenDataType)constraintDelegate).getPrimitiveValueFunction() + "()" : "";    if (genClassifier instanceof GenDataType) { GenDataType genDataType = (GenDataType)genClassifier;    if (constraint.equals("Min") && genDataType.getMinLiteral() != null) {    stringBuffer.append(TEXT_85);    stringBuffer.append(genDataType.getName());    stringBuffer.append(TEXT_86);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_87);    stringBuffer.append(genDataType.getImportedInstanceClassName());    stringBuffer.append(TEXT_88);    stringBuffer.append(constant);    stringBuffer.append(TEXT_89);    stringBuffer.append(genDataType.getStaticValue(genDataType.getMinLiteral()));    stringBuffer.append(TEXT_90);    } else if (constraint.equals("Max") && genDataType.getMaxLiteral() != null) {    stringBuffer.append(TEXT_91);    stringBuffer.append(genDataType.getName());    stringBuffer.append(TEXT_92);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_93);    stringBuffer.append(genDataType.getImportedInstanceClassName());    stringBuffer.append(TEXT_94);    stringBuffer.append(constant);    stringBuffer.append(TEXT_95);    stringBuffer.append(genDataType.getStaticValue(genDataType.getMaxLiteral()));    stringBuffer.append(TEXT_96);    } else if (constraint.equals("TotalDigits") && genDataType.getTotalDigits() != -1 && !"java.math.BigDecimal".equals(genDataType.getQualifiedInstanceClassName())) { String value = "1"; for (int digitCount = genDataType.getTotalDigits(); digitCount > 0; --digitCount) value += "0";     stringBuffer.append(TEXT_97);    stringBuffer.append(genDataType.getName());    stringBuffer.append(TEXT_98);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_99);    stringBuffer.append(genDataType.getImportedInstanceClassName());    stringBuffer.append(TEXT_100);    stringBuffer.append(constant);    stringBuffer.append(TEXT_101);    stringBuffer.append(genDataType.getStaticValue(value));    stringBuffer.append(TEXT_102);    stringBuffer.append(genDataType.getName());    stringBuffer.append(TEXT_103);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_104);    stringBuffer.append(genDataType.getImportedInstanceClassName());    stringBuffer.append(TEXT_105);    stringBuffer.append(constant);    stringBuffer.append(TEXT_106);    stringBuffer.append(genDataType.getStaticValue("-" + value));    stringBuffer.append(TEXT_107);    } else if (constraint.equals("Pattern") && !genDataType.getPatterns().isEmpty()) {    stringBuffer.append(TEXT_108);    stringBuffer.append(genDataType.getName());    stringBuffer.append(TEXT_109);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_110);    stringBuffer.append(constant);    stringBuffer.append(TEXT_111);    for (Iterator k = genDataType.getPatterns().iterator(); k.hasNext(); ) { List patternList = (List)k.next();    stringBuffer.append(TEXT_112);    for (Iterator p = patternList.iterator(); p.hasNext(); ) { String pattern = (String)p.next();    stringBuffer.append(TEXT_113);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil"));    stringBuffer.append(TEXT_114);    stringBuffer.append(pattern);    stringBuffer.append(TEXT_115);    stringBuffer.append(p.hasNext() ? "," : "");    }    stringBuffer.append(TEXT_116);    stringBuffer.append(k.hasNext() ? "," : "");    }    stringBuffer.append(TEXT_117);    } else if (constraint.equals("Enumeration") && !genDataType.getEnumerationLiterals().isEmpty()) {    stringBuffer.append(TEXT_118);    stringBuffer.append(genDataType.getName());    stringBuffer.append(TEXT_119);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_120);    stringBuffer.append(genModel.getImportedName("java.util.Collection"));    stringBuffer.append(TEXT_121);    stringBuffer.append(constant);    stringBuffer.append(TEXT_122);    for (Iterator k = genDataType.getEnumerationLiterals().iterator(); k.hasNext(); ) { String literal = (String)k.next();    stringBuffer.append(TEXT_123);    if (genDataType.isPrimitiveType()) {    stringBuffer.append(TEXT_124);    stringBuffer.append(genDataType.getObjectInstanceClassName());    stringBuffer.append(TEXT_125);    }    stringBuffer.append(genDataType.getStaticValue(literal));    if (genDataType.isPrimitiveType()) {    stringBuffer.append(TEXT_126);    }    stringBuffer.append(k.hasNext() ? "," : "");    }    stringBuffer.append(TEXT_127);    }    }    stringBuffer.append(TEXT_128);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_129);    stringBuffer.append(genClassifier.getFormattedName());    stringBuffer.append(TEXT_130);    stringBuffer.append(genClassifier.getName());    stringBuffer.append(TEXT_131);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_132);    stringBuffer.append(genClassifier.getImportedInstanceClassName());    stringBuffer.append(TEXT_133);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_134);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_135);    stringBuffer.append(context);    stringBuffer.append(TEXT_136);    if (genClassifier instanceof GenDataType) { GenDataType genDataType = (GenDataType)genClassifier;    if (constraint.equals("ItemType") && genDataType.getItemType() != null) { GenDataType itemType = genDataType.getItemType(); String itemDelegate = itemType.getGenPackage() == genPackage ? "" : genPackage.getValidatorPackageUniqueSafeName(itemType.getGenPackage()) + "Validator.";    stringBuffer.append(TEXT_137);    stringBuffer.append(result);    stringBuffer.append(TEXT_138);    stringBuffer.append(genModel.getImportedName("java.util.Iterator"));    stringBuffer.append(TEXT_139);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_140);    stringBuffer.append(itemType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_141);    stringBuffer.append(itemDelegate);    stringBuffer.append(TEXT_142);    stringBuffer.append(itemType.getName());    stringBuffer.append(TEXT_143);    if (itemType.isPrimitiveType()) {    stringBuffer.append(TEXT_144);    }    stringBuffer.append(TEXT_145);    stringBuffer.append(itemType.getObjectInstanceClassName());    stringBuffer.append(TEXT_146);    stringBuffer.append(item);    if (itemType.isPrimitiveType()) {    stringBuffer.append(TEXT_147);    stringBuffer.append(itemType.getPrimitiveValueFunction());    stringBuffer.append(TEXT_148);    }    stringBuffer.append(TEXT_149);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_150);    stringBuffer.append(context);    stringBuffer.append(TEXT_151);    stringBuffer.append(itemType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_152);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_153);    stringBuffer.append(context);    stringBuffer.append(TEXT_154);    } else if (constraint.equals("MemberTypes") && !genDataType.getMemberTypes().isEmpty()) {    stringBuffer.append(TEXT_155);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicDiagnostic"));    stringBuffer.append(TEXT_156);    for (ListIterator k = genDataType.getMemberTypes().listIterator(); k.hasNext(); ) { GenDataType memberType = (GenDataType)k.next(); String memberDelegate = memberType.getGenPackage() == genPackage ? "" : genPackage.getValidatorPackageUniqueSafeName(memberType.getGenPackage()) + "Validator.";    stringBuffer.append(TEXT_157);    stringBuffer.append(memberType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_158);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_159);    stringBuffer.append(memberDelegate);    stringBuffer.append(TEXT_160);    stringBuffer.append(memberType.getName());    stringBuffer.append(TEXT_161);    if (memberType.isPrimitiveType()) {    stringBuffer.append(TEXT_162);    }    stringBuffer.append(TEXT_163);    stringBuffer.append(memberType.getObjectInstanceClassName());    stringBuffer.append(TEXT_164);    stringBuffer.append(genClassifier.getSafeUncapName());    if (memberType.isPrimitiveType()) {    stringBuffer.append(TEXT_165);    stringBuffer.append(memberType.getPrimitiveValueFunction());    stringBuffer.append(TEXT_166);    }    stringBuffer.append(TEXT_167);    stringBuffer.append(context);    stringBuffer.append(TEXT_168);    }    stringBuffer.append(TEXT_169);    stringBuffer.append(genModel.getImportedName("java.util.List"));    stringBuffer.append(TEXT_170);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic"));    stringBuffer.append(TEXT_171);    for (ListIterator k = genDataType.getMemberTypes().listIterator(); k.hasNext(); ) { GenDataType memberType = (GenDataType)k.next(); String memberDelegate = memberType.getGenPackage() == genPackage ? "" : genPackage.getValidatorPackageUniqueSafeName(memberType.getGenPackage()) + "Validator.";    stringBuffer.append(TEXT_172);    stringBuffer.append(memberType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_173);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_174);    stringBuffer.append(memberDelegate);    stringBuffer.append(TEXT_175);    stringBuffer.append(memberType.getName());    stringBuffer.append(TEXT_176);    if (memberType.isPrimitiveType()) {    stringBuffer.append(TEXT_177);    }    stringBuffer.append(TEXT_178);    stringBuffer.append(memberType.getObjectInstanceClassName());    stringBuffer.append(TEXT_179);    stringBuffer.append(genClassifier.getSafeUncapName());    if (memberType.isPrimitiveType()) {    stringBuffer.append(TEXT_180);    stringBuffer.append(memberType.getPrimitiveValueFunction());    stringBuffer.append(TEXT_181);    }    stringBuffer.append(TEXT_182);    stringBuffer.append(context);    stringBuffer.append(TEXT_183);    }    stringBuffer.append(TEXT_184);    } else if (constraint.equals("Pattern") && !genDataType.getPatterns().isEmpty()) {    stringBuffer.append(TEXT_185);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_186);    if (genDataType.isPrimitiveType()) {    stringBuffer.append(TEXT_187);    stringBuffer.append(genDataType.getObjectInstanceClassName());    stringBuffer.append(TEXT_188);    }    stringBuffer.append(genDataType.getSafeUncapName());    if (genDataType.isPrimitiveType()) {    stringBuffer.append(TEXT_189);    }    stringBuffer.append(TEXT_190);    stringBuffer.append(constant);    stringBuffer.append(TEXT_191);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_192);    stringBuffer.append(context);    stringBuffer.append(TEXT_193);    } else if (constraint.equals("Enumeration") && !genDataType.getEnumerationLiterals().isEmpty()) { String variable = genDataType.getSafeUncapName();    if (genDataType.isPrimitiveType()) { variable = variable + "Object";    stringBuffer.append(TEXT_194);    stringBuffer.append(genDataType.getObjectInstanceClassName());    stringBuffer.append(TEXT_195);    stringBuffer.append(variable);    stringBuffer.append(TEXT_196);    stringBuffer.append(genDataType.getObjectInstanceClassName());    stringBuffer.append(TEXT_197);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_198);    }    stringBuffer.append(TEXT_199);    stringBuffer.append(result);    stringBuffer.append(TEXT_200);    stringBuffer.append(constant);    stringBuffer.append(TEXT_201);    stringBuffer.append(variable);    stringBuffer.append(TEXT_202);    stringBuffer.append(result);    stringBuffer.append(TEXT_203);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_204);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_205);    stringBuffer.append(variable);    stringBuffer.append(TEXT_206);    stringBuffer.append(constant);    stringBuffer.append(TEXT_207);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_208);    stringBuffer.append(context);    stringBuffer.append(TEXT_209);    stringBuffer.append(result);    stringBuffer.append(TEXT_210);    } else if (constraint.equals("Min") && genDataType.getMinLiteral() != null) {    if (genDataType.isPrimitiveType()) {    stringBuffer.append(TEXT_211);    stringBuffer.append(result);    stringBuffer.append(TEXT_212);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_213);    stringBuffer.append(genDataType.isMinInclusive() ? ">=" : ">");    stringBuffer.append(TEXT_214);    stringBuffer.append(constant);    stringBuffer.append(TEXT_215);    stringBuffer.append(result);    stringBuffer.append(TEXT_216);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_217);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_218);    stringBuffer.append(genDataType.getObjectInstanceClassName());    stringBuffer.append(TEXT_219);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_220);    stringBuffer.append(genDataType.getObjectInstanceClassName());    stringBuffer.append(TEXT_221);    stringBuffer.append(constant);    stringBuffer.append(TEXT_222);    stringBuffer.append(genDataType.isMinInclusive() ? "true" : "false");    stringBuffer.append(TEXT_223);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_224);    stringBuffer.append(context);    stringBuffer.append(TEXT_225);    stringBuffer.append(result);    stringBuffer.append(TEXT_226);    } else { String comparison = "comparison".equals(genClassifier.getSafeUncapName()) ? "theComparison" : "comparison";    if (genDataType.isXMLCalendar()) {    stringBuffer.append(TEXT_227);    stringBuffer.append(comparison);    stringBuffer.append(TEXT_228);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil"));    stringBuffer.append(TEXT_229);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_230);    stringBuffer.append(constant);    stringBuffer.append(TEXT_231);    stringBuffer.append(result);    stringBuffer.append(TEXT_232);    if (genDataType.isMinInclusive()) {    stringBuffer.append(comparison);    stringBuffer.append(TEXT_233);    }    stringBuffer.append(comparison);    stringBuffer.append(TEXT_234);    } else if (genDataType.isXMLDuration()) {    stringBuffer.append(TEXT_235);    stringBuffer.append(comparison);    stringBuffer.append(TEXT_236);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil"));    stringBuffer.append(TEXT_237);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_238);    stringBuffer.append(constant);    stringBuffer.append(TEXT_239);    stringBuffer.append(result);    stringBuffer.append(TEXT_240);    if (genDataType.isMinInclusive()) {    stringBuffer.append(comparison);    stringBuffer.append(TEXT_241);    }    stringBuffer.append(comparison);    stringBuffer.append(TEXT_242);    } else {    stringBuffer.append(TEXT_243);    stringBuffer.append(result);    stringBuffer.append(TEXT_244);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_245);    stringBuffer.append(constant);    stringBuffer.append(TEXT_246);    stringBuffer.append(genDataType.isMinInclusive() ? ">=" : ">");    stringBuffer.append(TEXT_247);    }    stringBuffer.append(TEXT_248);    stringBuffer.append(result);    stringBuffer.append(TEXT_249);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_250);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_251);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_252);    stringBuffer.append(constant);    stringBuffer.append(TEXT_253);    stringBuffer.append(genDataType.isMinInclusive() ? "true" : "false");    stringBuffer.append(TEXT_254);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_255);    stringBuffer.append(context);    stringBuffer.append(TEXT_256);    stringBuffer.append(result);    stringBuffer.append(TEXT_257);    }    } else if (constraint.equals("Max") && genDataType.getMaxLiteral() != null) {    if (genDataType.isPrimitiveType()) {    stringBuffer.append(TEXT_258);    stringBuffer.append(result);    stringBuffer.append(TEXT_259);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_260);    stringBuffer.append(genDataType.isMaxInclusive() ? "<=" : "<");    stringBuffer.append(TEXT_261);    stringBuffer.append(constant);    stringBuffer.append(TEXT_262);    stringBuffer.append(result);    stringBuffer.append(TEXT_263);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_264);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_265);    stringBuffer.append(genDataType.getObjectInstanceClassName());    stringBuffer.append(TEXT_266);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_267);    stringBuffer.append(genDataType.getObjectInstanceClassName());    stringBuffer.append(TEXT_268);    stringBuffer.append(constant);    stringBuffer.append(TEXT_269);    stringBuffer.append(genDataType.isMaxInclusive() ? "true" : "false");    stringBuffer.append(TEXT_270);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_271);    stringBuffer.append(context);    stringBuffer.append(TEXT_272);    stringBuffer.append(result);    stringBuffer.append(TEXT_273);    } else { String comparison = "comparison".equals(genClassifier.getSafeUncapName()) ? "theComparison" : "comparison";    if (genDataType.isXMLCalendar()) {    stringBuffer.append(TEXT_274);    stringBuffer.append(comparison);    stringBuffer.append(TEXT_275);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil"));    stringBuffer.append(TEXT_276);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_277);    stringBuffer.append(constant);    stringBuffer.append(TEXT_278);    stringBuffer.append(result);    stringBuffer.append(TEXT_279);    if (genDataType.isMaxInclusive()) {    stringBuffer.append(comparison);    stringBuffer.append(TEXT_280);    }    stringBuffer.append(comparison);    stringBuffer.append(TEXT_281);    } else if (genDataType.isXMLDuration()) {    stringBuffer.append(TEXT_282);    stringBuffer.append(comparison);    stringBuffer.append(TEXT_283);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil"));    stringBuffer.append(TEXT_284);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_285);    stringBuffer.append(constant);    stringBuffer.append(TEXT_286);    stringBuffer.append(result);    stringBuffer.append(TEXT_287);    if (genDataType.isMaxInclusive()) {    stringBuffer.append(comparison);    stringBuffer.append(TEXT_288);    }    stringBuffer.append(comparison);    stringBuffer.append(TEXT_289);    } else {    stringBuffer.append(TEXT_290);    stringBuffer.append(result);    stringBuffer.append(TEXT_291);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_292);    stringBuffer.append(constant);    stringBuffer.append(TEXT_293);    stringBuffer.append(genDataType.isMaxInclusive() ? "<=" : "<");    stringBuffer.append(TEXT_294);    }    stringBuffer.append(TEXT_295);    stringBuffer.append(result);    stringBuffer.append(TEXT_296);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_297);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_298);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_299);    stringBuffer.append(constant);    stringBuffer.append(TEXT_300);    stringBuffer.append(genDataType.isMaxInclusive() ? "true" : "false");    stringBuffer.append(TEXT_301);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_302);    stringBuffer.append(context);    stringBuffer.append(TEXT_303);    stringBuffer.append(result);    stringBuffer.append(TEXT_304);    }    } else if (constraint.equals("MinLength") && genDataType.getMinLength() != -1) {    stringBuffer.append(TEXT_305);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_306);    stringBuffer.append(genDataType.getLengthAccessorFunction());    stringBuffer.append(TEXT_307);    stringBuffer.append(result);    stringBuffer.append(TEXT_308);    stringBuffer.append(genDataType.getMinLength());    stringBuffer.append(TEXT_309);    stringBuffer.append(result);    stringBuffer.append(TEXT_310);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_311);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_312);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_313);    stringBuffer.append(genDataType.getMinLength());    stringBuffer.append(TEXT_314);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_315);    stringBuffer.append(context);    stringBuffer.append(TEXT_316);    stringBuffer.append(result);    stringBuffer.append(TEXT_317);    } else if (constraint.equals("MaxLength") && genDataType.getMaxLength() != -1) {    stringBuffer.append(TEXT_318);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_319);    stringBuffer.append(genDataType.getLengthAccessorFunction());    stringBuffer.append(TEXT_320);    stringBuffer.append(result);    stringBuffer.append(TEXT_321);    stringBuffer.append(genDataType.getMaxLength());    stringBuffer.append(TEXT_322);    stringBuffer.append(result);    stringBuffer.append(TEXT_323);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_324);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_325);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_326);    stringBuffer.append(genDataType.getMaxLength());    stringBuffer.append(TEXT_327);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_328);    stringBuffer.append(context);    stringBuffer.append(TEXT_329);    stringBuffer.append(result);    stringBuffer.append(TEXT_330);    } else if (constraint.equals("TotalDigits") && genDataType.getTotalDigits() != -1) {    if (genDataType.isPrimitiveType()) {    stringBuffer.append(TEXT_331);    stringBuffer.append(result);    stringBuffer.append(TEXT_332);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_333);    stringBuffer.append(constant);    stringBuffer.append(TEXT_334);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_335);    stringBuffer.append(constant);    stringBuffer.append(TEXT_336);    stringBuffer.append(result);    stringBuffer.append(TEXT_337);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_338);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_339);    stringBuffer.append(genDataType.getObjectInstanceClassName());    stringBuffer.append(TEXT_340);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_341);    stringBuffer.append(genDataType.getTotalDigits());    stringBuffer.append(TEXT_342);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_343);    stringBuffer.append(context);    stringBuffer.append(TEXT_344);    } else if ("java.math.BigDecimal".equals(genDataType.getQualifiedInstanceClassName())) {    stringBuffer.append(TEXT_345);    stringBuffer.append(result);    stringBuffer.append(TEXT_346);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_347);    stringBuffer.append(genDataType.getTotalDigits());    stringBuffer.append(TEXT_348);    stringBuffer.append(result);    stringBuffer.append(TEXT_349);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_350);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_351);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_352);    stringBuffer.append(genDataType.getTotalDigits());    stringBuffer.append(TEXT_353);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_354);    stringBuffer.append(context);    stringBuffer.append(TEXT_355);    } else {    stringBuffer.append(TEXT_356);    stringBuffer.append(result);    stringBuffer.append(TEXT_357);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_358);    stringBuffer.append(constant);    stringBuffer.append(TEXT_359);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_360);    stringBuffer.append(constant);    stringBuffer.append(TEXT_361);    stringBuffer.append(result);    stringBuffer.append(TEXT_362);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_363);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_364);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_365);    stringBuffer.append(genDataType.getTotalDigits());    stringBuffer.append(TEXT_366);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_367);    stringBuffer.append(context);    stringBuffer.append(TEXT_368);    }    stringBuffer.append(TEXT_369);    stringBuffer.append(result);    stringBuffer.append(TEXT_370);    } else if (constraint.equals("FractionDigits") && genDataType.getFractionDigits() != -1 && "java.math.BigDecimal".equals(genDataType.getQualifiedInstanceClassName())) {    stringBuffer.append(TEXT_371);    stringBuffer.append(result);    stringBuffer.append(TEXT_372);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_373);    stringBuffer.append(genDataType.getFractionDigits());    stringBuffer.append(TEXT_374);    stringBuffer.append(result);    stringBuffer.append(TEXT_375);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_376);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_377);    stringBuffer.append(genDataType.getSafeUncapName());    stringBuffer.append(TEXT_378);    stringBuffer.append(genDataType.getFractionDigits());    stringBuffer.append(TEXT_379);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_380);    stringBuffer.append(context);    stringBuffer.append(TEXT_381);    stringBuffer.append(result);    stringBuffer.append(TEXT_382);    } else if (constraintDelegate != null) {    stringBuffer.append(TEXT_383);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_384);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_385);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicDiagnostic"));    stringBuffer.append(TEXT_386);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic"));    stringBuffer.append(TEXT_387);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.plugin.EcorePlugin"));    stringBuffer.append(TEXT_388);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_389);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_390);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_391);    stringBuffer.append(context);    stringBuffer.append(TEXT_392);    stringBuffer.append(genModel.getNonNLS());    stringBuffer.append(genModel.getNonNLS(2));    stringBuffer.append(TEXT_393);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_394);    stringBuffer.append(delegate);    stringBuffer.append(TEXT_395);    stringBuffer.append(constraintDelegate.getName());    stringBuffer.append(TEXT_396);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_397);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(accessor);    stringBuffer.append(TEXT_398);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_399);    stringBuffer.append(context);    stringBuffer.append(TEXT_400);    } else {    stringBuffer.append(TEXT_401);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_402);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_403);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicDiagnostic"));    stringBuffer.append(TEXT_404);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic"));    stringBuffer.append(TEXT_405);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.plugin.EcorePlugin"));    stringBuffer.append(TEXT_406);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_407);    stringBuffer.append(genDataType.getQualifiedClassifierAccessor());    stringBuffer.append(TEXT_408);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_409);    stringBuffer.append(context);    stringBuffer.append(TEXT_410);    stringBuffer.append(genModel.getNonNLS());    stringBuffer.append(genModel.getNonNLS(2));    stringBuffer.append(TEXT_411);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_412);    }    } else if (constraintDelegate != null) {    stringBuffer.append(TEXT_413);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_414);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_415);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicDiagnostic"));    stringBuffer.append(TEXT_416);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic"));    stringBuffer.append(TEXT_417);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.plugin.EcorePlugin"));    stringBuffer.append(TEXT_418);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_419);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_420);    stringBuffer.append(context);    stringBuffer.append(TEXT_421);    stringBuffer.append(genModel.getNonNLS());    stringBuffer.append(genModel.getNonNLS(2));    stringBuffer.append(TEXT_422);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_423);    stringBuffer.append(delegate);    stringBuffer.append(TEXT_424);    stringBuffer.append(constraintDelegate.getName());    stringBuffer.append(TEXT_425);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_426);    stringBuffer.append(cast);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_427);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_428);    stringBuffer.append(context);    stringBuffer.append(TEXT_429);    } else { GenOperation genOperation = ((GenClass)genClassifier).getInvariantOperation(constraint); if (genOperation != null) {    stringBuffer.append(TEXT_430);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_431);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_432);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_433);    stringBuffer.append(context);    stringBuffer.append(TEXT_434);    } else {    stringBuffer.append(TEXT_435);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_436);    stringBuffer.append(diagnostics);    stringBuffer.append(TEXT_437);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicDiagnostic"));    stringBuffer.append(TEXT_438);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic"));    stringBuffer.append(TEXT_439);    stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.plugin.EcorePlugin"));    stringBuffer.append(TEXT_440);    stringBuffer.append(constraint);    stringBuffer.append(TEXT_441);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_442);    stringBuffer.append(context);    stringBuffer.append(TEXT_443);    stringBuffer.append(genModel.getNonNLS());    stringBuffer.append(genModel.getNonNLS(2));    stringBuffer.append(TEXT_444);    stringBuffer.append(genClassifier.getSafeUncapName());    stringBuffer.append(TEXT_445);    }}    stringBuffer.append(TEXT_446);    }    }    stringBuffer.append(TEXT_447);    stringBuffer.append(genPackage.getValidatorClassName());    genModel.emitSortedImports();    stringBuffer.append(TEXT_448);    return stringBuffer.toString();  }