Class<T> type expression support
diff --git a/plugins/org.eclipse.dltk.javascript.core/model/references.ecore b/plugins/org.eclipse.dltk.javascript.core/model/references.ecore
index 12f4989..5a68feb 100644
--- a/plugins/org.eclipse.dltk.javascript.core/model/references.ecore
+++ b/plugins/org.eclipse.dltk.javascript.core/model/references.ecore
@@ -174,4 +174,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="target" eType="#//Type"
resolveProxies="false"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="TypeVariableClassType" eSuperTypes="#//JSType">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="variable" eType="#//TypeVariable"/>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/ti/TypeInferencer2.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/ti/TypeInferencer2.java
index e1bd9a3..15752be 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/ti/TypeInferencer2.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/ti/TypeInferencer2.java
@@ -34,6 +34,7 @@
import org.eclipse.dltk.javascript.typeinfo.IElementResolver;
import org.eclipse.dltk.javascript.typeinfo.IMemberEvaluator;
import org.eclipse.dltk.javascript.typeinfo.IModelBuilder;
+import org.eclipse.dltk.javascript.typeinfo.IRSimpleType;
import org.eclipse.dltk.javascript.typeinfo.IRType;
import org.eclipse.dltk.javascript.typeinfo.ITypeInfoContext;
import org.eclipse.dltk.javascript.typeinfo.ITypeProvider;
@@ -55,6 +56,7 @@
import org.eclipse.dltk.javascript.typeinfo.model.TypeInfoModelPackage;
import org.eclipse.dltk.javascript.typeinfo.model.TypeKind;
import org.eclipse.dltk.javascript.typeinfo.model.TypeVariable;
+import org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType;
import org.eclipse.dltk.javascript.typeinfo.model.TypeVariableReference;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
@@ -233,8 +235,8 @@
type = parameterizer.copy();
parameterizer.copyReferences();
type.setName(name);
- type.eAdapters()
- .add(new OriginReference(genericType,
+ type.eAdapters().add(
+ new OriginReference(genericType,
parameterizer.actualParameters));
types.put(name, type);
typeRS.addToResource(type);
@@ -304,6 +306,17 @@
.createRType();
result.setRuntimeType(source);
return result;
+ } else if (eObject instanceof TypeVariableClassType) {
+ final IRType source = parameters
+ .get(((TypeVariableClassType) eObject)
+ .getVariable());
+ final RType result = TypeInfoModelFactory.eINSTANCE
+ .createRType();
+ result.setRuntimeType(JSTypeSet
+ .classType(source instanceof IRSimpleType ? ((IRSimpleType) source)
+ .getTarget() : null));
+ return result;
+
} else {
copyEObject = createCopy(eObject);
eClass = eObject.eClass();
@@ -334,7 +347,8 @@
@Override
protected void copyReference(EReference eReference, EObject eObject,
EObject copyEObject) {
- if (eObject instanceof TypeVariableReference)
+ if (eObject instanceof TypeVariableReference
+ || eObject instanceof TypeVariableClassType)
return;
super.copyReference(eReference, eObject, copyEObject);
}
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/ti/TypeInferencerVisitor.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/ti/TypeInferencerVisitor.java
index 13196c6..d68fb31 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/ti/TypeInferencerVisitor.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/ti/TypeInferencerVisitor.java
@@ -136,6 +136,7 @@
import org.eclipse.dltk.javascript.typeinfo.model.TypeInfoModelFactory;
import org.eclipse.dltk.javascript.typeinfo.model.TypeKind;
import org.eclipse.dltk.javascript.typeinfo.model.TypeVariable;
+import org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType;
import org.eclipse.dltk.javascript.typeinfo.model.TypeVariableReference;
import org.eclipse.dltk.javascript.typeinfo.model.UnionType;
import org.eclipse.dltk.javascript.typeinfo.model.util.TypeInfoModelSwitch;
@@ -507,6 +508,15 @@
if (paramType instanceof TypeVariableReference) {
return new Capture(
((TypeVariableReference) paramType).getVariable(), argTypes);
+ } else if (paramType instanceof TypeVariableClassType) {
+ final JSTypeSet result = JSTypeSet.create();
+ for (IRType type : argTypes) {
+ if (type instanceof IRClassType) {
+ result.add(((IRClassType) type).toItemType());
+ }
+ }
+ return new Capture(
+ ((TypeVariableClassType) paramType).getVariable(), result);
} else {
// TODO alex other type expressions
return null;
@@ -529,6 +539,10 @@
return Boolean.TRUE;
}
+ public Boolean caseTypeVariableClassType(TypeVariableClassType object) {
+ return Boolean.TRUE;
+ }
+
@Override
public Boolean caseArrayType(ArrayType object) {
return doSwitch(object.getItemType());
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/JSTypeSet.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/JSTypeSet.java
index ebc61db..6dd888a 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/JSTypeSet.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/JSTypeSet.java
@@ -37,6 +37,7 @@
import org.eclipse.dltk.javascript.typeinfo.model.SimpleType;
import org.eclipse.dltk.javascript.typeinfo.model.Type;
import org.eclipse.dltk.javascript.typeinfo.model.TypeInfoModelLoader;
+import org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType;
import org.eclipse.dltk.javascript.typeinfo.model.TypeVariableReference;
import org.eclipse.dltk.javascript.typeinfo.model.UndefinedType;
import org.eclipse.dltk.javascript.typeinfo.model.UnionType;
@@ -918,6 +919,9 @@
} else if (type instanceof TypeVariableReference) {
// TODO (alex) shouldn't happen
return none();
+ } else if (type instanceof TypeVariableClassType) {
+ // shouldn't happen
+ return classType(null);
} else if (type instanceof SimpleType) {
final SimpleType ref = (SimpleType) type;
Type target = ref.getTarget();
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/TypeInfoModelFactory.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/TypeInfoModelFactory.java
index a8a304d..41dbe2b 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/TypeInfoModelFactory.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/TypeInfoModelFactory.java
@@ -9,7 +9,7 @@
* Contributors:
* xored software, Inc. - initial API and Implementation (Alex Panchenko)
*
- * $Id: TypeInfoModelFactory.java,v 1.17 2012/04/23 06:18:12 apanchenk Exp $
+ * $Id: TypeInfoModelFactory.java,v 1.18 2012/06/12 10:40:32 apanchenk Exp $
*/
package org.eclipse.dltk.javascript.typeinfo.model;
@@ -186,6 +186,15 @@
TypeLiteral createTypeLiteral();
/**
+ * Returns a new object of class '<em>Type Variable Class Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Type Variable Class Type</em>'.
+ * @generated
+ */
+ TypeVariableClassType createTypeVariableClassType();
+
+ /**
* Returns a new object of class '<em>Map Type</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/TypeInfoModelPackage.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/TypeInfoModelPackage.java
index cec27cd..a76026d 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/TypeInfoModelPackage.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/TypeInfoModelPackage.java
@@ -9,7 +9,7 @@
* Contributors:
* xored software, Inc. - initial API and Implementation (Alex Panchenko)
*
- * $Id: TypeInfoModelPackage.java,v 1.40 2012/06/08 14:34:53 apanchenk Exp $
+ * $Id: TypeInfoModelPackage.java,v 1.41 2012/06/12 10:40:32 apanchenk Exp $
*/
package org.eclipse.dltk.javascript.typeinfo.model;
@@ -2054,6 +2054,34 @@
int TYPE_LITERAL_FEATURE_COUNT = 2;
/**
+ * The meta object id for the '{@link org.eclipse.dltk.javascript.typeinfo.model.impl.TypeVariableClassTypeImpl <em>Type Variable Class Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.dltk.javascript.typeinfo.model.impl.TypeVariableClassTypeImpl
+ * @see org.eclipse.dltk.javascript.typeinfo.model.impl.TypeInfoModelPackageImpl#getTypeVariableClassType()
+ * @generated
+ */
+ int TYPE_VARIABLE_CLASS_TYPE = 31;
+
+ /**
+ * The feature id for the '<em><b>Variable</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TYPE_VARIABLE_CLASS_TYPE__VARIABLE = JS_TYPE_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Type Variable Class Type</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TYPE_VARIABLE_CLASS_TYPE_FEATURE_COUNT = JS_TYPE_FEATURE_COUNT + 1;
+
+ /**
* The meta object id for the '{@link org.eclipse.dltk.javascript.typeinfo.model.TypeKind <em>Type Kind</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2061,7 +2089,7 @@
* @see org.eclipse.dltk.javascript.typeinfo.model.impl.TypeInfoModelPackageImpl#getTypeKind()
* @generated
*/
- int TYPE_KIND = 31;
+ int TYPE_KIND = 32;
/**
@@ -2072,7 +2100,7 @@
* @see org.eclipse.dltk.javascript.typeinfo.model.impl.TypeInfoModelPackageImpl#getParameterKind()
* @generated
*/
- int PARAMETER_KIND = 32;
+ int PARAMETER_KIND = 33;
/**
@@ -2083,7 +2111,7 @@
* @see org.eclipse.dltk.javascript.typeinfo.model.impl.TypeInfoModelPackageImpl#getVisibility()
* @generated
*/
- int VISIBILITY = 33;
+ int VISIBILITY = 34;
/**
@@ -2094,7 +2122,7 @@
* @see org.eclipse.dltk.javascript.typeinfo.model.impl.TypeInfoModelPackageImpl#getIRType()
* @generated
*/
- int IR_TYPE = 34;
+ int IR_TYPE = 35;
/**
@@ -2413,6 +2441,27 @@
EReference getTypeLiteral_Target();
/**
+ * Returns the meta object for class '{@link org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType <em>Type Variable Class Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Type Variable Class Type</em>'.
+ * @see org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType
+ * @generated
+ */
+ EClass getTypeVariableClassType();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType#getVariable <em>Variable</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Variable</em>'.
+ * @see org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType#getVariable()
+ * @see #getTypeVariableClassType()
+ * @generated
+ */
+ EReference getTypeVariableClassType_Variable();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.dltk.javascript.typeinfo.model.MapType <em>Map Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -3260,6 +3309,24 @@
EReference TYPE_LITERAL__TARGET = eINSTANCE.getTypeLiteral_Target();
/**
+ * The meta object literal for the '{@link org.eclipse.dltk.javascript.typeinfo.model.impl.TypeVariableClassTypeImpl <em>Type Variable Class Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.dltk.javascript.typeinfo.model.impl.TypeVariableClassTypeImpl
+ * @see org.eclipse.dltk.javascript.typeinfo.model.impl.TypeInfoModelPackageImpl#getTypeVariableClassType()
+ * @generated
+ */
+ EClass TYPE_VARIABLE_CLASS_TYPE = eINSTANCE.getTypeVariableClassType();
+
+ /**
+ * The meta object literal for the '<em><b>Variable</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference TYPE_VARIABLE_CLASS_TYPE__VARIABLE = eINSTANCE.getTypeVariableClassType_Variable();
+
+ /**
* The meta object literal for the '{@link org.eclipse.dltk.javascript.typeinfo.model.impl.MapTypeImpl <em>Map Type</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/TypeVariableClassType.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/TypeVariableClassType.java
new file mode 100644
index 0000000..f9ec138
--- /dev/null
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/TypeVariableClassType.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2011 NumberFour AG
+ *
+ * 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:
+ * NumberFour AG - initial API and Implementation (Alex Panchenko)
+ */
+package org.eclipse.dltk.javascript.typeinfo.model;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Type Variable Class Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType#getVariable <em>Variable</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.dltk.javascript.typeinfo.model.TypeInfoModelPackage#getTypeVariableClassType()
+ * @model
+ * @generated
+ */
+public interface TypeVariableClassType extends JSType {
+ /**
+ * Returns the value of the '<em><b>Variable</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Variable</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Variable</em>' reference.
+ * @see #setVariable(TypeVariable)
+ * @see org.eclipse.dltk.javascript.typeinfo.model.TypeInfoModelPackage#getTypeVariableClassType_Variable()
+ * @model
+ * @generated
+ */
+ TypeVariable getVariable();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType#getVariable <em>Variable</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Variable</em>' reference.
+ * @see #getVariable()
+ * @generated
+ */
+ void setVariable(TypeVariable value);
+
+} // TypeVariableClassType
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/impl/TypeInfoModelFactoryImpl.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/impl/TypeInfoModelFactoryImpl.java
index 0730f2e..0245ac5 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/impl/TypeInfoModelFactoryImpl.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/impl/TypeInfoModelFactoryImpl.java
@@ -9,7 +9,7 @@
* Contributors:
* xored software, Inc. - initial API and Implementation (Alex Panchenko)
*
- * $Id: TypeInfoModelFactoryImpl.java,v 1.21 2012/04/23 06:18:12 apanchenk Exp $
+ * $Id: TypeInfoModelFactoryImpl.java,v 1.22 2012/06/12 10:40:31 apanchenk Exp $
*/
package org.eclipse.dltk.javascript.typeinfo.model.impl;
@@ -113,6 +113,7 @@
case TypeInfoModelPackage.RTYPE: return createRType();
case TypeInfoModelPackage.GENERIC_METHOD: return createGenericMethod();
case TypeInfoModelPackage.TYPE_LITERAL: return createTypeLiteral();
+ case TypeInfoModelPackage.TYPE_VARIABLE_CLASS_TYPE: return createTypeVariableClassType();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -341,6 +342,16 @@
* <!-- end-user-doc -->
* @generated
*/
+ public TypeVariableClassType createTypeVariableClassType() {
+ TypeVariableClassTypeImpl typeVariableClassType = new TypeVariableClassTypeImpl();
+ return typeVariableClassType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public MapType createMapType() {
MapTypeImpl mapType = new MapTypeImpl();
return mapType;
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/impl/TypeInfoModelPackageImpl.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/impl/TypeInfoModelPackageImpl.java
index 7ae92ed..9ef9d56 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/impl/TypeInfoModelPackageImpl.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/impl/TypeInfoModelPackageImpl.java
@@ -9,7 +9,7 @@
* Contributors:
* xored software, Inc. - initial API and Implementation (Alex Panchenko)
*
- * $Id: TypeInfoModelPackageImpl.java,v 1.46 2012/06/08 14:34:53 apanchenk Exp $
+ * $Id: TypeInfoModelPackageImpl.java,v 1.47 2012/06/12 10:40:31 apanchenk Exp $
*/
package org.eclipse.dltk.javascript.typeinfo.model.impl;
@@ -46,6 +46,7 @@
import org.eclipse.dltk.javascript.typeinfo.model.TypeKind;
import org.eclipse.dltk.javascript.typeinfo.model.TypeLiteral;
import org.eclipse.dltk.javascript.typeinfo.model.TypeVariable;
+import org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType;
import org.eclipse.dltk.javascript.typeinfo.model.TypeVariableReference;
import org.eclipse.dltk.javascript.typeinfo.model.TypedElement;
import org.eclipse.dltk.javascript.typeinfo.model.UndefinedType;
@@ -177,6 +178,13 @@
* <!-- end-user-doc -->
* @generated
*/
+ private EClass typeVariableClassTypeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass mapTypeEClass = null;
/**
@@ -648,6 +656,24 @@
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getTypeVariableClassType() {
+ return typeVariableClassTypeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getTypeVariableClassType_Variable() {
+ return (EReference)typeVariableClassTypeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getMapType() {
return mapTypeEClass;
}
@@ -1248,6 +1274,9 @@
createEAttribute(typeLiteralEClass, TYPE_LITERAL__NAME);
createEReference(typeLiteralEClass, TYPE_LITERAL__TARGET);
+ typeVariableClassTypeEClass = createEClass(TYPE_VARIABLE_CLASS_TYPE);
+ createEReference(typeVariableClassTypeEClass, TYPE_VARIABLE_CLASS_TYPE__VARIABLE);
+
// Create enums
typeKindEEnum = createEEnum(TYPE_KIND);
parameterKindEEnum = createEEnum(PARAMETER_KIND);
@@ -1312,6 +1341,7 @@
typeVariableReferenceEClass.getESuperTypes().add(this.getJSType());
rTypeEClass.getESuperTypes().add(this.getJSType());
genericMethodEClass.getESuperTypes().add(this.getMethod());
+ typeVariableClassTypeEClass.getESuperTypes().add(this.getJSType());
// Initialize classes and features; add operations and parameters
initEClass(namedElementEClass, NamedElement.class, "NamedElement", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
@@ -1441,6 +1471,9 @@
initEAttribute(getTypeLiteral_Name(), ecorePackage.getEString(), "name", null, 0, 1, TypeLiteral.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEReference(getTypeLiteral_Target(), this.getType(), null, "target", null, 0, 1, TypeLiteral.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEClass(typeVariableClassTypeEClass, TypeVariableClassType.class, "TypeVariableClassType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEReference(getTypeVariableClassType_Variable(), this.getTypeVariable(), null, "variable", null, 0, 1, TypeVariableClassType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+
// Initialize enums and add enum literals
initEEnum(typeKindEEnum, TypeKind.class, "TypeKind"); //$NON-NLS-1$
addEEnumLiteral(typeKindEEnum, TypeKind.DEFAULT);
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/impl/TypeVariableClassTypeImpl.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/impl/TypeVariableClassTypeImpl.java
new file mode 100644
index 0000000..abe8357
--- /dev/null
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/impl/TypeVariableClassTypeImpl.java
@@ -0,0 +1,174 @@
+/**
+ * Copyright (c) 2011 NumberFour AG
+ *
+ * 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:
+ * NumberFour AG - initial API and Implementation (Alex Panchenko)
+ */
+package org.eclipse.dltk.javascript.typeinfo.model.impl;
+
+import org.eclipse.dltk.javascript.typeinfo.JSDocTypeParser;
+import org.eclipse.dltk.javascript.typeinfo.model.TypeInfoModelPackage;
+import org.eclipse.dltk.javascript.typeinfo.model.TypeVariable;
+import org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Type Variable Class Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.dltk.javascript.typeinfo.model.impl.TypeVariableClassTypeImpl#getVariable <em>Variable</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class TypeVariableClassTypeImpl extends EObjectImpl implements TypeVariableClassType {
+ /**
+ * The cached value of the '{@link #getVariable() <em>Variable</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVariable()
+ * @generated
+ * @ordered
+ */
+ protected TypeVariable variable;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TypeVariableClassTypeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return TypeInfoModelPackage.Literals.TYPE_VARIABLE_CLASS_TYPE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TypeVariable getVariable() {
+ if (variable != null && variable.eIsProxy()) {
+ InternalEObject oldVariable = (InternalEObject)variable;
+ variable = (TypeVariable)eResolveProxy(oldVariable);
+ if (variable != oldVariable) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, TypeInfoModelPackage.TYPE_VARIABLE_CLASS_TYPE__VARIABLE, oldVariable, variable));
+ }
+ }
+ return variable;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TypeVariable basicGetVariable() {
+ return variable;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVariable(TypeVariable newVariable) {
+ TypeVariable oldVariable = variable;
+ variable = newVariable;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, TypeInfoModelPackage.TYPE_VARIABLE_CLASS_TYPE__VARIABLE, oldVariable, variable));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public String getName() {
+ return variable != null ? JSDocTypeParser.CLASS + "<"
+ + variable.getName() + ">" : JSDocTypeParser.CLASS;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case TypeInfoModelPackage.TYPE_VARIABLE_CLASS_TYPE__VARIABLE:
+ if (resolve) return getVariable();
+ return basicGetVariable();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case TypeInfoModelPackage.TYPE_VARIABLE_CLASS_TYPE__VARIABLE:
+ setVariable((TypeVariable)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case TypeInfoModelPackage.TYPE_VARIABLE_CLASS_TYPE__VARIABLE:
+ setVariable((TypeVariable)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case TypeInfoModelPackage.TYPE_VARIABLE_CLASS_TYPE__VARIABLE:
+ return variable != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //TypeVariableClassTypeImpl
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/util/TypeInfoModelAdapterFactory.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/util/TypeInfoModelAdapterFactory.java
index 584d6f0..2e4fcb0 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/util/TypeInfoModelAdapterFactory.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/util/TypeInfoModelAdapterFactory.java
@@ -9,7 +9,7 @@
* Contributors:
* xored software, Inc. - initial API and Implementation (Alex Panchenko)
*
- * $Id: TypeInfoModelAdapterFactory.java,v 1.20 2012/04/23 06:18:12 apanchenk Exp $
+ * $Id: TypeInfoModelAdapterFactory.java,v 1.21 2012/06/12 10:40:32 apanchenk Exp $
*/
package org.eclipse.dltk.javascript.typeinfo.model.util;
@@ -204,6 +204,10 @@
return createTypeLiteralAdapter();
}
@Override
+ public Adapter caseTypeVariableClassType(TypeVariableClassType object) {
+ return createTypeVariableClassTypeAdapter();
+ }
+ @Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@@ -434,6 +438,20 @@
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType <em>Type Variable Class Type</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.dltk.javascript.typeinfo.model.TypeVariableClassType
+ * @generated
+ */
+ public Adapter createTypeVariableClassTypeAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.dltk.javascript.typeinfo.model.MapType <em>Map Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/util/TypeInfoModelSwitch.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/util/TypeInfoModelSwitch.java
index 0b533be..056eaab 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/util/TypeInfoModelSwitch.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/typeinfo/model/util/TypeInfoModelSwitch.java
@@ -9,7 +9,7 @@
* Contributors:
* xored software, Inc. - initial API and Implementation (Alex Panchenko)
*
- * $Id: TypeInfoModelSwitch.java,v 1.20 2012/04/23 06:18:12 apanchenk Exp $
+ * $Id: TypeInfoModelSwitch.java,v 1.21 2012/06/12 10:40:32 apanchenk Exp $
*/
package org.eclipse.dltk.javascript.typeinfo.model.util;
@@ -360,6 +360,13 @@
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case TypeInfoModelPackage.TYPE_VARIABLE_CLASS_TYPE: {
+ TypeVariableClassType typeVariableClassType = (TypeVariableClassType)theEObject;
+ T result = caseTypeVariableClassType(typeVariableClassType);
+ if (result == null) result = caseJSType(typeVariableClassType);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default: return defaultCase(theEObject);
}
}
@@ -695,6 +702,21 @@
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Type Variable Class Type</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Type Variable Class Type</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseTypeVariableClassType(TypeVariableClassType object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Element</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;