Author: scabanovich
Date: 2011-10-07 15:13:28 -0400 (Fri, 07 Oct 2011)
New Revision: 35477
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderServletExtension.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderConstants30.java
Log:
JBIDE-9852
https://issues.jboss.org/browse/JBIDE-9852
Seam servlet migrated to 3.1.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml 2011-10-07 18:27:24
UTC (rev 35476)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml 2011-10-07 19:13:28
UTC (rev 35477)
@@ -34,6 +34,11 @@
</cdiextension>
<cdiextension
+
class="org.jboss.tools.cdi.seam.solder.core.CDISeamSolderServletExtension"
+ runtime="org.jboss.solder.servlet.ServletExtension">
+ </cdiextension>
+
+ <cdiextension
class="org.jboss.tools.cdi.seam.solder.core.CDISeamSolder30CoreExtension"
runtime="org.jboss.seam.solder.core.CoreExtension">
</cdiextension>
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderConstants30.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderConstants30.java 2011-10-07
18:27:24 UTC (rev 35476)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderConstants30.java 2011-10-07
19:13:28 UTC (rev 35477)
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.solder.core;
-import org.jboss.tools.cdi.core.CDIConstants;
-
/**
*
* @author Viacheslav Kabanovich
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderServletExtension.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderServletExtension.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderServletExtension.java 2011-10-07
19:13:28 UTC (rev 35477)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.seam.solder.core;
+
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInjectionPointParameter;
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+import org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature;
+import org.jboss.tools.common.java.IAnnotated;
+
+/**
+ * Solder version 3.1
+ *
+ * @author Alexey Kazakov
+ */
+public class CDISeamSolderServletExtension implements ICDIExtension,
IInjectionPointValidatorFeature {
+ private final static String SEAM_SERVLET_HTTP_PACKAGE_NAME =
"org.jboss.solder.servlet.http";
+
+ private final static String SEAM_SERVLET_REQUEST_PARAM_TYPE_NAME =
SEAM_SERVLET_HTTP_PACKAGE_NAME + ".RequestParam";
+ private final static String SEAM_SERVLET_HEADER_PARAM_TYPE_NAME =
SEAM_SERVLET_HTTP_PACKAGE_NAME + ".HeaderParam";
+ private final static String SEAM_SERVLET_COOKIE_PARAM_TYPE_NAME =
SEAM_SERVLET_HTTP_PACKAGE_NAME + ".CookieParam";
+
+ /**
+ * If the injection point annotated @RequestParam, @HeaderParam or @CookieParam then
don't try to resolve it.
+ * See
https://issues.jboss.org/browse/JBIDE-9389
+ *
+ * @see
org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature#shouldIgnoreInjection(org.eclipse.jdt.core.IType,
org.jboss.tools.cdi.core.IInjectionPoint)
+ */
+ @Override
+ public boolean shouldIgnoreInjection(IType typeOfInjectionPoint, IInjectionPoint
injection) {
+ IAnnotated annotated = injection;
+ if(injection instanceof IInjectionPointParameter) {
+ IInjectionPointParameter param = (IInjectionPointParameter)injection;
+ annotated = param.getBeanMethod();
+ }
+
+ return annotated.getAnnotation(SEAM_SERVLET_COOKIE_PARAM_TYPE_NAME) != null
+ || annotated.getAnnotation(SEAM_SERVLET_HEADER_PARAM_TYPE_NAME) != null
+ || annotated.getAnnotation(SEAM_SERVLET_REQUEST_PARAM_TYPE_NAME) != null;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderServletExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain