protected T doSwitch(EClass eClass, EObject eObject) { if (isSwitchFor(eClass.ePackage)) { return(doSwitch(eClass.getClassifierID(), eObject)); } else { OrderedSet <EClass> eSuperTypes = eClass.eSuperTypes; return(eSuperTypes.isEmpty() ? defaultCase(eObject) : doSwitch(eSuperTypes.at(0), eObject)); } }
public override EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case SerializationPackageImpl.MYCLASS: return(createMyClass()); case SerializationPackageImpl.OTHERCLASS: return(createOtherClass()); case SerializationPackageImpl.YETANOTHERCLASS: return(createYetAnotherClass()); default: throw new ArgumentException("The class '" + eClass.name + "' is not a valid classifier"); } }
public virtual bool validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Dictionary <object, object> context) { if (eObject.eIsProxy()) { if (context != null && context.ContainsKey(ROOT_OBJECT) && context[ROOT_OBJECT] != null) { if (diagnostics != null) { diagnostics.add (createDiagnostic (BasicDiagnostic.ERROR, DIAGNOSTIC_SOURCE, EOBJECT__EVERY_PROXY_RESOLVES, "_UI_UnresolvedProxy_diagnostic", new Object[] { getFeatureLabel(eObject.eContainmentFeature(), context), getObjectLabel(eObject.eContainer(), context), getObjectLabel(eObject, context) }, new Object[] { eObject.eContainer(), eObject.eContainmentFeature(), eObject }, context)); } return(false); } else { return(true); } } else if (eClass.eContainer() == getEPackage()) { return(validate(eClass.getClassifierID(), eObject, diagnostics, context)); } else { return(true); /* * return * new DynamicEClassValidator() * { * // Ensure that the class loader for this class will be used downstream. * // * }.validate(eClass, eObject, diagnostics, context); */ } }
public override EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case EcorePackageImpl.EATTRIBUTE: return(createEAttribute()); case EcorePackageImpl.EANNOTATION: return(createEAnnotation()); case EcorePackageImpl.ECLASS: return(createEClass()); case EcorePackageImpl.EDATATYPE: return(createEDataType()); case EcorePackageImpl.EENUM: return(createEEnum()); case EcorePackageImpl.EENUMLITERAL: return(createEEnumLiteral()); case EcorePackageImpl.EFACTORY: return(createEFactory()); case EcorePackageImpl.EOBJECT: return(createEObject()); case EcorePackageImpl.EOPERATION: return(createEOperation()); case EcorePackageImpl.EPACKAGE: return(createEPackage()); case EcorePackageImpl.EPARAMETER: return(createEParameter()); case EcorePackageImpl.EREFERENCE: return(createEReference()); case EcorePackageImpl.ESTRINGTOSTRINGMAPENTRY: return(createEStringToStringMapEntry()); case EcorePackageImpl.EGENERICTYPE: return(createEGenericType()); case EcorePackageImpl.ETYPEPARAMETER: return(createETypeParameter()); default: throw new ArgumentException("The class '" + eClass.name + "' is not a valid classifier"); } }
public override EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case Java_PackageImpl.ANNOTATION: return(createAnnotation()); case Java_PackageImpl.ARCHIVE: return(createArchive()); case Java_PackageImpl.ASSERTSTATEMENT: return(createAssertStatement()); case Java_PackageImpl.ANNOTATIONMEMBERVALUEPAIR: return(createAnnotationMemberValuePair()); case Java_PackageImpl.ANNOTATIONTYPEDECLARATION: return(createAnnotationTypeDeclaration()); case Java_PackageImpl.ANNOTATIONTYPEMEMBERDECLARATION: return(createAnnotationTypeMemberDeclaration()); case Java_PackageImpl.ANONYMOUSCLASSDECLARATION: return(createAnonymousClassDeclaration()); case Java_PackageImpl.ARRAYACCESS: return(createArrayAccess()); case Java_PackageImpl.ARRAYCREATION: return(createArrayCreation()); case Java_PackageImpl.ARRAYINITIALIZER: return(createArrayInitializer()); case Java_PackageImpl.ARRAYLENGTHACCESS: return(createArrayLengthAccess()); case Java_PackageImpl.ARRAYTYPE: return(createArrayType()); case Java_PackageImpl.ASSIGNMENT: return(createAssignment()); case Java_PackageImpl.BOOLEANLITERAL: return(createBooleanLiteral()); case Java_PackageImpl.BLOCKCOMMENT: return(createBlockComment()); case Java_PackageImpl.BLOCK: return(createBlock()); case Java_PackageImpl.BREAKSTATEMENT: return(createBreakStatement()); case Java_PackageImpl.CASTEXPRESSION: return(createCastExpression()); case Java_PackageImpl.CATCHCLAUSE: return(createCatchClause()); case Java_PackageImpl.CHARACTERLITERAL: return(createCharacterLiteral()); case Java_PackageImpl.CLASSFILE: return(createClassFile()); case Java_PackageImpl.CLASSINSTANCECREATION: return(createClassInstanceCreation()); case Java_PackageImpl.CONSTRUCTORDECLARATION: return(createConstructorDeclaration()); case Java_PackageImpl.CONDITIONALEXPRESSION: return(createConditionalExpression()); case Java_PackageImpl.CONSTRUCTORINVOCATION: return(createConstructorInvocation()); case Java_PackageImpl.CLASSDECLARATION: return(createClassDeclaration()); case Java_PackageImpl.COMPILATIONUNIT: return(createCompilationUnit()); case Java_PackageImpl.CONTINUESTATEMENT: return(createContinueStatement()); case Java_PackageImpl.DOSTATEMENT: return(createDoStatement()); case Java_PackageImpl.EMPTYSTATEMENT: return(createEmptyStatement()); case Java_PackageImpl.ENHANCEDFORSTATEMENT: return(createEnhancedForStatement()); case Java_PackageImpl.ENUMCONSTANTDECLARATION: return(createEnumConstantDeclaration()); case Java_PackageImpl.ENUMDECLARATION: return(createEnumDeclaration()); case Java_PackageImpl.EXPRESSIONSTATEMENT: return(createExpressionStatement()); case Java_PackageImpl.FIELDACCESS: return(createFieldAccess()); case Java_PackageImpl.FIELDDECLARATION: return(createFieldDeclaration()); case Java_PackageImpl.FORSTATEMENT: return(createForStatement()); case Java_PackageImpl.IFSTATEMENT: return(createIfStatement()); case Java_PackageImpl.IMPORTDECLARATION: return(createImportDeclaration()); case Java_PackageImpl.INFIXEXPRESSION: return(createInfixExpression()); case Java_PackageImpl.INITIALIZER: return(createInitializer()); case Java_PackageImpl.INSTANCEOFEXPRESSION: return(createInstanceofExpression()); case Java_PackageImpl.INTERFACEDECLARATION: return(createInterfaceDeclaration()); case Java_PackageImpl.JAVADOC: return(createJavadoc()); case Java_PackageImpl.LABELEDSTATEMENT: return(createLabeledStatement()); case Java_PackageImpl.LINECOMMENT: return(createLineComment()); case Java_PackageImpl.MANIFEST: return(createManifest()); case Java_PackageImpl.MANIFESTATTRIBUTE: return(createManifestAttribute()); case Java_PackageImpl.MANIFESTENTRY: return(createManifestEntry()); case Java_PackageImpl.MEMBERREF: return(createMemberRef()); case Java_PackageImpl.METHODDECLARATION: return(createMethodDeclaration()); case Java_PackageImpl.METHODINVOCATION: return(createMethodInvocation()); case Java_PackageImpl.METHODREF: return(createMethodRef()); case Java_PackageImpl.METHODREFPARAMETER: return(createMethodRefParameter()); case Java_PackageImpl.MODEL: return(createModel()); case Java_PackageImpl.MODIFIER: return(createModifier()); case Java_PackageImpl.NUMBERLITERAL: return(createNumberLiteral()); case Java_PackageImpl.NULLLITERAL: return(createNullLiteral()); case Java_PackageImpl.PACKAGE: return(createPackage()); case Java_PackageImpl.PACKAGEACCESS: return(createPackageAccess()); case Java_PackageImpl.PARAMETERIZEDTYPE: return(createParameterizedType()); case Java_PackageImpl.PARENTHESIZEDEXPRESSION: return(createParenthesizedExpression()); case Java_PackageImpl.POSTFIXEXPRESSION: return(createPostfixExpression()); case Java_PackageImpl.PREFIXEXPRESSION: return(createPrefixExpression()); case Java_PackageImpl.PRIMITIVETYPE: return(createPrimitiveType()); case Java_PackageImpl.PRIMITIVETYPEBOOLEAN: return(createPrimitiveTypeBoolean()); case Java_PackageImpl.PRIMITIVETYPEBYTE: return(createPrimitiveTypeByte()); case Java_PackageImpl.PRIMITIVETYPECHAR: return(createPrimitiveTypeChar()); case Java_PackageImpl.PRIMITIVETYPEDOUBLE: return(createPrimitiveTypeDouble()); case Java_PackageImpl.PRIMITIVETYPESHORT: return(createPrimitiveTypeShort()); case Java_PackageImpl.PRIMITIVETYPEFLOAT: return(createPrimitiveTypeFloat()); case Java_PackageImpl.PRIMITIVETYPEINT: return(createPrimitiveTypeInt()); case Java_PackageImpl.PRIMITIVETYPELONG: return(createPrimitiveTypeLong()); case Java_PackageImpl.PRIMITIVETYPEVOID: return(createPrimitiveTypeVoid()); case Java_PackageImpl.RETURNSTATEMENT: return(createReturnStatement()); case Java_PackageImpl.SINGLEVARIABLEACCESS: return(createSingleVariableAccess()); case Java_PackageImpl.SINGLEVARIABLEDECLARATION: return(createSingleVariableDeclaration()); case Java_PackageImpl.STRINGLITERAL: return(createStringLiteral()); case Java_PackageImpl.SUPERCONSTRUCTORINVOCATION: return(createSuperConstructorInvocation()); case Java_PackageImpl.SUPERFIELDACCESS: return(createSuperFieldAccess()); case Java_PackageImpl.SUPERMETHODINVOCATION: return(createSuperMethodInvocation()); case Java_PackageImpl.SWITCHCASE: return(createSwitchCase()); case Java_PackageImpl.SWITCHSTATEMENT: return(createSwitchStatement()); case Java_PackageImpl.SYNCHRONIZEDSTATEMENT: return(createSynchronizedStatement()); case Java_PackageImpl.TAGELEMENT: return(createTagElement()); case Java_PackageImpl.TEXTELEMENT: return(createTextElement()); case Java_PackageImpl.THISEXPRESSION: return(createThisExpression()); case Java_PackageImpl.THROWSTATEMENT: return(createThrowStatement()); case Java_PackageImpl.TRYSTATEMENT: return(createTryStatement()); case Java_PackageImpl.TYPEACCESS: return(createTypeAccess()); case Java_PackageImpl.TYPEDECLARATIONSTATEMENT: return(createTypeDeclarationStatement()); case Java_PackageImpl.TYPELITERAL: return(createTypeLiteral()); case Java_PackageImpl.TYPEPARAMETER: return(createTypeParameter()); case Java_PackageImpl.UNRESOLVEDITEM: return(createUnresolvedItem()); case Java_PackageImpl.UNRESOLVEDITEMACCESS: return(createUnresolvedItemAccess()); case Java_PackageImpl.UNRESOLVEDANNOTATIONDECLARATION: return(createUnresolvedAnnotationDeclaration()); case Java_PackageImpl.UNRESOLVEDANNOTATIONTYPEMEMBERDECLARATION: return(createUnresolvedAnnotationTypeMemberDeclaration()); case Java_PackageImpl.UNRESOLVEDCLASSDECLARATION: return(createUnresolvedClassDeclaration()); case Java_PackageImpl.UNRESOLVEDENUMDECLARATION: return(createUnresolvedEnumDeclaration()); case Java_PackageImpl.UNRESOLVEDINTERFACEDECLARATION: return(createUnresolvedInterfaceDeclaration()); case Java_PackageImpl.UNRESOLVEDLABELEDSTATEMENT: return(createUnresolvedLabeledStatement()); case Java_PackageImpl.UNRESOLVEDMETHODDECLARATION: return(createUnresolvedMethodDeclaration()); case Java_PackageImpl.UNRESOLVEDSINGLEVARIABLEDECLARATION: return(createUnresolvedSingleVariableDeclaration()); case Java_PackageImpl.UNRESOLVEDTYPE: return(createUnresolvedType()); case Java_PackageImpl.UNRESOLVEDTYPEDECLARATION: return(createUnresolvedTypeDeclaration()); case Java_PackageImpl.UNRESOLVEDVARIABLEDECLARATIONFRAGMENT: return(createUnresolvedVariableDeclarationFragment()); case Java_PackageImpl.VARIABLEDECLARATIONEXPRESSION: return(createVariableDeclarationExpression()); case Java_PackageImpl.VARIABLEDECLARATIONFRAGMENT: return(createVariableDeclarationFragment()); case Java_PackageImpl.VARIABLEDECLARATIONSTATEMENT: return(createVariableDeclarationStatement()); case Java_PackageImpl.WILDCARDTYPE: return(createWildCardType()); case Java_PackageImpl.WHILESTATEMENT: return(createWhileStatement()); default: throw new ArgumentException("The class '" + eClass.name + "' is not a valid classifier"); } }