Author: scabanovich
Date: 2011-05-12 12:27:35 -0400 (Thu, 12 May 2011)
New Revision: 31243
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IValidatorFeature.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionFactory.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
JBIDE-8940
https://issues.jboss.org/browse/JBIDE-8940
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionFactory.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionFactory.java 2011-05-12
16:22:40 UTC (rev 31242)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionFactory.java 2011-05-12
16:27:35 UTC (rev 31243)
@@ -25,6 +25,7 @@
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedMemberFeature;
import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedTypeFeature;
+import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
/**
* Loads Eclipse extension point 'org.jboss.tools.cdi.core.cdiextensions'
@@ -50,7 +51,8 @@
IBuildParticipantFeature.class,
IProcessAnnotatedMemberFeature.class,
IProcessAnnotatedTypeFeature.class,
- IAmbiguousBeanResolverFeature.class
+ IAmbiguousBeanResolverFeature.class,
+ IValidatorFeature.class
};
public static CDIExtensionFactory getInstance() {
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java 2011-05-12
16:22:40 UTC (rev 31242)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java 2011-05-12
16:27:35 UTC (rev 31243)
@@ -21,6 +21,7 @@
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedMemberFeature;
import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedTypeFeature;
+import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
/**
*
@@ -159,6 +160,14 @@
return result;
}
+ public Set<IValidatorFeature> getValidatorFeature() {
+ Set<IValidatorFeature> result = featureStorage.validator;
+ if(result == null) {
+ featureStorage.validator = result = getFeature(IValidatorFeature.class);
+ }
+ return result;
+ }
+
private <F extends Object> Set<F> getFeature(Class<F> cls) {
Set<F> result = new HashSet<F>();
Set<ICDIExtension> extensions = getExtensions(cls);
@@ -178,12 +187,14 @@
Set<IProcessAnnotatedMemberFeature> processAnnotatedMember = null;
Set<IProcessAnnotatedTypeFeature> processAnnotatedType = null;
Set<IAmbiguousBeanResolverFeature> ambiguousBeanResolver = null;
+ Set<IValidatorFeature> validator = null;
void clean() {
processAnnotatedMember = null;
processAnnotatedType = null;
buildParticipant = null;
ambiguousBeanResolver = null;
+ validator = null;
}
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IValidatorFeature.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IValidatorFeature.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IValidatorFeature.java 2011-05-12
16:27:35 UTC (rev 31243)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.core.extension.feature;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public interface IValidatorFeature {
+
+ /**
+ * Contributes to validation of resource in CDICoreValidator.validateResource(IFile)
+ *
+ * @param file
+ * @param context
+ */
+ public void validateResource(IFile file, CDICoreValidator validator);
+
+}
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IValidatorFeature.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-05-12
16:22:40 UTC (rev 31242)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-05-12
16:27:35 UTC (rev 31243)
@@ -85,6 +85,7 @@
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.core.IStereotyped;
import org.jboss.tools.cdi.core.ITypeDeclaration;
+import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
import org.jboss.tools.cdi.core.preferences.CDIPreferences;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
import org.jboss.tools.cdi.internal.core.impl.ParametedType;
@@ -404,6 +405,10 @@
IInterceptorBinding binding = cdiProject.getInterceptorBinding(file.getFullPath());
validateInterceptorBinding(binding);
}
+ Set<IValidatorFeature> extensions =
cdiProject.getNature().getExtensionManager().getValidatorFeature();
+ for (IValidatorFeature v: extensions) {
+ v.validateResource(file, this);
+ }
}
Set<IFolder> getSourceFoldersForProjectsSet() {