Author: akazakov
Date: 2009-11-23 15:46:27 -0500 (Mon, 23 Nov 2009)
New Revision: 18792
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointField.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointParameter.java
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/IInjectionPoint.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
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 2009-11-23
18:43:21 UTC (rev 18791)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java 2009-11-23
20:46:27 UTC (rev 18792)
@@ -20,17 +20,24 @@
public interface IBeanManager {
/**
- * Returns the set of beans which match the given EL name
+ * Returns the set of beans which match the given EL name.
*
* @param name
* the name used to restrict the beans matched
+ * @param attemptToResolveAmbiguousNames
+ * if there are a few beans with the given name and
+ * attemptToResolveAmbiguousNames==true the manager should try to
+ * resolve the EL name. If any of the beans are alternatives, the
+ * manager will eliminate all beans that are not alternatives,
+ * expect for producer methods and fields of beans that are
+ * alternatives.
* @return the matched beans
*/
- Set<IBean> getBeans(String name);
+ Set<IBean> getBeans(String name, boolean attemptToResolveAmbiguousNames);
/**
- * Returns the set of beans which have the given required type and qualifier type
- * If no qualifiers are given, the
+ * Returns the set of beans which have the given required type and qualifier
+ * type If no qualifiers are given, the
* {@linkplain javax.enterprise.inject.Default default qualifier} is
* assumed.
*
@@ -40,5 +47,14 @@
* the required qualifiers
* @return the resulting set of beans
*/
- Set<IBean> getBeans(IType beanType, IType... qualifierTypes);
+ Set<IBean> getBeans(IType beanType, IAnnotationDeclaration... qualifiers);
+
+ /**
+ * Returns the set of beans which are eligible for the given injection
+ * points.
+ *
+ * @param injectionPoints
+ * @return the resulting set of beans
+ */
+ Set<IBean> getBeans(IInjectionPoint injectionPoints);
}
\ No newline at end of file
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPoint.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPoint.java 2009-11-23
18:43:21 UTC (rev 18791)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPoint.java 2009-11-23
20:46:27 UTC (rev 18792)
@@ -12,43 +12,30 @@
import java.util.Set;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IJavaElement;
-import org.jboss.tools.common.text.ITextSourceReference;
+import org.eclipse.jdt.core.IType;
/**
* Represents an injection point.
*
* @author Alexey Kazakov
*/
-public interface IInjectionPoint extends ICDIElement, ITextSourceReference {
+public interface IInjectionPoint extends ICDIElement, IBeanMember {
/**
- * Gets the required qualifiers of the injection point.
+ * Returns the required type of this injection point.
*
- * @return the required qualifiers
+ * @return the required type of this injection point.
*/
- Set<IAnnotation> getQualifiers();
+ IType getType();
/**
- * Gets the object representing the bean that defines the injection point. If
- * the injection point does not belong to a bean, return a null value.
+ * Gets the required qualifiers of the injection point.
*
- * @return the object representing bean that defines the injection point, of
- * null if the injection point does not belong to a bean
+ * @return the required qualifiers
*/
- IBean getBean();
+ Set<IAnnotationDeclaration> getQualifierDeclarations();
/**
- * Obtains an instance of IMember or ITypeParameter, depending upon whether
- * the injection point is an injected field or a constructor/method
- * parameter.
- *
- * @return an IMember or ITypeParameter
- */
- IJavaElement getSourceElement();
-
- /**
* Determines if the injection point is a decorator delegate injection
* point.
*
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointField.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointField.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointField.java 2009-11-23
20:46:27 UTC (rev 18792)
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.core;
+
+/**
+ * Represents an injection point which is a filed of a bean class.
+ *
+ * @author Alexey Kazakov
+ */
+public interface IInjectionPointField extends IBeanField, IInjectionPoint {
+
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointParameter.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointParameter.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointParameter.java 2009-11-23
20:46:27 UTC (rev 18792)
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.core;
+
+/**
+ * Represents an injection point which is a parameter of a method.
+ *
+ * @author Alexey Kazakov
+ */
+public interface IInjectionPointParameter extends IParameter, IInjectionPoint {
+
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPointParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain