static String getText(EGenericType eGenericType) { ETypeParameter eTypeParameter = eGenericType.getETypeParameter(); if (eTypeParameter != null) { String name = eTypeParameter.getName(); return name == null ? "null" : name; } else { EClassifier eClassifier = eGenericType.getEClassifier(); if (eClassifier != null) { List<EGenericType> eTypeArguments = eGenericType.getETypeArguments(); if (eTypeArguments.isEmpty()) { String name = eClassifier.getName(); return name == null ? "null" : name; } else { StringBuilder result = new StringBuilder(); result.append(eClassifier.getName()); result.append('<'); for (Iterator<EGenericType> i = eTypeArguments.iterator(); ; ) { result.append(getText(i.next())); if (i.hasNext()) { result.append(", "); } else { break; } } result.append('>'); return result.toString(); } } else { EGenericType eUpperBound = eGenericType.getEUpperBound(); if (eUpperBound != null) { return "? extends " + getText(eUpperBound); } else { EGenericType eLowerBound = eGenericType.getELowerBound(); if (eLowerBound != null) { return "? super " + getText(eLowerBound); } else { return "?"; } } } } }
protected void handleETypeParameter( ETypeParameter typeParameter, Set<EPackage> visitedPackages, Set<Object> visited) { if (typeParameter != null) { handleEGenericTypes(typeParameter.getEBounds(), visitedPackages, visited); } }
/** * Complete the initialization of the package and its meta-model. This method is guarded to have * no affect on any invocation but its first. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ public void initializePackageContents() { if (isInitialized) return; isInitialized = true; // Initialize package setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); // Create type parameters ETypeParameter equalPredicateEClass_T = addETypeParameter(equalPredicateEClass, "T"); ETypeParameter intoPredicateEClass_T = addETypeParameter(intoPredicateEClass, "T"); ETypeParameter iTypedPredicateEClass_T = addETypeParameter(iTypedPredicateEClass, "T"); // Set bounds for type parameters EGenericType g1 = createEGenericType(ecorePackage.getEJavaObject()); equalPredicateEClass_T.getEBounds().add(g1); // Add supertypes to classes compositePredicateEClass.getESuperTypes().add(this.getIListeningPredicate()); customPredicateEClass.getESuperTypes().add(this.getIPredicate()); equalPredicateEClass.getESuperTypes().add(this.getIPredicate()); g1 = createEGenericType(this.getEqualPredicate()); EGenericType g2 = createEGenericType(ecorePackage.getEString()); g1.getETypeArguments().add(g2); stringEqualPredicateEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(this.getEqualPredicate()); g2 = createEGenericType(ecorePackage.getEDate()); g1.getETypeArguments().add(g2); dateEqualPredicateEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(this.getEqualPredicate()); g2 = createEGenericType(ecorePackage.getEString()); g1.getETypeArguments().add(g2); enumEqualPredicateEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(this.getEqualPredicate()); g2 = createEGenericType(ecorePackage.getEBooleanObject()); g1.getETypeArguments().add(g2); booleanEqualPredicateEClass.getEGenericSuperTypes().add(g1); containsPatternPredicateEClass.getESuperTypes().add(this.getIPredicate()); intoPredicateEClass.getESuperTypes().add(this.getIPredicate()); g1 = createEGenericType(this.getIntoPredicate()); g2 = createEGenericType(ecorePackage.getEString()); g1.getETypeArguments().add(g2); stringIntoPredicateEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(this.getIntoPredicate()); g2 = createEGenericType(ecorePackage.getEString()); g1.getETypeArguments().add(g2); enumIntoPredicateEClass.getEGenericSuperTypes().add(g1); andPredicateEClass.getESuperTypes().add(this.getCompositePredicate()); orPredicateEClass.getESuperTypes().add(this.getCompositePredicate()); notPredicateEClass.getESuperTypes().add(this.getCompositePredicate()); compareNumberPredicateEClass.getESuperTypes().add(this.getIPredicate()); iTypedPredicateEClass.getESuperTypes().add(this.getIPredicateContainer()); g1 = createEGenericType(this.getITypedPredicate()); g2 = createEGenericType(ecorePackage.getEAttribute()); g1.getETypeArguments().add(g2); ieAttrPredicateEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(this.getITypedPredicate()); g2 = createEGenericType(ecorePackage.getEClassifier()); g1.getETypeArguments().add(g2); ieClassifierPredicateEClass.getEGenericSuperTypes().add(g1); truePredicateEClass.getESuperTypes().add(this.getIPredicate()); operationPredicateEClass.getESuperTypes().add(this.getIPredicateContainer()); operationPredicateEClass.getESuperTypes().add(this.getIListeningPredicate()); intParameterEClass.getESuperTypes().add(this.getParameter()); booleanParameterEClass.getESuperTypes().add(this.getParameter()); stringParameterEClass.getESuperTypes().add(this.getParameter()); eObjectParameterEClass.getESuperTypes().add(this.getParameter()); iPredicateContainerEClass.getESuperTypes().add(this.getIPredicate()); isTypeOfPredicateEClass.getESuperTypes().add(this.getIPredicate()); isNullPredicateEClass.getESuperTypes().add(this.getIPredicate()); iListeningPredicateEClass.getESuperTypes().add(this.getIPredicate()); // Initialize classes, features, and operations; add parameters initEClass( iPredicateEClass, IPredicate.class, "IPredicate", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute( getIPredicate_DisplayName(), ecorePackage.getEString(), "displayName", null, 0, 1, IPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); EOperation op = initEOperation( getIPredicate__Match__Object(), ecorePackage.getEBoolean(), "match", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, ecorePackage.getEJavaObject(), "input", 0, 1, IS_UNIQUE, IS_ORDERED); initEClass( compositePredicateEClass, CompositePredicate.class, "CompositePredicate", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference( getCompositePredicate_Predicates(), this.getIPredicate(), null, "predicates", null, 0, -1, CompositePredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( customPredicateEClass, CustomPredicate.class, "CustomPredicate", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( equalPredicateEClass, EqualPredicate.class, "EqualPredicate", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(equalPredicateEClass_T); initEAttribute( getEqualPredicate_Input(), g1, "input", null, 0, 1, EqualPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); g1 = createEGenericType(equalPredicateEClass_T); initEAttribute( getEqualPredicate_ExpectedObject(), g1, "expectedObject", null, 0, 1, EqualPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( stringEqualPredicateEClass, StringEqualPredicate.class, "StringEqualPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( dateEqualPredicateEClass, DateEqualPredicate.class, "DateEqualPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( enumEqualPredicateEClass, EnumEqualPredicate.class, "EnumEqualPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( booleanEqualPredicateEClass, BooleanEqualPredicate.class, "BooleanEqualPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( containsPatternPredicateEClass, ContainsPatternPredicate.class, "ContainsPatternPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute( getContainsPatternPredicate_Input(), this.getCharSequence(), "input", null, 0, 1, ContainsPatternPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute( getContainsPatternPredicate_ExpectedPattern(), this.getPattern(), "expectedPattern", null, 0, 1, ContainsPatternPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( intoPredicateEClass, IntoPredicate.class, "IntoPredicate", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(intoPredicateEClass_T); initEAttribute( getIntoPredicate_Input(), g1, "input", null, 0, 1, IntoPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); g1 = createEGenericType(intoPredicateEClass_T); initEAttribute( getIntoPredicate_AllowedEntries(), g1, "allowedEntries", null, 0, -1, IntoPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( stringIntoPredicateEClass, StringIntoPredicate.class, "StringIntoPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( enumIntoPredicateEClass, EnumIntoPredicate.class, "EnumIntoPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( andPredicateEClass, AndPredicate.class, "AndPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( orPredicateEClass, OrPredicate.class, "OrPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( notPredicateEClass, NotPredicate.class, "NotPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( compareNumberPredicateEClass, CompareNumberPredicate.class, "CompareNumberPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute( getCompareNumberPredicate_Input(), this.getNumber(), "input", null, 0, 1, CompareNumberPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute( getCompareNumberPredicate_ExpectedValue(), this.getNumber(), "expectedValue", null, 0, 1, CompareNumberPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute( getCompareNumberPredicate_Operator(), this.getOPERATOR(), "operator", null, 0, 1, CompareNumberPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( iTypedPredicateEClass, ITypedPredicate.class, "ITypedPredicate", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(iTypedPredicateEClass_T); initEReference( getITypedPredicate_TypedElement(), g1, null, "typedElement", null, 0, 1, ITypedPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( ieAttrPredicateEClass, IEAttrPredicate.class, "IEAttrPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( ieClassifierPredicateEClass, IEClassifierPredicate.class, "IEClassifierPredicate", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( truePredicateEClass, TruePredicate.class, "TruePredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( operationPredicateEClass, OperationPredicate.class, "OperationPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute( getOperationPredicate_OperationName(), ecorePackage.getEString(), "operationName", null, 0, 1, OperationPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference( getOperationPredicate_Parameters(), this.getParameter(), null, "parameters", null, 0, -1, OperationPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( parameterEClass, Parameter.class, "Parameter", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute( getParameter_Name(), ecorePackage.getEString(), "name", null, 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEOperation( getParameter__GetObjectValue(), ecorePackage.getEJavaObject(), "getObjectValue", 0, 1, IS_UNIQUE, IS_ORDERED); initEClass( intParameterEClass, IntParameter.class, "IntParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute( getIntParameter_Value(), ecorePackage.getEInt(), "value", null, 0, 1, IntParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( booleanParameterEClass, BooleanParameter.class, "BooleanParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute( getBooleanParameter_Value(), ecorePackage.getEBoolean(), "value", null, 0, 1, BooleanParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( stringParameterEClass, StringParameter.class, "StringParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute( getStringParameter_Value(), ecorePackage.getEString(), "value", null, 0, 1, StringParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( eObjectParameterEClass, EObjectParameter.class, "EObjectParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference( getEObjectParameter_Value(), ecorePackage.getEObject(), null, "value", null, 0, 1, EObjectParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( iPredicateContainerEClass, IPredicateContainer.class, "IPredicateContainer", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference( getIPredicateContainer_ResultPredicate(), this.getIPredicate(), null, "resultPredicate", null, 0, 1, IPredicateContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( isTypeOfPredicateEClass, IsTypeOfPredicate.class, "IsTypeOfPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute( getIsTypeOfPredicate_IsStrictTypeOf(), ecorePackage.getEBoolean(), "isStrictTypeOf", null, 0, 1, IsTypeOfPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference( getIsTypeOfPredicate_Type(), ecorePackage.getEClass(), null, "type", null, 0, 1, IsTypeOfPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass( isNullPredicateEClass, IsNullPredicate.class, "IsNullPredicate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass( iListeningPredicateEClass, IListeningPredicate.class, "IListeningPredicate", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEOperation( getIListeningPredicate__GetObjectsToListen(), ecorePackage.getEJavaObject(), "getObjectsToListen", 0, -1, IS_UNIQUE, IS_ORDERED); // Initialize enums and add enum literals initEEnum(operatorEEnum, org.polarsys.reqcycle.predicates.core.api.OPERATOR.class, "OPERATOR"); addEEnumLiteral(operatorEEnum, org.polarsys.reqcycle.predicates.core.api.OPERATOR.EQ); addEEnumLiteral(operatorEEnum, org.polarsys.reqcycle.predicates.core.api.OPERATOR.NQ); addEEnumLiteral(operatorEEnum, org.polarsys.reqcycle.predicates.core.api.OPERATOR.GT); addEEnumLiteral(operatorEEnum, org.polarsys.reqcycle.predicates.core.api.OPERATOR.GET); addEEnumLiteral(operatorEEnum, org.polarsys.reqcycle.predicates.core.api.OPERATOR.LT); addEEnumLiteral(operatorEEnum, org.polarsys.reqcycle.predicates.core.api.OPERATOR.LET); // Initialize data types initEDataType( patternEDataType, Pattern.class, "Pattern", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType( charSequenceEDataType, CharSequence.class, "CharSequence", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType( numberEDataType, Number.class, "Number", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); // Create annotations // www.eclipse.org/reqcycle/predicates/userInput createUserInputAnnotations(); // www.eclipse.org/reqcycle/predicates/specificUserInput createSpecificUserInputAnnotations(); // www.eclipse.org/reqcycle/predicates/input_javaclass_type createInput_javaclass_typeAnnotations(); // www.eclipse.org/reqcycle/predicates/adaptInput createAdaptInputAnnotations(); }