Author: scabanovich
Date: 2011-02-04 10:21:37 -0500 (Fri, 04 Feb 2011)
New Revision: 29007
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
Log:
JBIDE-8325
https://issues.jboss.org/browse/JBIDE-8325
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java 2011-02-04
15:00:24 UTC (rev 29006)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java 2011-02-04
15:21:37 UTC (rev 29007)
@@ -459,4 +459,6 @@
* <interceptors> of beans.xml by its full qualified type name.
*/
List<INodeReference> getInterceptorClasses(String fullQualifiedTypeName);
+
+ List<IInjectionPoint> getInjections(String fullyQualifiedTypeName);
}
\ No newline at end of file
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-02-04
15:00:24 UTC (rev 29006)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-02-04
15:21:37 UTC (rev 29007)
@@ -1324,6 +1324,34 @@
return getBeans(attemptToResolveAmbiguousDependency, beanType, qualifiers.toArray(new
IType[0]));
}
+ public List<IInjectionPoint> getInjections(String fullyQualifiedTypeName) {
+ List<IInjectionPoint> result = new ArrayList<IInjectionPoint>();
+
+ IType type = null;
+ try {
+ type = EclipseJavaUtil.findType(EclipseUtil.getJavaProject(getNature().getProject()),
fullyQualifiedTypeName);
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ if(type == null) {
+ return result;
+ }
+ IParametedType pType = getNature().getTypeFactory().newParametedType(type);
+ Set<IParametedType> types = ((ParametedType)pType).getAllTypes();
+ IBean[] beans = getBeans();
+ for (IBean b: beans) {
+ Set<IInjectionPoint> ps = b.getInjectionPoints();
+ for (IInjectionPoint p: ps) {
+ IParametedType t = p.getType();
+ if(containsType(types, t)) {
+ result.add(p);
+ }
+ }
+ }
+
+ return result;
+ }
+
/**
* For usage in TCK tests which contain many versions of beans.xml in packages.
* @param path