[jbosstools-commits] JBoss Tools SVN: r41180 - in trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core: .settings and 8 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri May 18 20:09:04 EDT 2012


Author: scabanovich
Date: 2012-05-18 20:09:03 -0400 (Fri, 18 May 2012)
New Revision: 41180

Added:
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.classpath
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.project
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.settings/
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.settings/org.eclipse.jdt.core.prefs
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/META-INF/
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/META-INF/MANIFEST.MF
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/about.html
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/build.properties
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.properties
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.xml
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/pom.xml
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConfigPropertyExtension.java
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConstants.java
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeCorePlugin.java
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExceptionExtension.java
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExcludeExtension.java
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeMessageBundleExtension.java
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityExtension.java
   trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java
Log:
JBIDE-11552
https://issues.jboss.org/browse/JBIDE-11552
Initial implementation


Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.classpath
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.classpath	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.classpath	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.project
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.project	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.project	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.jboss.tools.cdi.deltaspike.core</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.settings/org.eclipse.jdt.core.prefs	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/META-INF/MANIFEST.MF	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Seam Faces Core
+Bundle-SymbolicName: org.jboss.tools.cdi.deltaspike.core;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.jboss.tools.cdi.deltaspike.core.DeltaspikeCorePlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.jboss.tools.common,
+ org.jboss.tools.common.el.core,
+ org.jboss.tools.common.validation,
+ org.jboss.tools.jst.web.kb,
+ org.jboss.tools.cdi.core,
+ org.jboss.tools.cdi.seam.solder.core,
+ org.eclipse.jdt.core;bundle-version="3.7.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.jboss.tools.cdi.deltaspike.core
+Bundle-Vendor: JBoss by Red Hat


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/about.html
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/about.html	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/about.html	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>&copy;2007 Red Hat, Inc. All rights reserved</P>
+
+<H3>License</H3>
+
+<P>Red Hat Inc., through its JBoss division, makes available all content in this plug-in 
+("Content"). Unless otherwise indicated below, the Content is provided to you 
+under the terms and conditions of the Eclipse Public License Version 1.0 
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>. 
+For purposes of the EPL, "Program" will mean the Content.</P>
+
+<P>If you did not receive this Content directly from Red Hat Inc., the 
+Content is being redistributed by another party ("Redistributor") and different 
+terms and conditions may apply to your use of any object code in the Content. 
+Check the Redistributor's license that was provided with the Content. If no such 
+license exists, contact the Redistributor. Unless otherwise indicated below, the 
+terms and conditions of the EPL still apply to any source code in the Content 
+and such source code may be obtained at
+  <A href="http://www.jboss.org/tools">http://www.jboss.org/tools</A>.</P>
+
+</BODY>
+</HTML>
\ No newline at end of file


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/about.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/build.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/build.properties	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/build.properties	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               plugin.properties,\
+               about.html


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/build.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.xml	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.xml	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+	<extension
+	      point="org.jboss.tools.cdi.core.cdiextensions">
+	    <cdiextension
+	          class="org.jboss.tools.cdi.deltaspike.core.DeltaspikeConfigPropertyExtension"
+	          runtime="org.apache.deltaspike.core.impl.config.injectable.extension.ConfigPropertyExtension">
+	    </cdiextension>
+	    <cdiextension
+	          class="org.jboss.tools.cdi.deltaspike.core.DeltaspikeExceptionExtension"
+	          runtime="org.apache.deltaspike.core.impl.exception.control.extension.ExceptionControlExtension">
+	    </cdiextension>
+	    <cdiextension
+	          class="org.jboss.tools.cdi.deltaspike.core.DeltaspikeExcludeExtension"
+	          runtime="org.apache.deltaspike.core.impl.exclude.extension.ExcludeExtension">
+	    </cdiextension>
+	    <cdiextension
+	          class="org.jboss.tools.cdi.deltaspike.core.DeltaspikeMessageBundleExtension"
+	          runtime="org.apache.deltaspike.core.impl.message.MessageBundleExtension">
+	    </cdiextension>
+	    <cdiextension
+	          class="org.jboss.tools.cdi.deltaspike.core.DeltaspikeSecurityExtension"
+	          runtime="org.apache.deltaspike.security.impl.authorization.SecurityExtension">
+	    </cdiextension>
+	</extension>
+
+</plugin>


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/pom.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/pom.xml	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/pom.xml	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion> 
+	<parent>
+		<groupId>org.jboss.tools.cdi</groupId>
+		<artifactId>plugins</artifactId>
+		<version>1.2.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.jboss.tools.cdi.plugins</groupId>
+	<artifactId>org.jboss.tools.cdi.deltaspike.core</artifactId> 
+	
+	<packaging>eclipse-plugin</packaging>
+</project>


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConfigPropertyExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConfigPropertyExtension.java	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConfigPropertyExtension.java	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,35 @@
+/******************************************************************************* 
+ * Copyright (c) 2012 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.deltaspike.core;
+
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+import org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature;
+
+/**
+ * Runtime
+ * org.apache.deltaspike.core.impl.config.injectable.extension.ConfigPropertyExtension
+ * 
+ * @author Viacheslav Kabanovich
+ */
+public class DeltaspikeConfigPropertyExtension implements ICDIExtension, IInjectionPointValidatorFeature, DeltaspikeConstants {
+
+	@Override
+	public boolean shouldIgnoreInjection(IType typeOfInjectionPoint,
+			IInjectionPoint injection) {
+		if(injection.getAnnotation(CONFIG_PROPERTY_ANNOTATION_TYPE_NAME) != null) {
+			return true;
+		}
+		return false;
+	}
+
+}


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConfigPropertyExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConstants.java	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConstants.java	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,35 @@
+/******************************************************************************* 
+ * Copyright (c) 2012 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.deltaspike.core;
+
+public interface DeltaspikeConstants {
+
+	public String CONFIG_PROPERTY_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.core.api.config.annotation.ConfigProperty"; //$NON-NLS-1$
+
+	public String BEFORE_HANDLES_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.core.api.exception.control.annotation.BeforeHandles"; //$NON-NLS-1$
+	public String EXCEPTION_HANDLER_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.core.api.exception.control.annotation.ExceptionHandler"; //$NON-NLS-1$
+	public String HANDLES_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.core.api.exception.control.annotation.Handles"; //$NON-NLS-1$
+	public String EXCEPTION_EVENT_TYPE_NAME = "org.apache.deltaspike.core.api.exception.control.event.ExceptionEvent"; //$NON-NLS-1$
+
+	public String EXCLUDE_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.core.api.exclude.annotation.Exclude"; //$NON-NLS-1$
+
+	public String MESSAGE_BUNDLE_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.core.api.message.annotation.MessageBundle"; //$NON-NLS-1$
+	public String MESSAGE_CONTEXT_CONFIG_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.core.api.message.annotation.MessageContextConfig"; //$NON-NLS-1$
+	public String MESSAGE_TEMPLATE_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.core.api.message.annotation.MessageTemplate"; //$NON-NLS-1$
+
+	public String SECURED_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.security.api.authorization.annotation.Secured"; //$NON-NLS-1$
+	public String SECURES_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.security.api.authorization.annotation.Secures"; //$NON-NLS-1$
+	public String SECURITY_BINDING_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.security.api.authorization.annotation.SecurityBindingType"; //$NON-NLS-1$
+	public String SECURITY_PARAM_BINDING_ANNOTATION_TYPE_NAME = "org.apache.deltaspike.security.api.authorization.annotation.SecurityParameterBinding"; //$NON-NLS-1$
+
+	public String MESSAGE_BUNDLE_ANNOTATION_KIND = "messageBundleAnnotation";
+
+}


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeConstants.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeCorePlugin.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeCorePlugin.java	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeCorePlugin.java	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,41 @@
+/******************************************************************************* 
+ * Copyright (c) 2012 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.deltaspike.core;
+
+import org.jboss.tools.common.log.BaseUIPlugin;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class DeltaspikeCorePlugin extends BaseUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.jboss.tools.cdi.deltaspike.core"; //$NON-NLS-1$
+
+	// The shared instance
+	private static DeltaspikeCorePlugin plugin;
+
+	/**
+	 * The constructor
+	 */
+	public DeltaspikeCorePlugin() {
+		plugin = this;
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static DeltaspikeCorePlugin getDefault() {
+		return plugin;
+	}
+}


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeCorePlugin.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExceptionExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExceptionExtension.java	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExceptionExtension.java	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,120 @@
+/******************************************************************************* 
+ * Copyright (c) 2012 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.deltaspike.core;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMemberValuePair;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IBeanMethod;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IParameter;
+import org.jboss.tools.cdi.core.IRootDefinitionContext;
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedMemberFeature;
+import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
+import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.BeanMemberDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.ParameterDefinition;
+import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
+import org.jboss.tools.common.java.IAnnotated;
+import org.jboss.tools.common.java.IAnnotationDeclaration;
+import org.jboss.tools.common.java.IJavaAnnotation;
+import org.jboss.tools.common.java.impl.AnnotationLiteral;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+
+/**
+ * Runtime
+ * org.apache.deltaspike.core.impl.exception.control.extension.ExceptionControlExtension
+ * 
+ * @author Viacheslav Kabanovich
+ */
+public class DeltaspikeExceptionExtension implements ICDIExtension, IProcessAnnotatedMemberFeature, IValidatorFeature, DeltaspikeConstants {
+
+	@Override
+	public void processAnnotatedMember(BeanMemberDefinition memberDefinition,
+			IRootDefinitionContext context) {
+		if(memberDefinition instanceof ParameterDefinition) {
+			ParameterDefinition p = (ParameterDefinition)memberDefinition;
+			if(isHandler(p)) {
+				IJavaAnnotation ja = createFakeObservesAnnotation(memberDefinition, context);
+				if(ja != null) {
+					p.addAnnotation(ja, context);
+				}
+			}
+		}		
+	}
+
+	private boolean isHandler(IAnnotated p) {
+		 return p.isAnnotationPresent(HANDLES_ANNOTATION_TYPE_NAME) || p.isAnnotationPresent(BEFORE_HANDLES_ANNOTATION_TYPE_NAME);
+	}
+
+	@Override
+	public void validateResource(IFile file, CDICoreValidator validator) {
+		ICDIProject cdi = CDICorePlugin.getCDIProject(file.getProject(), true);
+		Set<IBean> beans = cdi.getBeans(file.getFullPath());
+		for (IBean b: beans) {
+			if(b instanceof IClassBean) {
+				IClassBean cb = (IClassBean)b;
+				if(cb.getAnnotation(EXCEPTION_HANDLER_ANNOTATION_TYPE_NAME) != null) {
+					Set<IBeanMethod> ms = cb.getAllMethods();
+					for (IBeanMethod m: ms) {
+						for (IParameter p: m.getParameters()) {
+							if(isHandler(p)) {
+								IType t = p.getType().getType();
+								if(t != null && !EXCEPTION_EVENT_TYPE_NAME.equals(t.getFullyQualifiedName())) {
+									//TODO add error marker
+									System.out.println("wrong handler");
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		
+	}
+
+	/**
+	 * Returns new annotation object with Produces type if definition is annotated with Unwraps
+	 * and Produces type is available in class path. Returns null otherwise.
+	 * 
+	 * @param def
+	 * @param context
+	 * @return new annotation object with Produces type or null
+	 */
+	IJavaAnnotation createFakeObservesAnnotation(AbstractMemberDefinition def, IRootDefinitionContext context) {
+		IJavaAnnotation result = null;
+		IAnnotationDeclaration a = def.getAnnotation(HANDLES_ANNOTATION_TYPE_NAME);
+		if(a == null) a = def.getAnnotation(BEFORE_HANDLES_ANNOTATION_TYPE_NAME);
+		if(a != null) {
+			IType producesAnnotation = context.getProject().getType(CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME);
+			if (producesAnnotation != null) {
+				AnnotationLiteral literal  = new AnnotationLiteral(def.getResource(), a.getStartPosition(), a.getLength(), null, IMemberValuePair.K_UNKNOWN, producesAnnotation);
+				literal.setParentElement((IJavaElement)def.getMember());
+				result = literal;
+			}
+		}
+		return result;
+	}
+	@Override
+	public SeverityPreferences getSeverityPreferences() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+}


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExceptionExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExcludeExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExcludeExtension.java	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExcludeExtension.java	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,44 @@
+/******************************************************************************* 
+ * Copyright (c) 2012 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.deltaspike.core;
+
+import org.jboss.tools.cdi.core.IRootDefinitionContext;
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedTypeFeature;
+import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
+
+/**
+ * Runtime
+ * org.apache.deltaspike.core.impl.exclude.extension.ExcludeExtension
+ * 
+ * @author Viacheslav Kabanovich
+ */
+public class DeltaspikeExcludeExtension implements ICDIExtension, IProcessAnnotatedTypeFeature, DeltaspikeConstants {
+
+	public DeltaspikeExcludeExtension() {
+	}
+
+	@Override
+	public void processAnnotatedType(TypeDefinition typeDefinition, IRootDefinitionContext context) {
+		processExclude(typeDefinition, context);
+	}
+
+	// @Exclude
+	private boolean processExclude(TypeDefinition typeDefinition, IRootDefinitionContext context) {
+		if (typeDefinition.isAnnotationPresent(EXCLUDE_ANNOTATION_TYPE_NAME)
+				|| (typeDefinition.getPackageDefinition() != null && typeDefinition
+						.getPackageDefinition().isAnnotationPresent(EXCLUDE_ANNOTATION_TYPE_NAME))) {
+			typeDefinition.veto();
+			return true;
+		}
+		return false;
+	}
+}


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExcludeExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeMessageBundleExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeMessageBundleExtension.java	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeMessageBundleExtension.java	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,156 @@
+/******************************************************************************* 
+ * Copyright (c) 2012 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.deltaspike.core;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.extension.AbstractDefinitionContextExtension;
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+import org.jboss.tools.cdi.core.extension.IDefinitionContextExtension;
+import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
+import org.jboss.tools.cdi.internal.core.impl.CDIProject;
+import org.jboss.tools.cdi.internal.core.impl.ClassBean;
+import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
+import org.jboss.tools.cdi.internal.core.scanner.FileSet;
+import org.jboss.tools.cdi.seam.solder.core.definition.InterfaceDefinition;
+import org.jboss.tools.common.java.IAnnotationDeclaration;
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ * Runtime
+ * org.apache.deltaspike.core.impl.message.MessageBundleExtension
+ * 
+ * @author Viacheslav Kabanovich
+ */
+public class DeltaspikeMessageBundleExtension implements ICDIExtension, IBuildParticipantFeature, DeltaspikeConstants {
+	DeltaspikeMessageBundleDefinitionContext context = new DeltaspikeMessageBundleDefinitionContext();
+
+	public IDefinitionContextExtension getContext() {
+		return context;
+	}
+
+	public void beginVisiting() {
+	}
+
+	public void visitJar(IPath path, IPackageFragmentRoot root, XModelObject beansXML) {
+	}
+
+	public void visit(IFile file, IPath src, IPath webinf) {
+	}
+
+	public void buildDefinitions() {
+	}
+
+	public void buildDefinitions(FileSet fileSet) {
+		DeltaspikeMessageBundleDefinitionContext workingCopy = (DeltaspikeMessageBundleDefinitionContext)context.getWorkingCopy();
+		
+		Map<IPath, Set<IType>> is = fileSet.getInterfaces();
+		for (IPath path: is.keySet()) {
+			Set<IType> ts = is.get(path);
+			for (IType t: ts) {
+				InterfaceDefinition i = new InterfaceDefinition(t, context);
+				List<IAnnotationDeclaration> as = i.getAnnotations();
+				for (IAnnotationDeclaration a: as) {
+					if(workingCopy.isMessageBundleAnnotation(a.getType())) {
+						TypeDefinition d = new TypeDefinition();
+						d.setType(t, workingCopy.getRootContext(), 0);
+						d.setBeanConstructor(true);
+						workingCopy.addMessageBundle(path, d);
+					}
+				}
+			}
+		}
+	}
+
+	public void buildBeans(CDIProject target) {
+		CDIProject p = target;
+		Map<String, TypeDefinition> services = context.getMessageBundles();
+		for (TypeDefinition d: services.values()) {
+			ClassBean b = new ClassBean();
+			b.setDefinition(d);
+			b.setParent(p);
+			p.addBean(b);
+		}
+
+	}
+
+	class DeltaspikeMessageBundleDefinitionContext extends AbstractDefinitionContextExtension {
+		Set<String> messageBundleAnnotations = new HashSet<String>();
+		Map<String, TypeDefinition> messageBundles = new HashMap<String, TypeDefinition>();
+	
+
+		protected DeltaspikeMessageBundleDefinitionContext copy(boolean clean) {
+			DeltaspikeMessageBundleDefinitionContext copy = new DeltaspikeMessageBundleDefinitionContext();
+			copy.root = root;
+			if(!clean) {
+				for (String qn: messageBundles.keySet()) {
+					TypeDefinition d = messageBundles.get(qn);
+					if(d.exists()) {
+						copy.messageBundles.put(qn, d);
+					}
+				}
+				copy.messageBundleAnnotations.addAll(messageBundleAnnotations);
+			}
+
+			return copy;
+		}
+
+		@Override
+		protected void doApplyWorkingCopy() {
+			messageBundles = ((DeltaspikeMessageBundleDefinitionContext)workingCopy).messageBundles;
+			messageBundleAnnotations = ((DeltaspikeMessageBundleDefinitionContext)workingCopy).messageBundleAnnotations;
+		}
+
+		@Override
+		public void clean() {
+			messageBundles.clear();
+			messageBundleAnnotations.clear();
+		}
+
+		@Override
+		public void clean(String typeName) {
+			messageBundles.remove(typeName);
+			messageBundleAnnotations.remove(typeName);
+		}
+
+		public void addMessageBundle(IPath path, TypeDefinition def) {
+			String typeName = def.getType().getFullyQualifiedName();
+			messageBundles.put(typeName, def);
+			root.addType(path, typeName);
+		}
+		
+		public Map<String, TypeDefinition> getMessageBundles() {
+			return messageBundles;
+		}
+
+		@Override
+		public void computeAnnotationKind(AnnotationDefinition annotation) {
+			if(annotation.isAnnotationPresent(MESSAGE_BUNDLE_ANNOTATION_TYPE_NAME)) {
+				annotation.setExtendedKind(MESSAGE_BUNDLE_ANNOTATION_KIND);
+				messageBundleAnnotations.add(annotation.getType().getFullyQualifiedName());
+			}
+		}
+
+		public boolean isMessageBundleAnnotation(IType type) {
+			return (type != null && 
+					(messageBundleAnnotations.contains(type.getFullyQualifiedName()) || MESSAGE_BUNDLE_ANNOTATION_TYPE_NAME.equals(type.getFullyQualifiedName())));
+		}
+	}
+}


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeMessageBundleExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityExtension.java	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityExtension.java	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,23 @@
+/******************************************************************************* 
+ * Copyright (c) 2012 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.deltaspike.core;
+
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+
+/**
+ * Runtime
+ * org.apache.deltaspike.security.impl.authorization.SecurityExtension
+ * 
+ * @author Viacheslav Kabanovich
+ */
+public class DeltaspikeSecurityExtension implements ICDIExtension {
+
+}


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSecurityExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java	2012-05-19 00:09:03 UTC (rev 41180)
@@ -0,0 +1,64 @@
+/******************************************************************************* 
+ * Copyright (c) 2012 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.deltaspike.core;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.tools.cdi.core.preferences.CDIPreferences;
+import org.jboss.tools.common.validation.ValidationSeverityPreferences;
+
+/**
+ * 
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class DeltaspikeSeverityPreferences extends ValidationSeverityPreferences {
+	private static final DeltaspikeSeverityPreferences INSTANCE = new DeltaspikeSeverityPreferences();
+
+	public static final Set<String> SEVERITY_OPTION_NAMES = new HashSet<String>();
+
+	public static final String WARNING_GROUP_ID = "deltaspike"; //$NON-NLS-1$
+
+	public static DeltaspikeSeverityPreferences getInstance() {
+		return INSTANCE;
+	}
+
+	private DeltaspikeSeverityPreferences() {}
+
+	@Override
+	public String getWarningGroupID() {
+		return WARNING_GROUP_ID;
+	}
+
+	@Override
+	protected String[] getParentWarningGroupIDs() {
+		return new String[]{CDIPreferences.WARNING_GROUP_ID};
+	}
+
+	@Override
+	protected Set<String> getSeverityOptionNames() {
+		return SEVERITY_OPTION_NAMES;
+	}
+
+	@Override
+	protected String createSeverityOption(String shortName) {
+		String name = getPluginId() + ".validator.problem." + shortName; //$NON-NLS-1$
+		SEVERITY_OPTION_NAMES.add(name);
+		return name;
+	}
+
+	@Override
+	protected String getPluginId() {
+		return DeltaspikeCorePlugin.PLUGIN_ID;
+	}
+
+}


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain



More information about the jbosstools-commits mailing list