Author: scabanovich
Date: 2009-12-15 11:56:03 -0500 (Tue, 15 Dec 2009)
New Revision: 19283
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointMethod.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/FieldDefinition.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java 2009-12-15
16:42:29 UTC (rev 19282)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java 2009-12-15
16:56:03 UTC (rev 19283)
@@ -58,6 +58,10 @@
this.classBean = classBean;
}
+ public IType getType() {
+ return typeDeclaration == null ? null : typeDeclaration.getType();
+ }
+
public int getLength() {
ISourceRange r = null;
try {
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2009-12-15
16:42:29 UTC (rev 19282)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2009-12-15
16:56:03 UTC (rev 19283)
@@ -58,6 +58,8 @@
BeanMethod bm = null;
if(m.getProducesAnnotation() != null) {
bm = new ProducerMethod();
+ } else if(m.getInjectAnnotation() != null) {
+ bm = new InjectionPointMethod();
} else {
//add observer case
bm = new BeanMethod();
@@ -159,7 +161,9 @@
}
}
for (BeanMethod m: methods) {
- //get parameters that are injection points
+ if(m instanceof IInjectionPoint) {
+ result.add((IInjectionPoint)m);
+ }
}
return result;
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java 2009-12-15
16:42:29 UTC (rev 19282)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java 2009-12-15
16:56:03 UTC (rev 19283)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl;
-import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IInjectionPointField;
@@ -27,10 +26,6 @@
return getDefinition().getDelegateAnnotation();
}
- public IType getType() {
- return typeDeclaration == null ? null : typeDeclaration.getType();
- }
-
public boolean isDelegate() {
return getDelegateAnnotation() != null;
}
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointMethod.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointMethod.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointMethod.java 2009-12-15
16:56:03 UTC (rev 19283)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.internal.core.impl;
+
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.IInjectionPointMethod;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class InjectionPointMethod extends BeanMethod implements
+ IInjectionPointMethod {
+
+ public IAnnotationDeclaration getDelegateAnnotation() {
+ return getDefinition().getDelegateAnnotation();
+ }
+
+ public boolean isDelegate() {
+ return getDelegateAnnotation() != null;
+ }
+
+}
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointMethod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java 2009-12-15
16:42:29 UTC (rev 19282)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java 2009-12-15
16:56:03 UTC (rev 19283)
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.IParametedType;
+import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
/**
@@ -50,7 +51,7 @@
String sc = type.getSuperclassTypeSignature();
if(sc != null) {
//TODO process parameter types correctly!!!
- sc = EclipseJavaUtil.resolveType(contextType, sc);
+ sc = EclipseJavaUtil.resolveTypeAsString(contextType, sc);
if(sc != null && sc.length() > 0) {
IType t = EclipseJavaUtil.findType(contextType.getJavaProject(), sc);
//TODO
@@ -59,7 +60,7 @@
}
String[] is = type.getSuperInterfaceTypeSignatures();
if(is != null) for (int i = 0; i < is.length; i++) {
- String c = EclipseJavaUtil.resolveType(contextType, is[i]);
+ String c = EclipseJavaUtil.resolveTypeAsString(contextType, is[i]);
if(c != null && c.length() > 0) {
IType t = EclipseJavaUtil.findType(contextType.getJavaProject(), c);
//TODO
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java 2009-12-15
16:42:29 UTC (rev 19282)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeanMemberDefinition.java 2009-12-15
16:56:03 UTC (rev 19283)
@@ -19,4 +19,8 @@
return annotationsByType.get(CDIConstants.INJECT_ANNOTATION_TYPE_NAME);
}
+ public AnnotationDeclaration getDelegateAnnotation() {
+ return annotationsByType.get(CDIConstants.DELEGATE_STEREOTYPE_TYPE_NAME);
+ }
+
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/FieldDefinition.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/FieldDefinition.java 2009-12-15
16:42:29 UTC (rev 19282)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/FieldDefinition.java 2009-12-15
16:56:03 UTC (rev 19283)
@@ -33,8 +33,4 @@
return field;
}
- public AnnotationDeclaration getDelegateAnnotation() {
- return annotationsByType.get(CDIConstants.DELEGATE_STEREOTYPE_TYPE_NAME);
- }
-
}