JBoss Tools SVN: r43229 - in trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-24 17:51:12 -0400 (Fri, 24 Aug 2012)
New Revision: 43229
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/TypeResolutionCache.java
Log:
JBIDE-12490
https://issues.jboss.org/browse/JBIDE-12490
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java 2012-08-24 20:21:29 UTC (rev 43228)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java 2012-08-24 21:51:12 UTC (rev 43229)
@@ -140,7 +140,7 @@
if(lastDot < 0) {
IField f = (a.getParent() == type) ? type.getField(lastToken) : EclipseJavaUtil.findField(type, lastToken);
if(f != null && f.exists()) {
- value = f.getDeclaringType().getFullyQualifiedName() + "." + lastToken;
+ value = f.getDeclaringType().getFullyQualifiedName() + "." + lastToken; //$NON-NLS-1$
} else {
String v = getFullName(type, is, lastToken);
if(v != null) {
@@ -150,13 +150,17 @@
return value;
}
String prefix = stringValue.substring(0, lastDot);
- String t = EclipseJavaUtil.resolveType(type, prefix);
- if(t != null) {
- IType q = EclipseJavaUtil.findType(type.getJavaProject(), t);
- if(q != null && q.getField(lastToken).exists()) {
- value = t + "." + lastToken;
+ String t = prefix;
+ IType q = EclipseJavaUtil.findType(type.getJavaProject(), prefix);
+ if(q == null) {
+ t = EclipseJavaUtil.resolveType(type, prefix);
+ if(t != null) {
+ q = EclipseJavaUtil.findType(type.getJavaProject(), t);
}
}
+ if(q != null && q.getField(lastToken).exists()) {
+ value = t + "." + lastToken; //$NON-NLS-1$
+ }
} catch (CoreException e) {
CommonPlugin.getDefault().logError(e);
@@ -169,16 +173,16 @@
private String getFullName(IType type, IImportDeclaration[] is, String name) throws CoreException {
for (IImportDeclaration d: is) {
String n = d.getElementName();
- if(n.equals(name) || n.endsWith("." + name)) {
+ if(n.equals(name) || n.endsWith("." + name)) { //$NON-NLS-1$
return n;
}
- if(Flags.isStatic(d.getFlags()) && n.endsWith(".*")) {
+ if(Flags.isStatic(d.getFlags()) && n.endsWith(".*")) { //$NON-NLS-1$
String typename = n.substring(0, n.length() - 2);
IType t = EclipseJavaUtil.findType(type.getJavaProject(), typename);
if(t != null && t.exists()) {
IField f = EclipseJavaUtil.findField(t, name);
if(f != null) {
- return f.getDeclaringType().getFullyQualifiedName() + "." + name;
+ return f.getDeclaringType().getFullyQualifiedName() + "." + name; //$NON-NLS-1$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java 2012-08-24 20:21:29 UTC (rev 43228)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java 2012-08-24 21:51:12 UTC (rev 43229)
@@ -66,6 +66,8 @@
public static String resolveTypeAsString(IType type, String typeName) {
if(type == null || typeName == null) return null;
typeName = new String(Signature.toCharArray(typeName.toCharArray()));
+ int i = typeName.indexOf(Signature.C_GENERIC_START);
+ if(i > 0) typeName = typeName.substring(0, i);
return resolveType(type, typeName);
}
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/TypeResolutionCache.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/TypeResolutionCache.java 2012-08-24 20:21:29 UTC (rev 43228)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/TypeResolutionCache.java 2012-08-24 21:51:12 UTC (rev 43229)
@@ -10,10 +10,19 @@
******************************************************************************/
package org.jboss.tools.common.util;
+import java.util.ArrayList;
+import java.util.HashSet;
import java.util.Hashtable;
+import java.util.List;
import java.util.Map;
+import java.util.Set;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IImportDeclaration;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
@@ -29,16 +38,125 @@
static class Resolved {
IType type;
Map<String, String> types = new Hashtable<String, String>();
+ List<String> classImports = new ArrayList<String>();
+ List<String> packageImports = new ArrayList<String>();
Resolved(IType type) {
this.type = type;
+ readImports();
}
void setType(IType type) {
this.type = type;
types.clear();
+
+ readImports();
}
+
+ void readImports() {
+ ICompilationUnit unit = type.getCompilationUnit();
+ if(unit == null) return;
+ IImportDeclaration[] ds = null;
+ try {
+ ds = unit.getImports();
+ } catch (JavaModelException e) {
+ CommonPlugin.getDefault().logError(e);
+ ds = new IImportDeclaration[0];
+ }
+ IResource r = unit.getResource();
+
+ if(r instanceof IFile && r.exists()) {
+ List<String> newClassImports = new ArrayList<String>();
+ List<String> newPackageImports = new ArrayList<String>();
+ //add local package
+ newPackageImports.add(type.getPackageFragment().getElementName() + "."); //$NON-NLS-1$
+ for (IImportDeclaration d: ds) {
+ String q = d.getElementName();
+ if(q.endsWith(".*")) { //$NON-NLS-1$
+ newPackageImports.add( q = q.substring(0, q.length() - 1));
+ } else {
+ newClassImports.add(q);
+ }
+ }
+ classImports = newClassImports;
+ packageImports = newPackageImports;
+ }
+ }
+
+ public String resolveInImports(String typeName) {
+ if(typeName.indexOf(".") >= 0) { //$NON-NLS-1$
+ try {
+ IType q = EclipseJavaUtil.findType(type.getJavaProject(), typeName);
+ if(q != null) {
+ types.put(typeName, typeName);
+ return typeName;
+ }
+ } catch (JavaModelException e) {
+ CommonPlugin.getDefault().logError(e);
+ }
+ //too difficult
+ return null;
+ }
+ for (String imp: classImports) {
+ if(imp.endsWith("." + typeName)) { //$NON-NLS-1$
+ types.put(typeName, imp);
+ return imp;
+ }
+ }
+ for (String imp: packageImports) {
+ String result = imp + typeName;
+ try {
+ IType q = EclipseJavaUtil.findType(type.getJavaProject(), result);
+ if(q != null) {
+ types.put(typeName, result);
+ return result;
+ }
+ } catch (JavaModelException e) {
+ CommonPlugin.getDefault().logError(e);
+ }
+ }
+ String pr = "java.lang." + typeName; //$NON-NLS-1$
+ if(primitive.contains(pr)) {
+ types.put(typeName, pr);
+ return pr;
+ }
+
+ if(type.getTypeParameter(typeName).exists()) {
+ types.put(typeName, typeName);
+ return typeName;
+ }
+ return null;
+ }
}
+ static Set<String> primitive = new HashSet<String>();
+ static {
+ primitive.add("void"); //$NON-NLS-1$
+ primitive.add("int"); //$NON-NLS-1$
+ primitive.add("char"); //$NON-NLS-1$
+ primitive.add("boolean"); //$NON-NLS-1$
+ primitive.add("long"); //$NON-NLS-1$
+ primitive.add("short"); //$NON-NLS-1$
+ primitive.add("double"); //$NON-NLS-1$
+ primitive.add("float"); //$NON-NLS-1$
+ primitive.add("java.lang.Object"); //$NON-NLS-1$
+ primitive.add("java.lang.Number"); //$NON-NLS-1$
+ primitive.add("java.lang.Integer"); //$NON-NLS-1$
+ primitive.add("java.lang.Character"); //$NON-NLS-1$
+ primitive.add("java.lang.Boolean"); //$NON-NLS-1$
+ primitive.add("java.lang.Long"); //$NON-NLS-1$
+ primitive.add("java.lang.Short"); //$NON-NLS-1$
+ primitive.add("java.lang.Double"); //$NON-NLS-1$
+ primitive.add("java.lang.Float"); //$NON-NLS-1$
+ primitive.add("java.lang.String"); //$NON-NLS-1$
+ primitive.add("java.lang.StringBuffer"); //$NON-NLS-1$
+ primitive.add("java.lang.Class"); //$NON-NLS-1$
+ primitive.add("java.lang.Deprecated"); //$NON-NLS-1$
+ primitive.add("java.lang.SuppressWarnings"); //$NON-NLS-1$
+ primitive.add("java.lang.Throwable"); //$NON-NLS-1$
+ primitive.add("java.lang.Exception"); //$NON-NLS-1$
+ primitive.add("java.lang.RuntimeException"); //$NON-NLS-1$
+ primitive.add("java.lang.Override"); //$NON-NLS-1$
+ }
static String NULL = ";;;"; //$NON-NLS-1$
Map<String,Resolved> resolved = new Hashtable<String, Resolved>();
@@ -46,8 +164,8 @@
public String resolveType(IType type, String typeName) {
if(type == null) return null;
- if(type.isBinary() || typeName == null) return typeName;
-
+ if(type.isBinary() || typeName == null || primitive.contains(typeName)) return typeName;
+
String n = getKey(type);
Resolved r = resolved.get(n);
if(r == null) {
@@ -62,8 +180,15 @@
return (result == NULL) ? null : result;
}
+ result = r.resolveInImports(typeName);
+ if(result != null) {
+ return result;
+ }
+
result = __resolveType(type, typeName);
+ System.out.println(typeName + "---" + result);
+
r.types.put(typeName, result == null ? NULL : result);
return result;
12 years, 4 months
JBoss Tools SVN: r43228 - in trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen: model and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-24 16:21:29 -0400 (Fri, 24 Aug 2012)
New Revision: 43228
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenImportsCollector.java
trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenVariable.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/CDIProjectGenerator.java
trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenAnnotationReference.java
trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenClass.java
trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenField.java
trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenMember.java
trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenMethod.java
trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenType.java
trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/ui/GenProjectHandler.java
Log:
JBIDE-12446
https://issues.jboss.org/browse/JBIDE-12446
Initial implementation of plugin that allows to generate random CDI projects.
Added producers, initializers, method parameters.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/CDIProjectGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/CDIProjectGenerator.java 2012-08-24 20:19:30 UTC (rev 43227)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/CDIProjectGenerator.java 2012-08-24 20:21:29 UTC (rev 43228)
@@ -13,6 +13,7 @@
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
@@ -27,10 +28,12 @@
import org.jboss.tools.cdi.gen.model.GenClass;
import org.jboss.tools.cdi.gen.model.GenField;
import org.jboss.tools.cdi.gen.model.GenInterface;
+import org.jboss.tools.cdi.gen.model.GenMember;
import org.jboss.tools.cdi.gen.model.GenMethod;
import org.jboss.tools.cdi.gen.model.GenProject;
import org.jboss.tools.cdi.gen.model.GenQualifier;
import org.jboss.tools.cdi.gen.model.GenType;
+import org.jboss.tools.cdi.gen.model.GenVariable;
import org.jboss.tools.common.zip.UnzipOperation;
import org.osgi.framework.Bundle;
@@ -48,8 +51,11 @@
int packageCount = 50;
int interfaceCount = 50;
int qualifierCount = 50;
- int classCount = 300;
- int injectionsPerClassCount = 20;
+ int classCount = 500;
+ int producersPerClass = 3;
+ int fieldInjectionsPerClassCount = 20;
+ int initMethodsPerClass = 3;
+ int paramsPerInitMethod = 2;
public CDIProjectGenerator() {}
@@ -57,11 +63,10 @@
this.workspaceLocation = workspaceLocation;
}
- public void generate() {
- project.setName("GeneratedProject");
+ public void generate(String projectName) {
+ project.setName(projectName);
createPackages();
createTypes();
- //TODO
project.flush(workspaceLocation);
}
@@ -87,6 +92,10 @@
}
void createTypes() {
+ // void type
+ GenClass voidType = new GenClass();
+ voidType.setFullyQualifiedName("void");
+ // String type
GenClass string = new GenClass();
string.setFullyQualifiedName("java.lang.String");
@@ -111,10 +120,13 @@
}
List<String> beanNames = new ArrayList<String>();
+
+ //@Named type
GenQualifier named = new GenQualifier();
named.setName("Named");
named.setPackageName("javax.inject");
-
+
+ //Classes
GenClass[] classes = new GenClass[classCount];
for (int i = 0; i < classCount; i++) {
String name = "MyBean" + i;
@@ -131,12 +143,14 @@
classes[i] = type;
project.addType(type);
}
+ //Mix classes array
for (int i = classes.length - 1; i > 0; i--) {
int j = seed.nextInt(i);
GenClass c = classes[i];
classes[i] = classes[j];
classes[j] = c;
}
+ //Generate inheritance
for (int i = 0; i < classes.length; i++) {
int j = seed.nextInt(classes.length);
if(i != j && (classes[j].getExtendedType() != null || !classes[j].getImplementedTypes().isEmpty())) {
@@ -146,6 +160,44 @@
classes[i].addImplementedType(interfaces[j]);
}
}
+
+ GenAnnotation disposeType = new GenAnnotation();
+ disposeType.setFullyQualifiedName(CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME);
+ GenAnnotationReference dispose = new GenAnnotationReference();
+ dispose.setAnnotation(disposeType);
+
+ //Producers
+ List<GenMethod> producers = new ArrayList<GenMethod>();
+ GenAnnotation producesType = new GenAnnotation();
+ producesType.setFullyQualifiedName(CDIConstants.PRODUCES_ANNOTATION_TYPE_NAME);
+ GenAnnotationReference produces = new GenAnnotationReference();
+ produces.setAnnotation(producesType);
+ for (int i = 0; i < classes.length; i++) {
+ for (int j = 0; j < producersPerClass; j++) {
+ GenMethod producer = new GenMethod();
+ producer.addAnnotation(produces);
+ GenClass c = classes[seed.nextInt(classes.length)];
+ producer.setReturnType(c);
+ producer.setName("produceC" + i + "M" + j);
+ GenQualifier q = qualifiers[seed.nextInt(qualifierCount)];
+ producer.addQualifierAnnotation(q, "qpvalue" + i + "_" + j);
+
+ classes[i].addMethod(producer);
+ producers.add(producer);
+
+ //Disposer
+ GenMethod disposer = new GenMethod();
+ disposer.setReturnType(voidType);
+ disposer.setName("disposeC" + i + "M" + j);
+ GenVariable v = new GenVariable();
+ v.setName("p0");
+ v.setType(getRandomSuperType(c, 0.6f));
+ v.addAnnotation(dispose);
+ v.addQualifierAnnotation(q, "qpvalue" + i + "_" + j);
+ disposer.addParameter(v);
+ classes[i].addMethod(disposer);
+ }
+ }
//Injections
GenAnnotation injectType = new GenAnnotation();
@@ -154,17 +206,15 @@
inject.setAnnotation(injectType);
for (int i = 0; i < classes.length; i++) {
- for (int j = 0; j < injectionsPerClassCount; j++) {
+ for (int j = 0; j < fieldInjectionsPerClassCount; j++) {
GenField f = new GenField();
f.setName("f" + j);
f.addAnnotation(inject);
- GenClass c = classes[seed.nextInt(classes.length)];
- for (GenAnnotationReference q: c.getQualifiers()) {
+ GenMember beanMember = getRandomBeanMember(classes, producers);
+ for (GenAnnotationReference q: beanMember.getQualifiers()) {
f.addAnnotation(q);
}
- while(c.getExtendedType() != null) c = c.getExtendedType();
- GenType type = c;
- if(!c.getImplementedTypes().isEmpty() && seed.nextFloat() < 0.6f) type = c.getImplementedTypes().get(0);
+ GenType type = getRandomSuperType(beanMember.getType(), 0.6f);
f.setType(type);
classes[i].addField(f);
}
@@ -173,8 +223,29 @@
nameProperty.setReturnType(string);
nameProperty.setName("getName");
classes[i].addMethod(nameProperty);
+
+ //initializers
+ for (int j = 0; j < initMethodsPerClass; j++) {
+ GenMethod m = new GenMethod();
+ m.addAnnotation(inject);
+ m.setReturnType(voidType);
+ m.setName("initC" + i + "M" + j);
+ for (int k = 0; k < paramsPerInitMethod; k++) {
+ GenVariable v = new GenVariable();
+ v.setName("p" + k);
+ GenMember beanMember = getRandomBeanMember(classes, producers);
+ for (GenAnnotationReference q: beanMember.getQualifiers()) {
+ v.addAnnotation(q);
+ }
+ GenType type = getRandomSuperType(beanMember.getType(), 0.6f);
+ v.setType(type);
+ m.addParameter(v);
+ }
+
+ classes[i].addMethod(m);
+ }
}
-
+
//EL
for (int i = 0; i < classes.length; i++) {
GenField f = new GenField();
@@ -190,6 +261,29 @@
return project.getPackages().get(seed.nextInt(project.getPackages().size()));
}
+ private GenMember getRandomBeanMember(GenClass[] classes, List<GenMethod> producers) {
+ if(seed.nextFloat() < 0.6f) {
+ return classes[seed.nextInt(classes.length)];
+ } else {
+ return producers.get(seed.nextInt(producers.size()));
+ }
+ }
+
+ private GenType getRandomSuperType(GenType type, float level) {
+ if(type instanceof GenClass) {
+ GenClass c = (GenClass)type;
+ while(c.getExtendedType() != null) c = c.getExtendedType();
+ type = c;
+ }
+ if(seed.nextFloat() < level) {
+ Collection<GenInterface> is = type.getImplementedTypes();
+ if(!is.isEmpty()) {
+ type = is.iterator().next();
+ }
+ }
+ return type;
+ }
+
private static File TEMPLATE_FOLDER;
public static File getTemplatesFolder() throws IOException {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenAnnotationReference.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenAnnotationReference.java 2012-08-24 20:19:30 UTC (rev 43227)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenAnnotationReference.java 2012-08-24 20:21:29 UTC (rev 43228)
@@ -19,24 +19,22 @@
*
*/
public class GenAnnotationReference {
- String packageName;
- String typeName;
- Map<String, Object> values = new HashMap<String, Object>();
+ private GenAnnotation annotation;
+ private Map<String, Object> values = new HashMap<String, Object>();
public GenAnnotationReference() {
}
- public void setAnnotation(GenAnnotation type) {
- packageName = type.getPackageName();
- typeName = type.getTypeName();
+ public void setAnnotation(GenAnnotation annotation) {
+ this.annotation = annotation;
}
public String getPackageName() {
- return packageName;
+ return annotation.getPackageName();
}
public String getTypeName() {
- return typeName;
+ return annotation.getTypeName();
}
public Map<String, Object> getValues() {
@@ -48,6 +46,6 @@
}
public String getFullyQualifiedName() {
- return getPackageName() + "." + getTypeName();
+ return annotation.getFullyQualifiedName();
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenClass.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenClass.java 2012-08-24 20:19:30 UTC (rev 43227)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenClass.java 2012-08-24 20:21:29 UTC (rev 43228)
@@ -11,9 +11,7 @@
package org.jboss.tools.cdi.gen.model;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
/**
*
@@ -22,56 +20,23 @@
*/
public class GenClass extends GenType {
GenClass extendedType;
- List<GenInterface> implementedTypes = new ArrayList<GenInterface>();
- Set<GenAnnotationReference> qualifierAnnotations = new HashSet<GenAnnotationReference>();
List<GenField> fields = new ArrayList<GenField>();
public GenClass() {}
public void setExtendedType(GenClass extendedType) {
this.extendedType = extendedType;
- addImport(extendedType.getFullyQualifiedName());
+ getDeclaringType().addImport(extendedType.getFullyQualifiedName());
}
- public void addImplementedType(GenInterface implementedType) {
- if(!implementedTypes.contains(implementedType)) {
- implementedTypes.add(implementedType);
- addImport(implementedType.getFullyQualifiedName());
- }
- }
-
public GenClass getExtendedType() {
return extendedType;
}
- public List<GenInterface> getImplementedTypes() {
- return implementedTypes;
- }
-
- public void addQualifierAnnotation(GenQualifier q, String value) {
- addImport(q.getFullyQualifiedName());
-
- GenAnnotationReference a = new GenAnnotationReference();
- a.setAnnotation(q);
-
-
- if(value != null) {
- a.getValues().put("value", "\"" + value + "\"");
- }
-
- addAnnotation(a);
- qualifierAnnotations.add(a);
- }
-
- public Set<GenAnnotationReference> getQualifiers() {
- return qualifierAnnotations;
- }
-
public void addField(GenField f) {
fields.add(f);
- addImport(f.getType().getFullyQualifiedName());
- for (GenAnnotationReference a: f.getAnnotations()) {
- addImport(a.getFullyQualifiedName());
+ if(getDeclaringType() != null) {
+ new GenImportsCollector(getDeclaringType()).addImports(f);
}
}
@@ -79,7 +44,7 @@
sb.append("package ").append(getPackageName()).append(";").newLine().newLine();
//imports
- for (String i: imports) {
+ for (String i: getImports()) {
sb.append("import ").append(i).append(";").newLine();
}
sb.append("\n");
@@ -92,7 +57,7 @@
sb.append(" extends ").append(extendedType.getTypeName());
}
int imported = 0;
- for (GenInterface in: implementedTypes) {
+ for (GenInterface in: getImplementedTypes()) {
if(imported == 0) {
sb.append(" implements ");
} else {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenField.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenField.java 2012-08-24 20:19:30 UTC (rev 43227)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenField.java 2012-08-24 20:21:29 UTC (rev 43228)
@@ -15,22 +15,13 @@
* @author Viacheslav Kabanovich
*
*/
-public class GenField extends GenMember {
- GenType type;
- String initValue;
+public class GenField extends GenVariable {
+ private String initValue;
public GenField() {
setVisibility(GenVisibility.PROTECTED);
}
- public void setType(GenType type) {
- this.type = type;
- }
-
- public GenType getType() {
- return type;
- }
-
public void setInitValue(String s) {
initValue = s;
}
@@ -38,7 +29,7 @@
public void flush(BodyWriter sb) {
flushAnnotations(sb);
flushVisibility(sb);
- sb.append(type.getTypeName()).append(" ").append(getName());
+ sb.append(getType().getTypeName()).append(" ").append(getName());
if(initValue != null) {
sb.append(" = ").append(initValue);
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenImportsCollector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenImportsCollector.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenImportsCollector.java 2012-08-24 20:21:29 UTC (rev 43228)
@@ -0,0 +1,30 @@
+package org.jboss.tools.cdi.gen.model;
+
+public class GenImportsCollector {
+ GenType type;
+
+ public GenImportsCollector(GenType type) {
+ this.type = type;
+ }
+
+ public void addImports(GenAnnotationReference a) {
+ type.addImport(a.getFullyQualifiedName());
+ }
+
+ public void addImports(GenVariable v) {
+ type.addImport(v.getType().getFullyQualifiedName());
+ for (GenAnnotationReference a: v.getAnnotations()) {
+ addImports(a);
+ }
+ }
+
+ public void addImports(GenMethod m) {
+ type.addImport(m.getType().getFullyQualifiedName());
+ for (GenAnnotationReference a: m.getAnnotations()) {
+ addImports(a);
+ }
+ for (GenVariable p: m.getParameters()) {
+ addImports(p);
+ }
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenImportsCollector.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenMember.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenMember.java 2012-08-24 20:19:30 UTC (rev 43227)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenMember.java 2012-08-24 20:21:29 UTC (rev 43228)
@@ -10,30 +10,68 @@
******************************************************************************/
package org.jboss.tools.cdi.gen.model;
-import java.util.HashSet;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import java.util.Map;
-import java.util.Set;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class GenMember {
- protected Set<GenAnnotationReference> annotations = new HashSet<GenAnnotationReference>();
+public abstract class GenMember {
+ private GenMember parent;
+ private List<GenAnnotationReference> annotations = new ArrayList<GenAnnotationReference>();
+ private List<GenAnnotationReference> qualifierAnnotations = new ArrayList<GenAnnotationReference>();
String name;
GenVisibility visibility = GenVisibility.LOCAL;
public GenMember() {}
+ public GenMember getParent() {
+ return parent;
+ }
+
+ public void setParent(GenMember parent) {
+ this.parent = parent;
+ }
+
+ /**
+ * May return null if this member is not a type and is not added to a type.
+ * @return
+ */
+ public GenType getDeclaringType() {
+ return parent != null ? parent.getDeclaringType() : null;
+ }
+
public void addAnnotation(GenAnnotationReference annotation) {
annotations.add(annotation);
+ if(getDeclaringType() != null) {
+ new GenImportsCollector(getDeclaringType()).addImports(annotation);
+ }
}
- public Set<GenAnnotationReference> getAnnotations() {
+ public Collection<GenAnnotationReference> getAnnotations() {
return annotations;
}
+ public void addQualifierAnnotation(GenQualifier q, String value) {
+ GenAnnotationReference a = new GenAnnotationReference();
+ a.setAnnotation(q);
+
+ if(value != null) {
+ a.getValues().put("value", "\"" + value + "\"");
+ }
+
+ addAnnotation(a);
+ qualifierAnnotations.add(a);
+ }
+
+ public Collection<GenAnnotationReference> getQualifiers() {
+ return qualifierAnnotations;
+ }
+
public void setName(String name) {
this.name = name;
}
@@ -56,7 +94,13 @@
}
}
+ public abstract GenType getType();
+
public void flushAnnotations(BodyWriter sb) {
+ flushAnnotations(sb, false);
+ }
+
+ public void flushAnnotations(BodyWriter sb, boolean separateBySpace) {
for (GenAnnotationReference a: getAnnotations()) {
sb.append("@").append(a.getTypeName());
Map<String, Object> vs = a.getValues();
@@ -69,7 +113,7 @@
}
sb.append(")");
}
- sb.newLine();
+ if(separateBySpace) sb.append(" "); else sb.newLine();
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenMethod.java 2012-08-24 20:19:30 UTC (rev 43227)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenMethod.java 2012-08-24 20:21:29 UTC (rev 43228)
@@ -10,14 +10,18 @@
******************************************************************************/
package org.jboss.tools.cdi.gen.model;
+import java.util.ArrayList;
+import java.util.List;
+
/**
*
* @author Viacheslav Kabanovich
*
*/
public class GenMethod extends GenMember {
- GenType returnType;
- boolean isAbstract = false;
+ private GenType returnType;
+ private boolean isAbstract = false;
+ private List<GenVariable> parameters = new ArrayList<GenVariable>();
public GenMethod() {
setVisibility(GenVisibility.PUBLIC);
@@ -39,12 +43,35 @@
return returnType;
}
+ public GenType getType() {
+ return getReturnType();
+ }
+
+ public List<GenVariable> getParameters() {
+ return parameters;
+ }
+
+ public void addParameter(GenVariable p) {
+ parameters.add(p);
+ if(getDeclaringType() != null) {
+ new GenImportsCollector(getDeclaringType()).addImports(p);
+ }
+ }
+
public void flush(BodyWriter sb) {
flushAnnotations(sb);
flushVisibility(sb);
sb.append(returnType.getTypeName()).append(" ").append(getName());
sb.append("(");
- //TODO parameters
+ boolean first = true;
+ for (GenVariable v: getParameters()) {
+ if(first) {
+ first = false;
+ } else {
+ sb.append(", ");
+ }
+ v.flush(sb);
+ }
sb.append(")");
if(isAbstract()) {
sb.append(";").newLine();
@@ -53,7 +80,7 @@
if(!"void".equals(returnType.getTypeName())) {
sb.append("return null;").newLine();
}
- sb.decreaseIndent().append("}");
+ sb.decreaseIndent().append("}").newLine();
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenType.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenType.java 2012-08-24 20:19:30 UTC (rev 43227)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenType.java 2012-08-24 20:21:29 UTC (rev 43228)
@@ -11,6 +11,7 @@
package org.jboss.tools.cdi.gen.model;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -23,8 +24,9 @@
*
*/
public class GenType extends GenMember implements CDIConstants {
- Set<String> imports = new HashSet<String>();
- String packageName;
+ private Set<String> imports = new HashSet<String>();
+ private String packageName;
+ private List<GenInterface> implementedTypes = new ArrayList<GenInterface>();
List<GenMethod> methods = new ArrayList<GenMethod>();
@@ -48,6 +50,14 @@
return getName();
}
+ public GenType getType() {
+ return this;
+ }
+
+ public GenType getDeclaringType() {
+ return getParent() instanceof GenType ? getParent().getDeclaringType() : this;
+ }
+
public void setFullyQualifiedName(String qn) {
int dot = qn.lastIndexOf('.');
setTypeName(dot < 0 ? qn : qn.substring(dot + 1));
@@ -55,15 +65,33 @@
}
public String getFullyQualifiedName() {
- return getPackageName() + "." + getName();
+ return getPackageName().length() == 0 ? getName() : getPackageName() + "." + getName();
}
+ public Collection<String> getImports() {
+ return imports;
+ }
+
public void addImport(String type) {
+ if(type.startsWith("java.lang.") && type.lastIndexOf(".") == 9) return;
+ if(type.indexOf('.') < 0) return;
imports.add(type);
}
+ public void addImplementedType(GenInterface implementedType) {
+ if(!implementedTypes.contains(implementedType)) {
+ implementedTypes.add(implementedType);
+ getDeclaringType().addImport(implementedType.getFullyQualifiedName());
+ }
+ }
+
+ public Collection<GenInterface> getImplementedTypes() {
+ return implementedTypes;
+ }
+
public void addMethod(GenMethod method) {
methods.add(method);
+ new GenImportsCollector(getDeclaringType()).addImports(method);
}
public void flushMethods(BodyWriter sb) {
Added: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenVariable.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenVariable.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenVariable.java 2012-08-24 20:21:29 UTC (rev 43228)
@@ -0,0 +1,19 @@
+package org.jboss.tools.cdi.gen.model;
+
+public class GenVariable extends GenMember {
+ private GenType type;
+
+ public void setType(GenType type) {
+ this.type = type;
+ }
+
+ public GenType getType() {
+ return type;
+ }
+
+ public void flush(BodyWriter sb) {
+ flushAnnotations(sb, true);
+ flushVisibility(sb);
+ sb.append(getType().getTypeName()).append(" ").append(getName());
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/model/GenVariable.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/ui/GenProjectHandler.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/ui/GenProjectHandler.java 2012-08-24 20:19:30 UTC (rev 43227)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.gen/src/org/jboss/tools/cdi/gen/ui/GenProjectHandler.java 2012-08-24 20:21:29 UTC (rev 43228)
@@ -10,12 +10,17 @@
******************************************************************************/
package org.jboss.tools.cdi.gen.ui;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.actions.RefreshAction;
import org.jboss.tools.cdi.gen.CDIProjectGenerator;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
/**
*
@@ -23,16 +28,35 @@
*
*/
public class GenProjectHandler implements IObjectActionDelegate {
+ ISelection selection;
@Override
public void run(IAction action) {
CDIProjectGenerator g = new CDIProjectGenerator();
- g.setWorkspaceLocation(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile());
- g.generate();
+ IProject project = null;
+ if(selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection)selection;
+ Object o = ss.getFirstElement();
+ if(o instanceof IProject) {
+ project = (IProject)o;
+ if(!project.isAccessible()) project = null;
+ }
+ }
+ if(project != null) {
+ g.setWorkspaceLocation(project.getLocation().toFile().getParentFile());
+ g.generate(project.getName());
+ RefreshAction refreshAction = new RefreshAction(ModelPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow());
+ refreshAction.selectionChanged(new StructuredSelection(project));
+ refreshAction.run();
+ } else {
+ g.setWorkspaceLocation(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile());
+ g.generate("GeneratedProject");
+ }
}
@Override
public void selectionChanged(IAction action, ISelection selection) {
+ this.selection = selection;
}
@Override
12 years, 4 months
JBoss Tools SVN: r43227 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-24 16:19:30 -0400 (Fri, 24 Aug 2012)
New Revision: 43227
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
Log:
JBIDE-12404
https://issues.jboss.org/browse/JBIDE-12404
New bean sets are copied into as-you-type model correctly.
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 2012-08-24 20:18:22 UTC (rev 43226)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2012-08-24 20:19:30 UTC (rev 43227)
@@ -134,6 +134,14 @@
Collection<IBean> oldBeans = getBeans(file.getFullPath());
p.allBeans.removeAll(oldBeans);
p.allBeans.addAll(beans);
+
+ p.beansByTypes = new ArrayList<Set<IBean>>();
+ for (int i = 0; i < BEANS_BY_TYPE_SIZE; i++) {
+ Set<IBean> bs = new HashSet<IBean>(beansByTypes.get(i));
+ bs.removeAll(oldBeans);
+ bs.addAll(beans);
+ p.beansByTypes.add(bs);
+ }
Set<IBean> oldNamedBeans = null;
for (IBean b: oldBeans) {
@@ -388,7 +396,7 @@
return getResolvedBeans(result, attemptToResolveAmbiguousDependency);
}
- static int BEANS_BY_TYPE_SIZE = 167;
+ static int BEANS_BY_TYPE_SIZE = 367;
static int OBJECT_INDEX = Math.abs("java.lang.Object".hashCode()) % BEANS_BY_TYPE_SIZE;
static int toTypeIndex(IType type) {
12 years, 4 months
JBoss Tools SVN: r43226 - trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-08-24 16:18:22 -0400 (Fri, 24 Aug 2012)
New Revision: 43226
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/DefaultJavaRelevanceCheck.java
Log:
Fixed NPE problem
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/DefaultJavaRelevanceCheck.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/DefaultJavaRelevanceCheck.java 2012-08-24 19:01:19 UTC (rev 43225)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/DefaultJavaRelevanceCheck.java 2012-08-24 20:18:22 UTC (rev 43226)
@@ -23,26 +23,28 @@
public DefaultJavaRelevanceCheck(IJavaElement element) {
test1 = element.getElementName();
- if (element instanceof IMethod) {
- if(test1.length() > 3 && (test1.startsWith("get") || test1.startsWith("set"))) { //$NON-NLS-1$ //$NON-NLS-2$
+ if(element instanceof IMethod) {
+ if((test1.startsWith("get") || test1.startsWith("set")) && test1.length() > 3) { //$NON-NLS-1$ //$NON-NLS-2$
test2 = test1.substring(3, 4).toLowerCase() + test1.substring(4);
test3 = test1.substring(3);
- } else if(test1.length() > 2 && test1.startsWith("is")) { //$NON-NLS-1$
+ } else if(test1.startsWith("is") && test1.length() > 2) { //$NON-NLS-1$
test2 = test1.substring(2, 3).toLowerCase() + test1.substring(3);
test3 = test1.substring(2);
}
- if(test3.equals(test2)) {
- test3 = null;
- }
- } else if (element instanceof IType){
+ if(test3 != null && test3.equals(test2)) test3 = null;
+ }else if(element instanceof IType){
isIType = true;
}
}
public boolean isRelevant(String content) {
- return isIType
- || content.contains(test1)
- || test2 != null && content.contains(test2)
- || test3 != null && content.contains(test3);
+ if(isIType)
+ return true;
+
+ if(test1 != null && content.contains(test1)) return true;
+ if(test2 != null && content.contains(test2)) return true;
+ if(test3 != null && content.contains(test3)) return true;
+ return false;
}
+
}
12 years, 4 months
JBoss Tools SVN: r43225 - in trunk/cdi: plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-08-24 15:01:19 -0400 (Fri, 24 Aug 2012)
New Revision: 43225
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/NonRuntimeBindingType.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestEvents.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestEvents.qfxresult
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java
Log:
CDI hyper links should work on modified files correctly https://issues.jboss.org/browse/JBIDE-12404
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2012-08-24 16:20:04 UTC (rev 43224)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2012-08-24 19:01:19 UTC (rev 43225)
@@ -1266,7 +1266,7 @@
public static ICDIProject getCDIProject(IFile file, CDICoreNature cdiNature, boolean asYouType){
ICDIProject cdiProject = cdiNature.getDelegate();
- if(asYouType){
+ if(asYouType && file != null){
return new CDIProjectAsYouType(cdiProject, file);
}else{
return cdiProject;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java 2012-08-24 16:20:04 UTC (rev 43224)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java 2012-08-24 19:01:19 UTC (rev 43225)
@@ -65,7 +65,7 @@
if(!(input instanceof FileEditorInput))
return null;
- IFile file = ((FileEditorInput)input).getFile();
+ file = ((FileEditorInput)input).getFile();
if(file == null)
return null;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java 2012-08-24 16:20:04 UTC (rev 43224)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java 2012-08-24 19:01:19 UTC (rev 43225)
@@ -56,9 +56,6 @@
if(textEditor.getEditorInput() instanceof IFileEditorInput){
file = ((IFileEditorInput)textEditor.getEditorInput()).getFile();
}
- if(file == null){
- return null;
- }
int offset= region.getOffset();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2012-08-24 16:20:04 UTC (rev 43224)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2012-08-24 19:01:19 UTC (rev 43225)
@@ -58,9 +58,6 @@
if(textEditor.getEditorInput() instanceof IFileEditorInput){
file = ((IFileEditorInput)textEditor.getEditorInput()).getFile();
}
- if(file == null){
- return null;
- }
int offset= region.getOffset();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java 2012-08-24 16:20:04 UTC (rev 43224)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java 2012-08-24 19:01:19 UTC (rev 43225)
@@ -55,9 +55,6 @@
if(textEditor.getEditorInput() instanceof IFileEditorInput){
file = ((IFileEditorInput)textEditor.getEditorInput()).getFile();
}
- if(file == null){
- return null;
- }
int offset= region.getOffset();
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/NonRuntimeBindingType.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/NonRuntimeBindingType.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/NonRuntimeBindingType.java 2012-08-24 19:01:19 UTC (rev 43225)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@SuppressWarnings("cdi-target")
+@Target( { FIELD, PARAMETER })
+@Qualifier
+(a)Retention(RetentionPolicy.CLASS)
+@interface NonRuntimeBindingType
+{
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/NonRuntimeBindingType.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestEvents.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestEvents.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestEvents.java 2012-08-24 19:01:19 UTC (rev 43225)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+
+public class TestEvents {
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestEvents.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestEvents.qfxresult
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestEvents.qfxresult (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestEvents.qfxresult 2012-08-24 19:01:19 UTC (rev 43225)
@@ -0,0 +1,31 @@
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+
+
+public class TestEvents {
+ @Inject @Any Event<EventType> stringEvent;
+
+ @Inject @Any @NonRuntimeBindingType Event<EventType> stringEventWithAnyAndNonRuntimeBindingType;
+
+ @Inject @NonRuntimeBindingType Event<EventType> stringEventWithOnlyNonRuntimeBindingType;
+
+ public void fireEvent()
+ {
+ stringEvent.fire(new EventType());
+ }
+
+ public void fireEventWithNonRuntimeBindingType()
+ {
+ stringEventWithAnyAndNonRuntimeBindingType.fire(new EventType());
+ }
+
+ class EventType{
+ public EventType(){
+
+ }
+ }
+}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java 2012-08-24 16:20:04 UTC (rev 43224)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java 2012-08-24 19:01:19 UTC (rev 43225)
@@ -14,11 +14,13 @@
import java.util.Collection;
import java.util.List;
+import junit.framework.Assert;
import junit.framework.TestCase;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
@@ -55,6 +57,7 @@
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.util.AxisUtil;
+import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditorPart;
import org.jboss.tools.jst.text.ext.hyperlink.ELHyperlinkDetector;
@@ -76,6 +79,15 @@
checkRegions(fullyQualifiedName, editorInput, editorPart, regionList, hlDetector);
}
+ protected static ISourceViewer getViewer(IEditorPart editor){
+ if(editor instanceof JavaEditor){
+ return ((JavaEditor)editor).getViewer();
+ }else{
+ Assert.fail("editor must be instanceof JavaEditor");
+ }
+ return null;
+ }
+
public static void checkRegions(IProject project, String fileName, List<TestRegion> regionList, AbstractHyperlinkDetector hlDetector) throws Exception {
IFile file = project.getFile(fileName);
@@ -88,6 +100,35 @@
checkRegions(fileName, editorInput, editorPart, regionList, hlDetector);
}
+ public static void checkRegionsForAsYouType(IProject project, String fileName, String newContent, List<TestRegion> regionList, AbstractHyperlinkDetector hlDetector) throws Exception {
+ IFile file = project.getFile(fileName);
+ IFile nFile = project.getFile(newContent);
+
+ assertNotNull("The file \"" + fileName + "\" is not found", file);
+ assertTrue("The file \"" + fileName + "\" is not found", file.isAccessible());
+
+ assertNotNull("The file \"" + newContent + "\" is not found", nFile);
+ assertTrue("The file \"" + newContent + "\" is not found", nFile.isAccessible());
+
+ IEditorInput editorInput = new FileEditorInput(file);
+ IEditorPart editorPart = openFileInEditor(file);
+ try{
+ ISourceViewer viewer = getViewer(editorPart);
+
+ IDocument document = viewer.getDocument();
+
+ String text = FileUtil.getContentFromEditorOrFile(nFile);
+
+ document.set(text);
+
+ checkRegions(fileName, editorInput, editorPart, regionList, hlDetector);
+ }finally{
+ if(editorPart.isDirty()){
+ editorPart.doSave(new NullProgressMonitor());
+ }
+ }
+ }
+
private static void checkRegions(String fileName, IEditorInput editorInput, IEditorPart editorPart, List<TestRegion> regionList, AbstractHyperlinkDetector hlDetector) throws Exception {
ISourceViewer viewer = null;
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java 2012-08-24 16:20:04 UTC (rev 43224)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java 2012-08-24 19:01:19 UTC (rev 43225)
@@ -16,10 +16,9 @@
import org.jboss.tools.cdi.text.ext.CDIExtensionsMessages;
import org.jboss.tools.cdi.text.ext.hyperlink.EventAndObserverMethodHyperlinkDetector;
import org.jboss.tools.cdi.text.ext.hyperlink.EventListHyperlink;
-import org.jboss.tools.cdi.text.ext.hyperlink.InjectedPointHyperlink;
import org.jboss.tools.cdi.text.ext.hyperlink.ObserverMethodListHyperlink;
+import org.jboss.tools.cdi.text.ext.test.CDIHyperlinkTestUtil.TestHyperlink;
import org.jboss.tools.cdi.text.ext.test.CDIHyperlinkTestUtil.TestRegion;
-import org.jboss.tools.cdi.text.ext.test.CDIHyperlinkTestUtil.TestHyperlink;
public class EventAndObserverMethodHyperlinkDetectorTest extends TCKTest {
@@ -62,6 +61,34 @@
CDIHyperlinkTestUtil.checkRegions(tckProject, "JavaSource/org/jboss/jsr299/tck/tests/event/bindingTypes/EventEmitter.java", regionList, new EventAndObserverMethodHyperlinkDetector());
}
+
+ public void testEventHyperlinkDetectorForAsYouType() throws Exception {
+ String[] elementPaths = new String[]{
+ "/tck/JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/observers/ClassFragmentLogger.java",
+ "/tck/JavaSource/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypeFamilyObserver.java"
+ };
+
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+
+ regionList.add(new TestRegion(/*959, 6*/"Inject", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*967, 16*/"Any Event<EventType", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*985, 11*/"stringEvent", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1006, 6*/"Inject", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1014, 3*/"Any", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1019, 34*/"NonRuntimeBindingType Event<EventType", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1055, 42*/"stringEventWithAnyAndNonRuntimeBindingType", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1107, 6*/"Inject", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1115, 34*/"NonRuntimeBindingType Event<EventType", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1151, 36*/"stringEventWithOnlyNonRuntimeBindingType", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1235, 11*/"stringEvent", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1334, 42*/"stringEventWithAnyAndNonRuntimeBindingType", new TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class, CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+
+ CDIHyperlinkTestUtil.checkRegionsForAsYouType(tckProject,
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/TestEvents.java",
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/TestEvents.qfxresult",
+ regionList,
+ new EventAndObserverMethodHyperlinkDetector());
+ }
public void testObserverMethodHyperlinkDetector() throws Exception {
String[] elementPaths = new String[]{
12 years, 4 months
JBoss Tools SVN: r43224 - in trunk/ws: plugins/org.jboss.tools.ws.jaxrs.core/META-INF and 27 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-08-24 12:20:04 -0400 (Fri, 24 Aug 2012)
New Revision: 43224
Added:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/AbstractJaxrsElementValidatorDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsApplicationValidatorDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsHttpMethodValidatorDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceMethodValidatorDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceValidatorDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationErrorManager.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationMessages.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationMessages.properties
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IMarkerResolutionDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/quickfix/
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/quickfix/JaxrsValidationQuickFixes.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/JaxrsPreferenceInitializer.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/JaxrsPreferences.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/package-info.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/IConfigurationBlockDescriptionProvider.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencePage.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencesMessages.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencesMessages.properties
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsSettingsPreferencePage.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorConfigurationBlock.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorConfigurationBlockDescriptionProvider.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorPreferencePage.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/package-info.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/AddTargetAnnotationMarkerResolution.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsMarkerResolutionGenerator.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsQuickFixMessages.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsQuickFixMessages.properties
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/package-info.java
Removed:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/IValidable.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/quickfix/
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/JaxrsMarkerResolutionGenerator.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.properties
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.xml
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/JBossJaxrsCorePlugin.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderUtils.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedListener.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementDelta.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilder.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceDeltaScanner.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBaseElement.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBuiltinHttpMethod.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsJavaApplication.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsJavaElement.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsParamBeanProperty.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsProvider.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResource.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceField.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsWebxmlApplication.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/Annotation.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/EnumJaxrsClassname.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaAnnotationsVisitor.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodParameter.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtils.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IJaxrsHttpMethod.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IJaxrsMetamodel.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.properties
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateElementAdapterFactory.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/facet/JaxrsFacetedProjectListener.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/plugin.properties
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/BarResource.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/BazResource.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/FOO.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/WorkbenchUtils.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/configuration/ProjectBuilderUtilsTestCase.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessorTestCase.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilderTestCase.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessorTestCase.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedProcessorTestCase.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactoryTestCase.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodelTestCase.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidatorTestCase.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JaxrsAnnotationScannerTestCase.java
Log:
Fixed - JBIDE-12413 - Warn when a JAX-RS HTTP Method has no valid @Target and @Retention annotations aside of the @HttpMethod annotation
Fixed - JBIDE-12485 - Move JAX-RS validation into JBoss Tools validation, aside of CDI validation
Fixed - JBIDE-12486 - Improve message labels when JAX-RS PathParam annotation value does not match Path template parameters
Fixed - JBIDE-12488 - Report a warning if no JAX-RS activator (or multiple ones) exist in the project
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/META-INF/MANIFEST.MF 2012-08-24 16:20:04 UTC (rev 43224)
@@ -27,15 +27,20 @@
org.eclipse.jst.j2ee;bundle-version="1.1.301";visibility:=reexport,
org.eclipse.emf.ecore;bundle-version="2.5.0";visibility:=reexport,
org.eclipse.wst.common.frameworks.ui;bundle-version="1.1.301",
- org.eclipse.jface.text;bundle-version="3.7.1"
+ org.eclipse.jface.text;bundle-version="3.7.1",
+ org.jboss.tools.common.validation;bundle-version="3.4.0",
+ org.jboss.tools.common;bundle-version="3.4.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
-Export-Package: org.jboss.tools.ws.jaxrs.core;x-friends:="org.jboss.tools.ws.jaxrs.core.test",
+Export-Package: org.jboss.tools.ws.jaxrs.core,
org.jboss.tools.ws.jaxrs.core.configuration,
org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder;x-friends:="org.jboss.tools.ws.jaxrs.core.test",
org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain;x-friends:="org.jboss.tools.ws.jaxrs.core.test",
+ org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation;x-friends:="org.jboss.tools.ws.jaxrs.core.test",
org.jboss.tools.ws.jaxrs.core.internal.utils;x-friends:="org.jboss.tools.ws.jaxrs.core.test",
org.jboss.tools.ws.jaxrs.core.jdt,
org.jboss.tools.ws.jaxrs.core.metamodel,
+ org.jboss.tools.ws.jaxrs.core.metamodel.quickfix,
+ org.jboss.tools.ws.jaxrs.core.preferences,
org.jboss.tools.ws.jaxrs.core.pubsub
Bundle-ClassPath: .
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.properties 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.properties 2012-08-24 16:20:04 UTC (rev 43224)
@@ -1,2 +1,8 @@
PLUGIN_NAME=JBoss JAX-RS Tooling (Core)
PLUGIN_PROVIDER=JBoss by Red Hat
+VALIDATOR_NAME=JAX-RS Validator
+
+
+ConfigureMenu_AddJaxrs11Support=Add JAX-RS 1.1 support...
+ConfigureMenu_RemoveJaxrs11Support=Remove JAX-RS 1.1 support...
+
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.xml
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.xml 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.xml 2012-08-24 16:20:04 UTC (rev 43224)
@@ -37,7 +37,7 @@
<action
class="org.jboss.tools.ws.jaxrs.core.configuration.AddNatureAction"
id="org.jboss.tools.ws.jaxrs.configuration.addJaxrsConfigurationAction"
- label="Add JAX-RS 1.1 support..."
+ label="%ConfigureMenu_AddJaxrs11Support"
menubarPath="org.eclipse.ui.projectConfigure/additions">
</action>
</objectContribution>
@@ -60,7 +60,7 @@
<action
class="org.jboss.tools.ws.jaxrs.core.configuration.RemoveNatureAction"
id="org.jboss.tools.ws.jaxrs.removeJaxrsConfigurationAction"
- label="Remove JAX-RS 1.1 support..."
+ label="%ConfigureMenu_RemoveJaxrs11Support"
menubarPath="org.eclipse.ui.projectConfigure/additions">
</action>
</objectContribution>
@@ -87,23 +87,17 @@
</super>
</extension>
<extension
- id="org.jboss.tools.ws.jaxrs.JaxrsMetamodelValidator"
- name="JAX-RS Metamodel Validator"
- point="org.eclipse.wst.validation.validatorV2">
+ point="org.jboss.tools.common.validation.validator">
<validator
- build="true"
class="org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation.JaxrsMetamodelValidator"
- manual="true"
- markerId="org.jboss.tools.ws.jaxrs.metamodelMarker">
- <include>
- <rules>
- <projectNature
- id="org.jboss.tools.ws.jaxrs.nature">
- </projectNature>
- </rules>
- </include>
+ id="org.jboss.tools.ws.jaxrs.JaxrsMetamodelValidator"
+ name="%VALIDATOR_NAME">
</validator>
</extension>
+
+ <extension point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.jboss.tools.ws.jaxrs.core.preferences.JaxrsPreferenceInitializer"/>
+ </extension>
</plugin>
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/JBossJaxrsCorePlugin.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/JBossJaxrsCorePlugin.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/JBossJaxrsCorePlugin.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -13,8 +13,8 @@
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JavaElementChangedListener;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.ResourceChangedListener;
import org.osgi.framework.BundleContext;
@@ -22,7 +22,7 @@
/**
* The activator class controls the plug-in life cycle
*/
-public class JBossJaxrsCorePlugin extends Plugin {
+public class JBossJaxrsCorePlugin extends AbstractUIPlugin {
/** The plug-in ID. */
public static final String PLUGIN_ID = "org.jboss.tools.ws.jaxrs.core"; //$NON-NLS-1$
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsMetamodelBuilder;
import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
/**
@@ -33,7 +34,7 @@
}
// project nature installation triggers the project builder
// installation, by configuration/association in the plugin.xml file.
- if (ProjectBuilderUtils.installProjectBuilder(project, ProjectBuilderUtils.JAXRS_BUILDER_ID)) {
+ if (ProjectBuilderUtils.installProjectBuilder(project, JaxrsMetamodelBuilder.BUILDER_ID)) {
Logger.info("JAX-RS Builder is now installed.");
} else {
Logger.info("JAX-RS Builder was already installed.");
@@ -45,7 +46,7 @@
if (project == null) {
return;
}
- if (ProjectBuilderUtils.uninstallProjectBuilder(project, ProjectBuilderUtils.JAXRS_BUILDER_ID)) {
+ if (ProjectBuilderUtils.uninstallProjectBuilder(project, JaxrsMetamodelBuilder.BUILDER_ID)) {
Logger.debug("JAX-RS Metamodel Builder is now uninstalled.");
} else {
Logger.debug("JAX-RS Metamodel Builder was not installed.");
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderUtils.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderUtils.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -23,11 +23,6 @@
*/
public final class ProjectBuilderUtils {
- // TODO : replace with javabuilder, add jaxrs builder after this one.
- public static final String VALIDATION_BUILDER_ID = "org.eclipse.wst.validation.validationbuilder";
- /** The JAX-RS Metamodel Builder Id. */
- public static final String JAXRS_BUILDER_ID = "org.jboss.tools.ws.jaxrs.metamodelBuilder";
-
/** Hidden constructor of the utility method. Prevents instantiation. */
private ProjectBuilderUtils() {
super();
@@ -75,22 +70,8 @@
if (isProjectBuilderInstalled(project, builderId)) {
return false;
}
-
+
ICommand[] newCommands = new ICommand[commands.length + 1];
- for (int i = 0; i < commands.length; i++) {
- if (commands[i].getBuilderName().equals(VALIDATION_BUILDER_ID)) {
- System.arraycopy(commands, 0, newCommands, 0, i);
- ICommand command = desc.newCommand();
- command.setBuilderName(builderId);
- newCommands[i] = command;
- System.arraycopy(commands, i, newCommands, i + 1, commands.length - i);
- desc.setBuildSpec(newCommands);
- project.setDescription(desc, null);
- return true;
- }
- }
- // if no validation builder was found, add the jax-rs builder at the
- // last position
System.arraycopy(commands, 0, newCommands, 0, commands.length);
ICommand command = desc.newCommand();
command.setBuilderName(builderId);
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedListener.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedListener.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedListener.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
+le * Copyright (c) 2008 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,
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementDelta.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementDelta.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementDelta.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -35,32 +35,36 @@
public static final int F_NONE = 0;
/** Meaning that the change occurred at a finer level. */
- public static final int F_FINE_GRAINED = 1;
+ public static final int F_FINE_GRAINED = 0x1;
- public static final int F_ELEMENT_KIND = 2;
+ public static final int F_ELEMENT_KIND = 0x2;
- public static final int F_PATH_VALUE = 4;
+ public static final int F_PATH_VALUE = 0x4;
- public static final int F_APPLICATION_PATH_VALUE = 8;
+ public static final int F_APPLICATION_PATH_VALUE = 0x8;
- public static final int F_HTTP_METHOD_VALUE = 16;
+ public static final int F_HTTP_METHOD_VALUE = 0x10;
- public static final int F_PATH_PARAM_VALUE = 32;
+ public static final int F_PATH_PARAM_VALUE = 0x20;
- public static final int F_QUERY_PARAM_VALUE = 64;
+ public static final int F_QUERY_PARAM_VALUE = 0x40;
- public static final int F_MATRIX_PARAM_VALUE = 128;
+ public static final int F_MATRIX_PARAM_VALUE = 0x80;
- public static final int F_DEFAULT_VALUE_VALUE = 256;
+ public static final int F_DEFAULT_VALUE_VALUE = 0x100;
- public static final int F_CONSUMED_MEDIATYPES_VALUE = 512;
+ public static final int F_CONSUMED_MEDIATYPES_VALUE = 0x200;
- public static final int F_PRODUCED_MEDIATYPES_VALUE = 1024;
+ public static final int F_PRODUCED_MEDIATYPES_VALUE = 0x400;
- public static final int F_METHOD_PARAMETERS = 2048;
+ public static final int F_METHOD_PARAMETERS = 0x800;
- public static final int F_METHOD_RETURN_TYPE = 4096;
+ public static final int F_METHOD_RETURN_TYPE = 0x1000;
+ public static final int F_TARGET_VALUE = 0x2000;
+
+ public static final int F_RETENTION_VALUE = 0x4000;
+
/**
* Full constructor.
*
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilder.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilder.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilder.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -40,12 +40,9 @@
public static final int SCALE = 10;
- /** The standard 'Java type' marker type. */
- public static final String JAVA_PROBLEM = "org.eclipse.jdt.core.problem";
-
- /** The custom 'JAX-RS Problem' marker type. */
- public static final String JAXRS_PROBLEM = "org.jboss.tools.ws.jaxrs.metamodelMarker";
-
+ /** The builder ID. */
+ public static final String BUILDER_ID = "org.jboss.tools.ws.jaxrs.metamodelBuilder";
+
/** The Java element change listener name. */
public static final QualifiedName JAXRS_ELEMENT_CHANGE_LISTENER_NAME = new QualifiedName(
JBossJaxrsCorePlugin.PLUGIN_ID, "jaxrsPostReconcileListener");
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceDeltaScanner.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceDeltaScanner.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceDeltaScanner.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -25,6 +25,7 @@
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaModelMarker;
import org.jboss.tools.ws.jaxrs.core.internal.utils.ConstantUtils;
import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
import org.jboss.tools.ws.jaxrs.core.internal.utils.WtpUtils;
@@ -105,7 +106,7 @@
int severity = markerDelta.getAttribute(IMarker.SEVERITY, 0);
String type = markerDelta.getType();
String message = markerDelta.getAttribute(IMarker.MESSAGE, "");
- if (severity == IMarker.SEVERITY_ERROR && type.equals("org.eclipse.jdt.core.problem")) {
+ if (severity == IMarker.SEVERITY_ERROR && type.equals(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER)) {
Logger.debug("Marker delta: {} [{}] {}: \"{}\" at line {} (id={})", markerDelta.getResource()
.getName(), ConstantUtils.getStaticFieldName(IResourceDelta.class,
markerDelta.getKind()), ConstantUtils.getStaticFieldName(IMarker.class, severity,
Deleted: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/IValidable.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/IValidable.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/IValidable.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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:
- * Xavier Coulon - Initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-public interface IValidable {
-
- /**
- * Validates the element against JAX-RS business/technical rules. In case of
- * errors or warning, creates appropriate markers on the underlying
- * resource.
- *
- * @param progressMonitor
- * the progress monitor
- * @throws CoreException
- */
- abstract void validate(IProgressMonitor progressMonitor) throws CoreException;
-
-}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBaseElement.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBaseElement.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBaseElement.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -1,10 +1,6 @@
package org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain;
-import java.util.List;
-
import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.wst.validation.ValidatorMessage;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementCategory;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsElement;
@@ -52,9 +48,6 @@
public abstract IResource getResource();
- public abstract List<ValidatorMessage> validate() throws JavaModelException;
-
- public abstract String getName();
+ public abstract String getName();
-
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBuiltinHttpMethod.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBuiltinHttpMethod.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBuiltinHttpMethod.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain;
+import java.util.Arrays;
+
+import org.eclipse.core.resources.IResource;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
/**
@@ -30,12 +33,26 @@
private final String httpVerb;
public JaxrsBuiltinHttpMethod(String annotationName, String annotationValue) {
- super(null, new Annotation(null, annotationName, annotationValue, null), null);
+ super(null, Arrays.asList(new Annotation(null, annotationName, annotationValue, null)), null);
this.annotationName = annotationName;
this.httpVerb = annotationValue;
}
@Override
+ public boolean isBuiltIn() {
+ return true;
+ }
+
+ /**
+ * There is no resource associated with this built-in HTTP Method. Overriding this method prevents NPE (since <code>javaElement<code> attribute is null).
+ * @see org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsJavaElement#getResource()
+ */
+ @Override
+ public IResource getResource() {
+ return null;
+ }
+
+ @Override
public String getHttpVerb() {
return this.httpVerb;
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -26,6 +26,8 @@
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.PRODUCES;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.PROVIDER;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.QUERY_PARAM;
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.RETENTION;
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.TARGET;
import java.util.ArrayList;
import java.util.Arrays;
@@ -269,11 +271,11 @@
*/
public JaxrsHttpMethod createHttpMethod(final IType javaType, final CompilationUnit ast,
final JaxrsMetamodel metamodel) throws CoreException {
- Annotation httpMethodAnnotation = JdtUtils.resolveAnnotation(javaType, ast, HTTP_METHOD.qualifiedName);
- if (httpMethodAnnotation == null) {
+ Map<String, Annotation> annotations = JdtUtils.resolveAnnotations(javaType, ast, HTTP_METHOD.qualifiedName, TARGET.qualifiedName, RETENTION.qualifiedName);
+ if (annotations == null || annotations.isEmpty()) {
return null;
}
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(javaType, httpMethodAnnotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(javaType, metamodel).annotations(annotations.values()).build();
return httpMethod;
}
@@ -291,7 +293,8 @@
final JaxrsMetamodel metamodel) throws CoreException {
if (annotation.getJavaParent() != null && annotation.getJavaParent().getElementType() == IJavaElement.TYPE
&& annotation.getName().equals(HTTP_METHOD.qualifiedName)) {
- return new JaxrsHttpMethod((IType) annotation.getJavaParent(), annotation, metamodel);
+ //return new JaxrsHttpMethod.Builder((IType) annotation.getJavaParent(), metamodel).httpMethod(annotation).build();
+ return createHttpMethod((IType) annotation.getJavaParent(), ast, metamodel);
}
return null;
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -11,16 +11,15 @@
package org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain;
-import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_HTTP_METHOD_VALUE;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.HTTP_METHOD;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
-import org.eclipse.core.resources.IMarker;
import org.eclipse.jdt.core.IType;
-import org.eclipse.wst.validation.ValidatorMessage;
-import org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsMetamodelBuilder;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementCategory;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
@@ -94,37 +93,69 @@
}
}
- public JaxrsHttpMethod(IType javaType, Annotation httpMethodAnnotation, JaxrsMetamodel metamodel) {
- super(javaType, httpMethodAnnotation, metamodel);
+ public static class Builder {
+ final IType javaType;
+ final JaxrsMetamodel metamodel;
+ final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ public Builder(final IType javaType, final JaxrsMetamodel metamodel) {
+ this.javaType = javaType;
+ this.metamodel = metamodel;
+ }
+
+ public Builder retention(final Annotation retentionAnnotation) {
+ if(retentionAnnotation != null) {
+ annotations.add(retentionAnnotation);
+ }
+ return this;
+ }
+
+ public Builder httpMethod(final Annotation httpMethodAnnotation) {
+ if(httpMethodAnnotation != null) {
+ annotations.add(httpMethodAnnotation);
+ }
+ return this;
+ }
+
+ public Builder target(final Annotation targetAnnotation) {
+ if(targetAnnotation != null) {
+ annotations.add(targetAnnotation);
+ }
+ return this;
+ }
+
+ public Builder annotations(final Collection<Annotation> annotations) {
+ if(annotations != null) {
+ this.annotations.addAll(annotations);
+ }
+ return this;
+ }
+ public JaxrsHttpMethod build() {
+ JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(javaType, annotations, metamodel);
+ return httpMethod;
+ }
}
+ /**
+ * Full constructor.
+ *
+ * @param annotations
+ *
+ */
+ JaxrsHttpMethod(IType javaType, List<Annotation> annotations,
+ final JaxrsMetamodel metamodel) {
+ super(javaType, annotations, metamodel);
+ }
+
+ public boolean isBuiltIn() {
+ return false;
+ }
+
@Override
public EnumElementCategory getElementCategory() {
return EnumElementCategory.HTTP_METHOD;
}
- @Override
- public List<ValidatorMessage> validate() {
- List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
- final Annotation annotation = getHttpMethodAnnotation();
- if (annotation == null) {
-
- } else {
- final String httpValue = annotation.getValue("value");
- if (httpValue == null || httpValue.isEmpty()) {
- final ValidatorMessage message = ValidatorMessage
- .create("HTTP Verb should not be empty", getResource());
- message.setAttribute(IMarker.MARKER, JaxrsMetamodelBuilder.JAXRS_PROBLEM);
- message.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
- message.setAttribute(IMarker.CHAR_START, annotation.getSourceRange().getOffset());
- message.setAttribute(IMarker.CHAR_END, annotation.getSourceRange().getOffset()
- + annotation.getSourceRange().getLength());
- messages.add(message);
- }
- }
- return messages;
- }
-
/*
* (non-Javadoc)
*
@@ -141,11 +172,20 @@
return null;
}
- /** @return the httpVerbAnnotation */
- @Override
+ /** @return the HttpMethod Annotation */
public Annotation getHttpMethodAnnotation() {
return getAnnotation(HTTP_METHOD.qualifiedName);
}
+
+ /** @return the Retention Annotation */
+ public Annotation getRetentionAnnotation() {
+ return getAnnotation(Retention.class.getName());
+ }
+
+ /** @return the Target Annotation */
+ public Annotation getTargetAnnotation() {
+ return getAnnotation(Target.class.getName());
+ }
/*
* (non-Javadoc)
@@ -197,15 +237,16 @@
* @return the flags indicating the kind of changes that occurred during the
* update.
*/
- public int update(JaxrsHttpMethod httpMethod) {
- int flags = 0;
+ public int update(final JaxrsHttpMethod httpMethod) {
+ /*int flags = 0;
final Annotation annotation = this.getAnnotation(HTTP_METHOD.qualifiedName);
final Annotation otherAnnotation = httpMethod.getAnnotation(HTTP_METHOD.qualifiedName);
if (annotation != null && otherAnnotation != null && !annotation.equals(otherAnnotation)
&& annotation.update(otherAnnotation)) {
flags += F_HTTP_METHOD_VALUE;
}
- return flags;
+ return flags;*/
+ return mergeAnnotations(httpMethod.getAnnotations());
}
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsJavaApplication.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsJavaApplication.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsJavaApplication.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -13,11 +13,7 @@
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_APPLICATION_PATH_VALUE;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.APPLICATION_PATH;
-import java.util.ArrayList;
-import java.util.List;
-
import org.eclipse.jdt.core.IType;
-import org.eclipse.wst.validation.ValidatorMessage;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementCategory;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
@@ -55,12 +51,6 @@
return EnumElementKind.UNDEFINED;
}
- @Override
- public List<ValidatorMessage> validate() {
- List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
- return messages;
- }
-
/**
* {@inheritDoc}
*/
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsJavaElement.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsJavaElement.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsJavaElement.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -22,6 +22,8 @@
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_PATH_VALUE;
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_PRODUCED_MEDIATYPES_VALUE;
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_QUERY_PARAM_VALUE;
+import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_RETENTION_VALUE;
+import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_TARGET_VALUE;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.APPLICATION_PATH;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.CONSUMES;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.DEFAULT_VALUE;
@@ -31,6 +33,8 @@
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.PATH_PARAM;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.PRODUCES;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.QUERY_PARAM;
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.RETENTION;
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.TARGET;
import java.util.Arrays;
import java.util.HashMap;
@@ -39,10 +43,21 @@
import java.util.Map;
import java.util.Map.Entry;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.validation.ValidatorMessage;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation.JaxrsMetamodelValidator;
import org.jboss.tools.ws.jaxrs.core.internal.utils.CollectionUtils;
+import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
+import org.jboss.tools.ws.jaxrs.core.internal.utils.ValidationMessages;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
+import org.jboss.tools.ws.jaxrs.core.jdt.CompilationUnitsRepository;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsHttpMethod;
@@ -95,7 +110,7 @@
}
}
- Annotation getAnnotation(String className) {
+ public Annotation getAnnotation(String className) {
return annotations.get(className);
}
@@ -208,7 +223,7 @@
iterator.remove();
if (annotationName.equals(PATH.qualifiedName)) {
flag = F_PATH_VALUE;
- }else if (annotationName.equals(APPLICATION_PATH.qualifiedName)) {
+ } else if (annotationName.equals(APPLICATION_PATH.qualifiedName)) {
flag = F_APPLICATION_PATH_VALUE;
} else if (annotationName.equals(HTTP_METHOD.qualifiedName)) {
flag = F_HTTP_METHOD_VALUE;
@@ -222,6 +237,10 @@
flag = F_CONSUMED_MEDIATYPES_VALUE;
} else if (annotationName.equals(PRODUCES.qualifiedName)) {
flag = F_PRODUCED_MEDIATYPES_VALUE;
+ } else if (annotationName.equals(TARGET.qualifiedName)) {
+ flag = F_TARGET_VALUE;
+ } else if (annotationName.equals(RETENTION.qualifiedName)) {
+ flag = F_RETENTION_VALUE;
} else {
for (IJaxrsHttpMethod httpMethod : metamodel.getAllHttpMethods()) {
if (httpMethod.getFullyQualifiedName().equals(annotationName)) {
@@ -284,4 +303,29 @@
return true;
}
+ /**
+ * Creates a validation message from the given parameters. The created validation messages is of the 'JAX-RS' type.
+ * @param msg the message to display
+ * @param severity the severity of the marker
+ * @param region the region that the validation marker points to
+ * @return the created validation message.
+ * @throws JavaModelException
+ ValidatorMessage createValidatorMessage(final String id, final String msg, int severity, final ISourceRange sourceRange)
+ throws JavaModelException {
+ final ValidatorMessage validationMsg = ValidatorMessage.create(msg, this.getResource());
+ validationMsg.setType(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE);
+ final ICompilationUnit compilationUnit = this.getJavaElement().getCompilationUnit();
+ final CompilationUnit ast = CompilationUnitsRepository.getInstance().getAST(compilationUnit);
+ validationMsg.setAttribute(IMarker.LOCATION,
+ NLS.bind(ValidationMessages.LINE_NUMBER, ast.getLineNumber(sourceRange.getOffset())));
+ validationMsg.setAttribute(IMarker.MARKER, JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE);
+ validationMsg.setAttribute(IMarker.SEVERITY, severity);
+ validationMsg.setAttribute(IMarker.CHAR_START, sourceRange.getOffset());
+ validationMsg.setAttribute(IMarker.CHAR_END, sourceRange.getOffset() + sourceRange.getLength());
+ Logger.debug("Validation message for {}: {}", this.getJavaElement().getElementName(),
+ validationMsg.getAttribute(IMarker.MESSAGE));
+ return validationMsg;
+ }
+ */
+
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@@ -249,7 +250,7 @@
// ResourceMethod
if (jaxrsElement.getElementCategory() == EnumElementCategory.RESOURCE) {
final JaxrsResource resource = (JaxrsResource) jaxrsElement;
- for (JaxrsResourceMethod resourceMethod : resource.getMethods().values()) {
+ for (JaxrsBaseElement resourceMethod : resource.getMethods().values()) {
unindexElement(resourceMethod);
}
for (JaxrsResourceField resourceField : ((JaxrsResource) jaxrsElement).getFields().values()) {
@@ -293,6 +294,20 @@
}
/**
+ * Returns an unmodifiable list of all the elements in the Metamodel.
+ * @return
+ */
+ public List<JaxrsBaseElement> getAllElements() {
+ final Collection<Set<JaxrsBaseElement>> values = elementsIndex.values();
+ final List<JaxrsBaseElement> elements = new ArrayList<JaxrsBaseElement>();
+ for (Set<JaxrsBaseElement> subSet : values) {
+ elements.addAll(subSet);
+ }
+ return Collections.unmodifiableList(elements);
+ }
+
+
+ /**
* @return the application that is used to compute the Endpoint's URI Path Templates, or null if no application was
* specified in the code. An invalid application may be returned, though (ie, a Type annotated with
* {@link javax.ws.rs.ApplicationPath} but not extending the {@link javax.ws.rs.Application} type).
@@ -411,6 +426,9 @@
}
public List<JaxrsBaseElement> getElements(final IJavaElement javaElement) {
+ if(javaElement == null) {
+ return Collections.emptyList();
+ }
final String key = javaElement.getHandleIdentifier();
final List<JaxrsBaseElement> result = new ArrayList<JaxrsBaseElement>();
if (elementsIndex.containsKey(key)) {
@@ -436,23 +454,6 @@
}
public void remove(JaxrsBaseElement element) {
- switch (element.getElementKind()) {
- case APPLICATION_WEBXML:
- remove((JaxrsWebxmlApplication) element);
- break;
- default:
- remove((JaxrsJavaElement<?>)element);
- break;
- }
- }
-
- /**
- * Remove the given JAX-RS Element from the metamodel.
- *
- * @param resource
- * @return true if the resource was actually removed, false otherwise.
- */
- public void remove(JaxrsJavaElement<?> element) {
if (element == null) {
return;
}
@@ -482,11 +483,6 @@
unindexElement(element);
}
- public void remove(JaxrsWebxmlApplication application) {
- this.applications.remove(application);
- unindexElement(application);
- }
-
public JaxrsHttpMethod getHttpMethod(Annotation httpMethodAnnotation) {
if (httpMethodAnnotation != null) {
for (IJaxrsHttpMethod httpMethod : httpMethods) {
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsParamBeanProperty.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsParamBeanProperty.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsParamBeanProperty.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -10,11 +10,7 @@
******************************************************************************/
package org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain;
-import java.util.ArrayList;
-import java.util.List;
-
import org.eclipse.jdt.core.IMethod;
-import org.eclipse.wst.validation.ValidatorMessage;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementCategory;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
@@ -36,12 +32,6 @@
}
@Override
- public List<ValidatorMessage> validate() {
- List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
- return messages;
- }
-
- @Override
public EnumElementKind getElementKind() {
return null;
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsProvider.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsProvider.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsProvider.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -16,7 +16,6 @@
import java.util.Map;
import org.eclipse.jdt.core.IType;
-import org.eclipse.wst.validation.ValidatorMessage;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementCategory;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
@@ -102,12 +101,6 @@
}
@Override
- public List<ValidatorMessage> validate() {
- List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
- return messages;
- }
-
- @Override
public EnumElementKind getElementKind() {
final boolean isMessageBodyReader = providedKinds.get(EnumElementKind.MESSAGE_BODY_READER) != null;
final boolean isMessageBodyWriter = providedKinds.get(EnumElementKind.MESSAGE_BODY_WRITER) != null;
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResource.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResource.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResource.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -20,11 +20,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.wst.validation.ValidatorMessage;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementCategory;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
@@ -208,19 +205,11 @@
return resourceFields;
}
+ /**
+ * @return the resource methods indexed by their associated java method handleIdentifier
+ */
public Map<String, JaxrsResourceMethod> getMethods() {
return resourceMethods;
}
- @Override
- public List<ValidatorMessage> validate() throws JavaModelException {
- List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
- // delegating the validation to the undelying resource methods
- for (Entry<String, JaxrsResourceMethod> entry : resourceMethods.entrySet()) {
- final JaxrsResourceMethod resourceMethod = entry.getValue();
- messages.addAll(resourceMethod.validate());
- }
- return messages;
- }
-
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceField.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceField.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceField.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -15,11 +15,9 @@
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.PATH_PARAM;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.QUERY_PARAM;
-import java.util.ArrayList;
import java.util.List;
import org.eclipse.jdt.core.IField;
-import org.eclipse.wst.validation.ValidatorMessage;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementCategory;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
@@ -60,12 +58,6 @@
}
@Override
- public List<ValidatorMessage> validate() {
- List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
- return messages;
- }
-
- @Override
public EnumElementKind getElementKind() {
if (getPathParamAnnotation() != null) {
return EnumElementKind.PATH_PARAM_FIELD;
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -14,30 +14,18 @@
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_METHOD_PARAMETERS;
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_METHOD_RETURN_TYPE;
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_NONE;
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.CONSUMES;
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.PATH;
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.PRODUCES;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
-import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.*;
-
-
-
-import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.validation.ValidatorMessage;
-import org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsMetamodelBuilder;
-import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
-import org.jboss.tools.ws.jaxrs.core.internal.utils.ValidationMessages;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
-import org.jboss.tools.ws.jaxrs.core.jdt.CompilationUnitsRepository;
import org.jboss.tools.ws.jaxrs.core.jdt.JavaMethodParameter;
import org.jboss.tools.ws.jaxrs.core.jdt.JavaMethodSignature;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementCategory;
@@ -49,12 +37,6 @@
public class JaxrsResourceMethod extends JaxrsResourceElement<IMethod>
implements IJaxrsResourceMethod {
- /** The parameter type names that can be annotated with {@link Context}. */
- private final static List<String> CONTEXT_TYPE_NAMES = new ArrayList<String>(Arrays.asList(
- "javax.ws.rs.core.HttpHeaders", "javax.ws.rs.core.UriInfo", "javax.ws.rs.core.Request",
- "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "javax.servlet.ServletConfig",
- "javax.servlet.ServletContext", "javax.ws.rs.core.SecurityContext"));
-
private final JaxrsResource parentResource;
/**
@@ -200,149 +182,6 @@
return EnumElementCategory.RESOURCE_METHOD;
}
- @Override
- public List<ValidatorMessage> validate() throws JavaModelException {
- this.hasErrors(false);
- final List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
- messages.addAll(validateMissingPathValueInPathParamAnnotations());
- messages.addAll(validateMissingPathParamAnnotations());
- messages.addAll(validateParamsWithContextAnnotation());
- messages.addAll(validateSingleParamWithoutAnnotation());
- return messages;
- }
-
- /**
- * Validate that only one method parameter is not annotated with a JAX-RS
- * annotation. This non-annotated parameter is the "Entity parameter",
- * coming from the client's request body, unmarshalled by the appropriate
- * {@link MesssageBodyReader}.
- *
- * @return
- */
- private List<ValidatorMessage> validateSingleParamWithoutAnnotation() {
- final List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
- return messages;
- }
-
- /**
- * Validates that the method parameters annotated with {@link Context} are
- * of the supported types in the spec: {@link UriInfo}, {@link HttpHeaders},
- * {@link ServletConfig}, {@link ServletContext}, {@link HttpServletRequest}
- * , {@link Request}, {@link HttpServletResponse} and {@link Response}.
- *
- * @return
- * @throws JavaModelException
- */
- private List<ValidatorMessage> validateParamsWithContextAnnotation() throws JavaModelException {
- final List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
- for (JavaMethodParameter parameter : this.javaMethodParameters) {
- final Annotation annotation = parameter.getAnnotation(CONTEXT.qualifiedName);
- final String typeName = parameter.getTypeName();
- if (annotation != null && typeName != null
- && !CONTEXT_TYPE_NAMES.contains(typeName)) {
- final String msg = NLS
- .bind(ValidationMessages.INVALID_CONTEXT_ANNOTATION,
- typeName);
- ValidatorMessage validationMsg = createValidationMessage(msg, IMarker.SEVERITY_ERROR, parameter.getRegion().getOffset(), parameter.getRegion().getLength());
- messages.add(validationMsg);
- this.hasErrors(true);
- }
- }
- return messages;
- }
-
- /**
- * Validates that the @Path annotation parameters have a counterpart in the
- * java method paramters, otherwise, issues some markers with a 'warning'
- * severity.
- *
- * @return
- * @throws JavaModelException
- */
- private List<ValidatorMessage> validateMissingPathParamAnnotations()
- throws JavaModelException {
- final List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
- final List<String> pathParamValueProposals = getPathParamValueProposals();
- for (String proposal : pathParamValueProposals) {
- boolean matching = false;
- for (JavaMethodParameter parameter : this.javaMethodParameters) {
- final Annotation annotation = parameter
- .getAnnotation(PATH_PARAM.qualifiedName);
- if (annotation != null && annotation.getValue("value") != null
- && annotation.getValue("value").equals(proposal)) {
- matching = true;
- break;
- }
- }
- if (!matching) {
- final String msg = NLS
- .bind(ValidationMessages.INVALID_PATHPARAM_VALUE,
- proposal);
- final ISourceRange nameRange = getJavaElement().getNameRange();
- ValidatorMessage validationMsg = createValidationMessage(msg, IMarker.SEVERITY_WARNING, nameRange.getOffset(), nameRange.getLength());
- messages.add(validationMsg);
- }
- }
- return messages;
- }
-
- /**
- * Checks that the {@link PathParam} annotation values match the params in
- * the {@link Path} annotations at the method and the parent type levels.
- *
- * @return errors in case of mismatch, empty list otherwise.
- * @throws JavaModelException
- */
- private List<ValidatorMessage> validateMissingPathValueInPathParamAnnotations() throws JavaModelException {
- final List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
- final List<String> pathParamValueProposals = getPathParamValueProposals();
- for (JavaMethodParameter parameter : this.javaMethodParameters) {
- final Annotation annotation = parameter
- .getAnnotation(PATH_PARAM.qualifiedName);
- if (annotation != null) {
- final String value = annotation.getValue("value");
- if(value != null) {
- if (!pathParamValueProposals.contains(value)) {
- final String msg = NLS
- .bind(ValidationMessages.INVALID_PATHPARAM_VALUE,
- pathParamValueProposals);
- final ISourceRange region = annotation.getSourceRange();
- ValidatorMessage validationMsg = createValidationMessage(msg, IMarker.SEVERITY_ERROR, region.getOffset(), region.getLength());
- hasErrors(true);
- messages.add(validationMsg);
- }
- }
- }
- }
- return messages;
- }
-
- /**
- * Creates a validation message from the given parameters. The created validation messages is of the 'JAX-RS' type.
- * @param msg the message to display
- * @param severity the severity of the marker
- * @param region the region that the validation marker points to
- * @return the created validation message.
- * @throws JavaModelException
- */
- private ValidatorMessage createValidationMessage(final String msg,
- int severity, final int offset, int length) throws JavaModelException {
- final ValidatorMessage validationMsg = ValidatorMessage.create(msg,
- this.getResource());
- validationMsg.setType(JaxrsMetamodelBuilder.JAXRS_PROBLEM);
- final ICompilationUnit compilationUnit = this.getJavaElement().getCompilationUnit();
- final CompilationUnit ast = CompilationUnitsRepository.getInstance().getAST(compilationUnit);
- validationMsg.setAttribute(IMarker.LOCATION, NLS.bind(ValidationMessages.LINE_NUMBER, ast.getLineNumber(offset)));
- validationMsg.setAttribute(IMarker.MARKER,
- JaxrsMetamodelBuilder.JAXRS_PROBLEM);
- validationMsg.setAttribute(IMarker.SEVERITY, severity);
- validationMsg.setAttribute(IMarker.CHAR_START, offset);
- validationMsg.setAttribute(IMarker.CHAR_END, offset + length);
- Logger.debug("Validation message for {}: {}", this.getJavaElement()
- .getElementName(), validationMsg.getAttribute(IMarker.MESSAGE));
- return validationMsg;
- }
-
/*
* (non-Javadoc)
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsWebxmlApplication.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsWebxmlApplication.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsWebxmlApplication.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -2,10 +2,7 @@
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_APPLICATION_PATH_VALUE;
-import java.util.List;
-
import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.validation.ValidatorMessage;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementCategory;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsApplication;
@@ -71,12 +68,6 @@
return webxmlResource != null ? webxmlResource.getName() : "*unknown resource*";
}
- @Override
- public List<ValidatorMessage> validate() {
- // TODO Auto-generated method stub
- return null;
- }
-
/*
* (non-Javadoc)
* @see java.lang.Object#hashCode()
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/AbstractJaxrsElementValidatorDelegate.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/AbstractJaxrsElementValidatorDelegate.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/AbstractJaxrsElementValidatorDelegate.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.core.internal.metamodel.validation;
+
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.common.validation.TempMarkerManager;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsBaseElement;
+
+/**
+ * @author Xavier Coulon
+ *
+ */
+public abstract class AbstractJaxrsElementValidatorDelegate<T extends JaxrsBaseElement> {
+
+ private final T element;
+
+ private final TempMarkerManager markerManager;
+
+ public AbstractJaxrsElementValidatorDelegate(TempMarkerManager markerManager, T element) {
+ this.markerManager = markerManager;
+ this.element = element;
+ }
+
+ public abstract void validate() throws CoreException;
+
+ public T getElement() {
+ return element;
+ }
+
+ /**
+ * @return the validator
+ */
+ public TempMarkerManager getMarkerManager() {
+ return markerManager;
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/AbstractJaxrsElementValidatorDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsApplicationValidatorDelegate.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsApplicationValidatorDelegate.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsApplicationValidatorDelegate.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,24 @@
+package org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation;
+
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.common.validation.TempMarkerManager;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsJavaApplication;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsResource;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsResourceMethod;
+import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsResourceMethod;
+
+public class JaxrsApplicationValidatorDelegate extends AbstractJaxrsElementValidatorDelegate<JaxrsJavaApplication> {
+
+ public JaxrsApplicationValidatorDelegate(TempMarkerManager markerManager, JaxrsJavaApplication element) {
+ super(markerManager, element);
+ }
+
+ @Override
+ public void validate() throws CoreException {
+ final JaxrsJavaApplication resource = getElement();
+ MarkerUtils.clearMarkers(resource.getResource());
+ }
+
+
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsApplicationValidatorDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsHttpMethodValidatorDelegate.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsHttpMethodValidatorDelegate.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsHttpMethodValidatorDelegate.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.core.internal.metamodel.validation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.validation.TempMarkerManager;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsHttpMethod;
+import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
+import org.jboss.tools.ws.jaxrs.core.metamodel.quickfix.JaxrsValidationQuickFixes;
+import org.jboss.tools.ws.jaxrs.core.preferences.JaxrsPreferences;
+
+/**
+ * @author Xavier Coulon
+ *
+ */
+public class JaxrsHttpMethodValidatorDelegate extends AbstractJaxrsElementValidatorDelegate<JaxrsHttpMethod> {
+
+ public JaxrsHttpMethodValidatorDelegate(TempMarkerManager markerManager, JaxrsHttpMethod element) {
+ super(markerManager, element);
+ }
+
+ @Override
+ public void validate() throws CoreException {
+ final JaxrsHttpMethod httpMethod = getElement();
+ MarkerUtils.clearMarkers(httpMethod.getResource());
+ if (!httpMethod.isBuiltIn()) {
+ validateHttpMethodAnnotation(httpMethod);
+ validateRetentionAnnotation(getElement());
+ validateTargetAnnotation(getElement());
+ }
+ }
+
+ /**
+ * Validates that annotation value is not null nor empty
+ *
+ * @param messages
+ * @throws JavaModelException
+ */
+ private void validateHttpMethodAnnotation(final JaxrsHttpMethod httpMethod) {
+ final Annotation annotation = httpMethod.getHttpMethodAnnotation();
+ if (annotation != null) { // if annotation is null, the resource is not a JaxrsHttpMethod anymore.
+ final String httpValue = annotation.getValue("value");
+ if (httpValue == null || httpValue.isEmpty()) {
+ getMarkerManager().addProblem(JaxrsValidationMessages.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE,
+ JaxrsPreferences.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE, new String[0],
+ annotation.getSourceRange().getLength(), annotation.getSourceRange().getOffset(),
+ httpMethod.getResource());
+ }
+ }
+ }
+
+ /**
+ * Validate that annotation exists and value is Target.METHOD
+ *
+ * @param messages
+ * @throws JavaModelException
+ */
+ private void validateTargetAnnotation(final JaxrsHttpMethod httpMethod) {
+ final Annotation targetAnnotation = httpMethod.getTargetAnnotation();
+ final Annotation httpMethodAnnotation = httpMethod.getHttpMethodAnnotation();
+ if (targetAnnotation == null) {
+ getMarkerManager().addProblem(JaxrsValidationMessages.HTTP_METHOD_MISSING_TARGET_ANNOTATION,
+ JaxrsPreferences.HTTP_METHOD_MISSING_TARGET_ANNOTATION, new String[0],
+ httpMethodAnnotation.getSourceRange().getLength(),
+ httpMethodAnnotation.getSourceRange().getOffset(), httpMethod.getResource(),
+ JaxrsValidationQuickFixes.HTTP_METHOD_MISSING_TARGET_ANNOTATION_ID);
+ } else {
+ final String annotationValue = targetAnnotation.getValue("value");
+ if (annotationValue == null || !annotationValue.equals(ElementType.METHOD.name())) {
+ getMarkerManager().addProblem(JaxrsValidationMessages.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE,
+ JaxrsPreferences.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE, new String[0],
+ httpMethodAnnotation.getSourceRange().getLength(),
+ httpMethodAnnotation.getSourceRange().getOffset(), httpMethod.getResource(),
+ JaxrsValidationQuickFixes.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE_ID);
+ }
+ }
+ }
+
+ /**
+ * Validate that annotation exists and value is Retention.RUNTIME
+ *
+ * @param messages
+ * @throws JavaModelException
+ */
+ private void validateRetentionAnnotation(final JaxrsHttpMethod httpMethod) {
+ final Annotation retentionAnnotation = httpMethod.getRetentionAnnotation();
+ final Annotation httpMethodAnnotation = httpMethod.getHttpMethodAnnotation();
+ if (retentionAnnotation == null) {
+ getMarkerManager().addProblem(JaxrsValidationMessages.HTTP_METHOD_MISSING_RETENTION_ANNOTATION,
+ JaxrsPreferences.HTTP_METHOD_MISSING_RETENTION_ANNOTATION, new String[0],
+ httpMethodAnnotation.getSourceRange().getLength(),
+ httpMethodAnnotation.getSourceRange().getOffset(), httpMethod.getResource(),
+ JaxrsValidationQuickFixes.HTTP_METHOD_MISSING_RETENTION_ANNOTATION_ID);
+ } else {
+ final String annotationValue = retentionAnnotation.getValue("value");
+ if (annotationValue == null || !annotationValue.equals(RetentionPolicy.RUNTIME.name())) {
+ getMarkerManager().addProblem(JaxrsValidationMessages.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE,
+ JaxrsPreferences.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE, new String[0],
+ httpMethodAnnotation.getSourceRange().getLength(),
+ httpMethodAnnotation.getSourceRange().getOffset(), httpMethod.getResource(),
+ JaxrsValidationQuickFixes.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE_ID);
+ }
+ }
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsHttpMethodValidatorDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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:
- * Xavier Coulon - Initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.ValidatorMessage;
-import org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsMetamodelBuilder;
-import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsBaseElement;
-import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel;
-import org.jboss.tools.ws.jaxrs.core.internal.utils.ConstantUtils;
-import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
-import org.jboss.tools.ws.jaxrs.core.jdt.JdtUtils;
-import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementCategory;
-import org.jboss.tools.ws.jaxrs.core.metamodel.JaxrsMetamodelLocator;
-
-public class JaxrsMetamodelValidator extends AbstractValidator {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.wst.validation.AbstractValidator#validate(org.eclipse.core
- * .resources.IResource, int, org.eclipse.wst.validation.ValidationState,
- * org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
- final ValidationResult validationResult = new ValidationResult();
- final IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
- try {
- subMonitor.beginTask("Validating the JAX-RS Metamodel", 1);
- if (resource.getType() == IResource.FILE && "java".equals(resource.getFileExtension())) {
- clearMarkers((IFile) resource);
- final JaxrsMetamodel jaxrsMetamodel = JaxrsMetamodelLocator.get(resource.getProject());
- if (jaxrsMetamodel == null) {
- return validationResult;
- }
- List<JaxrsBaseElement> elements = jaxrsMetamodel.getElements(JdtUtils.getCompilationUnit(resource));
- for(JaxrsBaseElement element : elements) {
- if (element.getElementCategory() == EnumElementCategory.RESOURCE) {
- Logger.debug("Validating the JAX-RS Metamodel after {} was {}", resource.getName(),
- ConstantUtils.getStaticFieldName(IResourceDelta.class, kind));
- List<ValidatorMessage> validationMessages = element.validate();
- for (ValidatorMessage validationMessage : validationMessages) {
- validationResult.add(validationMessage);
- }
- }
- }
- }
- } catch (CoreException e) {
- Logger.error("Failed to validate the resource change", e);
- } finally {
- subMonitor.done();
- }
- return validationResult;
- }
-
- private void clearMarkers(IFile file) {
- try {
- file.deleteMarkers(JaxrsMetamodelBuilder.JAXRS_PROBLEM, true,
- org.eclipse.core.resources.IResource.DEPTH_INFINITE);
- } catch (CoreException e) {
- }
- }
-
-}
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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:
+ * Xavier Coulon - Initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.jboss.tools.common.validation.ContextValidationHelper;
+import org.jboss.tools.common.validation.EditorValidationContext;
+import org.jboss.tools.common.validation.IAsYouTypeValidator;
+import org.jboss.tools.common.validation.IProjectValidationContext;
+import org.jboss.tools.common.validation.IValidatingProjectTree;
+import org.jboss.tools.common.validation.IValidator;
+import org.jboss.tools.common.validation.TempMarkerManager;
+import org.jboss.tools.common.validation.ValidatorManager;
+import org.jboss.tools.common.validation.internal.SimpleValidatingProjectTree;
+import org.jboss.tools.ws.jaxrs.core.configuration.ProjectNatureUtils;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsMetamodelBuilder;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsBaseElement;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsHttpMethod;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsResource;
+import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
+import org.jboss.tools.ws.jaxrs.core.jdt.JdtUtils;
+import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsApplication;
+import org.jboss.tools.ws.jaxrs.core.metamodel.JaxrsMetamodelLocator;
+import org.jboss.tools.ws.jaxrs.core.preferences.JaxrsPreferences;
+
+@SuppressWarnings("restriction")
+public class JaxrsMetamodelValidator extends TempMarkerManager implements IValidator, IAsYouTypeValidator {
+
+ /** The JAX-RS Validator ID. */
+ public static final String ID = "org.jboss.tools.ws.jaxrs.JaxrsMetamodelValidator"; //$NON-NLS-1$
+
+ /** The custom 'JAX-RS Problem' marker type. */
+ public static final String JAXRS_PROBLEM_TYPE = "org.jboss.tools.ws.jaxrs.metamodelMarker";
+
+ private static final String BUNDLE_NAME = JaxrsMetamodelValidator.class.getPackage().getName() + ".messages";
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.validation.IValidator#isEnabled(org.eclipse.core.resources.IProject)
+ */
+ public boolean isEnabled(IProject project) {
+ return JaxrsPreferences.isValidationEnabled(project);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.validation.IValidator#shouldValidate(org.eclipse .core.resources.IProject)
+ */
+ public boolean shouldValidate(IProject project) {
+ try {
+ return project.isAccessible() && project.hasNature(ProjectNatureUtils.JAXRS_NATURE_ID)
+ && isEnabled(project);
+ } catch (CoreException e) {
+ Logger.error("Failed to check if JAX-RS validation is required for project '" + project.getName() + "'", e);
+ }
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.validation.IValidator#validate(java.util.Set,
+ * org.eclipse.core.resources.IProject, org.jboss.tools.jst.web.kb.internal.validation.ContextValidationHelper,
+ * org.jboss.tools.jst.web.kb.validation.IProjectValidationContext,
+ * org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager,
+ * org.eclipse.wst.validation.internal.provisional.core.IReporter)
+ */
+ public IStatus validate(Set<IFile> changedFiles, IProject project, ContextValidationHelper validationHelper,
+ IProjectValidationContext context, ValidatorManager manager, IReporter reporter) throws ValidationException {
+ init(project, validationHelper, context, manager, reporter);
+ setAsYouTypeValidation(false);
+ for (IFile changedFile : changedFiles) {
+ validate(reporter, changedFile);
+ }
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * @param reporter
+ * @param file
+ * @throws CoreException
+ */
+ private void validate(final IReporter reporter, final IFile file) {
+ if (reporter.isCancelled() || !file.isAccessible()) {
+ return;
+ }
+ displaySubtask(JaxrsValidationMessages.VALIDATING_RESOURCE,
+ new String[] { file.getProject().getName(), file.getName() });
+ try {
+ // clearMarkers((IFile) resource);
+ final JaxrsMetamodel jaxrsMetamodel = JaxrsMetamodelLocator.get(file.getProject());
+ if (jaxrsMetamodel != null) {
+ List<JaxrsBaseElement> elements = jaxrsMetamodel.getElements(JdtUtils.getCompilationUnit(file));
+ for (JaxrsBaseElement element : elements) {
+ validate(element);
+ }
+ }
+ } catch (CoreException e) {
+ Logger.error("Failed to validate the resource change", e);
+ }
+ }
+
+ @Override
+ public void validate(org.eclipse.wst.validation.internal.provisional.core.IValidator validatorManager,
+ IProject rootProject, Collection<IRegion> dirtyRegions, IValidationContext helper, IReporter reporter,
+ EditorValidationContext validationContext, IProjectValidationContext projectContext, IFile file) {
+ ContextValidationHelper validationHelper = new ContextValidationHelper();
+ validationHelper.setProject(rootProject);
+ validationHelper.setValidationContextManager(validationContext);
+ init(rootProject, validationHelper, projectContext, validatorManager, reporter);
+ setAsYouTypeValidation(false);
+ this.document = validationContext.getDocument();
+ displaySubtask(JaxrsValidationMessages.VALIDATING_RESOURCE,
+ new String[] { file.getProject().getName(), file.getName() });
+ validate(reporter, file);
+ }
+
+ @Override
+ public IStatus validateAll(IProject project, ContextValidationHelper validationHelper,
+ IProjectValidationContext validationContext, ValidatorManager manager, IReporter reporter)
+ throws ValidationException {
+ init(project, validationHelper, validationContext, manager, reporter);
+ setAsYouTypeValidation(false);
+ displaySubtask(JaxrsValidationMessages.VALIDATING_PROJECT, new String[] { project.getName() });
+ try {
+ final JaxrsMetamodel jaxrsMetamodel = JaxrsMetamodelLocator.get(project);
+ // validate that the number of jax-rs applications (java or web.xml) is 1.
+ validateJaxrsApplicationDeclarations(jaxrsMetamodel);
+ // validate all other elements
+ if (jaxrsMetamodel != null) {
+ for (JaxrsBaseElement element : jaxrsMetamodel.getAllElements()) {
+ validate(element);
+ }
+ }
+ } catch (CoreException e) {
+ Logger.error("Failed to validate project '", e);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ private void validateJaxrsApplicationDeclarations(JaxrsMetamodel jaxrsMetamodel) throws CoreException {
+ MarkerUtils.clearMarkers(jaxrsMetamodel.getProject());
+ final List<IJaxrsApplication> allApplications = jaxrsMetamodel.getAllApplications();
+ if(allApplications.isEmpty()) {
+ this.addProblem(JaxrsValidationMessages.APPLICATION_NO_OCCURRENCE_FOUND,
+ JaxrsPreferences.APPLICATION_NO_OCCURRENCE_FOUND, new String[0],
+ 0, 0, jaxrsMetamodel.getProject());
+
+ } else if(allApplications.size() > 1) {
+ this.addProblem(JaxrsValidationMessages.APPLICATION_TOO_MANY_OCCURRENCES,
+ JaxrsPreferences.APPLICATION_TOO_MANY_OCCURRENCES, new String[0],
+ 0, 0, jaxrsMetamodel.getProject());
+ }
+ }
+
+ /**
+ * Uses the appropriate validator to validate the given JAX-RS element, or does nothing if no validator could be
+ * found.
+ *
+ * @param element
+ * @throws CoreException
+ */
+ private void validate(JaxrsBaseElement element) throws CoreException {
+ Logger.debug("Validating element {}", element.getName());
+ switch (element.getElementCategory()) {
+ case APPLICATION:
+ break;
+ case HTTP_METHOD:
+ new JaxrsHttpMethodValidatorDelegate(this, (JaxrsHttpMethod) element).validate();
+ case PROVIDER:
+ break;
+ case RESOURCE:
+ // this validator delegate also deals with ResourceMethods and ResourceFields
+ new JaxrsResourceValidatorDelegate(this, (JaxrsResource) element).validate();
+ default:
+ // skipping other categories of elements at this validator level. (see above)
+ break;
+ }
+ }
+
+ @Override
+ protected String getMessageBundleName() {
+ return BUNDLE_NAME;
+ }
+
+ @Override
+ protected String getPreference(IProject project, String preferenceKey) {
+ return JaxrsPreferences.getInstance().getProjectPreference(project, preferenceKey);
+ }
+
+ @Override
+ protected String getPreferencePageId() {
+ return "org.jboss.tools.ws.jaxrs.ui";
+ }
+
+ @Override
+ public int getMaxNumberOfMarkersPerFile(IProject project) {
+ return JaxrsPreferences.getMaxNumberOfProblemMarkersPerFile(project);
+ }
+
+ @Override
+ public String getMarkerType() {
+ return JAXRS_PROBLEM_TYPE;
+ }
+
+ @Override
+ public String getId() {
+ return ID;
+ }
+
+ @Override
+ public String getBuilderId() {
+ return JaxrsMetamodelBuilder.BUILDER_ID;
+ }
+
+ @Override
+ public IValidatingProjectTree getValidatingProjects(IProject project) {
+ return new SimpleValidatingProjectTree(project);
+ }
+
+}
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceMethodValidatorDelegate.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceMethodValidatorDelegate.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceMethodValidatorDelegate.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.core.internal.metamodel.validation;
+
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.CONTEXT;
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.PATH_PARAM;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.validation.TempMarkerManager;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsResourceMethod;
+import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
+import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
+import org.jboss.tools.ws.jaxrs.core.jdt.JavaMethodParameter;
+import org.jboss.tools.ws.jaxrs.core.preferences.JaxrsPreferences;
+
+/**
+ * Validates the given JAX-RS resource
+ *
+ * @author Xavier Coulon
+ *
+ */
+public class JaxrsResourceMethodValidatorDelegate extends AbstractJaxrsElementValidatorDelegate<JaxrsResourceMethod> {
+
+ /** The parameter type names that can be annotated with <code>Context</code>. */
+ private final static List<String> CONTEXT_TYPE_NAMES = new ArrayList<String>(Arrays.asList(
+ "javax.ws.rs.core.HttpHeaders", "javax.ws.rs.core.UriInfo", "javax.ws.rs.core.Request",
+ "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse",
+ "javax.servlet.ServletConfig", "javax.servlet.ServletContext", "javax.ws.rs.core.SecurityContext"));
+
+ private static final Pattern pattern = Pattern.compile("[a-zA-Z1-9]+");
+
+ public JaxrsResourceMethodValidatorDelegate(final TempMarkerManager markerManager,
+ final JaxrsResourceMethod resourceMethod) {
+ super(markerManager, resourceMethod);
+
+ }
+
+ @Override
+ public void validate() {
+ final JaxrsResourceMethod resourceMethod = getElement();
+ try {
+ resourceMethod.hasErrors(false);
+ validatePublicModifierOnJavaMethod(resourceMethod);
+ validateNoUnboundPathAnnotationTemplateParameters(resourceMethod);
+ validateNoUnboundPathParamAnnotationValues(resourceMethod);
+ validateNoUnauthorizedContextAnnotationOnJavaMethodParameters(resourceMethod);
+ validateAtMostOneMethodParameterWithoutAnnotation(resourceMethod);
+ } catch (JavaModelException e) {
+ Logger.error("Failed to validate JAX-RS Resource Method '" + resourceMethod.getName() + "'", e);
+ }
+ }
+
+ /**
+ * Validate that at most one method parameter is not annotated with a JAX-RS annotation. This non-annotated
+ * parameter is the "Entity parameter", coming from the client's request body, unmarshalled by the appropriate
+ * {@link MesssageBodyReader}.
+ *
+ * @return
+ * @throws JavaModelException
+ */
+ private void validateAtMostOneMethodParameterWithoutAnnotation(final JaxrsResourceMethod resourceMethod)
+ throws JavaModelException {
+ int counter = 0;
+ for (JavaMethodParameter parameter : resourceMethod.getJavaMethodParameters()) {
+ // Should count parameters annotated with:
+ // @MatrixParam, @QueryParam, @PathParam, @CookieParam, @HeaderParam, @Context or @FormParam
+ final List<Annotation> jaxrsAnnotations = parameter.getAnnotations();
+ if (jaxrsAnnotations.size() == 0) {
+ counter++;
+ }
+ }
+ if (counter > 1) {
+ final ISourceRange nameRange = resourceMethod.getJavaElement().getNameRange();
+ Logger.debug("Reporting problem of type {} on ResourceMethod {}.{}",
+ JaxrsPreferences.RESOURCE_METHOD_MORE_THAN_ONE_UNANNOTATED_PARAMETER, resourceMethod
+ .getParentResource().getName(), resourceMethod.getName());
+ getMarkerManager().addProblem(JaxrsValidationMessages.RESOURCE_METHOD_MORE_THAN_ONE_UNANNOTATED_PARAMETER,
+ JaxrsPreferences.RESOURCE_METHOD_MORE_THAN_ONE_UNANNOTATED_PARAMETER, new String[0],
+ nameRange.getLength(), nameRange.getOffset(), resourceMethod.getResource());
+ resourceMethod.hasErrors(true);
+ }
+ }
+
+ /**
+ * Validates that the method parameters annotated with <code>Context</code> are of the supported types in the spec:
+ * <code>UriInfo</code>, <code>HttpHeaders<code>, <code>ServletConfig</code>, <code>ServletContext</code>,
+ * <code>HttpServletRequest</code> , <code>Request</code>, <code>HttpServletResponse</code> and
+ * <code>@link Response</code>.
+ *
+ * @return
+ * @throws JavaModelException
+ */
+ private void validateNoUnauthorizedContextAnnotationOnJavaMethodParameters(final JaxrsResourceMethod resourceMethod) {
+ for (JavaMethodParameter parameter : resourceMethod.getJavaMethodParameters()) {
+ final Annotation contextAnnotation = parameter.getAnnotation(CONTEXT.qualifiedName);
+ final String typeName = parameter.getTypeName();
+ if (contextAnnotation != null && typeName != null && !CONTEXT_TYPE_NAMES.contains(typeName)) {
+ Logger.debug("Reporting problem of type {} on ResourceMethod {}.{}",
+ JaxrsPreferences.RESOURCE_METHOD_ILLEGAL_CONTEXT_ANNOTATION, resourceMethod.getParentResource()
+ .getName(), resourceMethod.getName());
+ getMarkerManager().addProblem(JaxrsValidationMessages.RESOURCE_METHOD_ILLEGAL_CONTEXT_ANNOTATION,
+ JaxrsPreferences.RESOURCE_METHOD_ILLEGAL_CONTEXT_ANNOTATION,
+ new String[] { CONTEXT_TYPE_NAMES.toString() }, contextAnnotation.getSourceRange().getLength(),
+ contextAnnotation.getSourceRange().getOffset(), resourceMethod.getResource());
+ resourceMethod.hasErrors(true);
+ }
+ }
+ }
+
+ /**
+ * Checks that there is no unbound Path template parameter in the <code>@Path</code> annotations by checking the
+ * method @PathParam annotated parameters. Report a problem if a Path template parameter has no equivalent in the
+ * java method's parameters.
+ *
+ * @return errors in case of mismatch, empty list otherwise.
+ * @throws JavaModelException
+ */
+ private void validateNoUnboundPathAnnotationTemplateParameters(final JaxrsResourceMethod resourceMethod)
+ throws JavaModelException {
+ final List<String> pathParamValueProposals = resourceMethod.getPathParamValueProposals();
+ final List<String> pathParamValues = new ArrayList<String>();
+ for (JavaMethodParameter parameter : resourceMethod.getJavaMethodParameters()) {
+ final Annotation annotation = parameter.getAnnotation(PATH_PARAM.qualifiedName);
+ if (annotation != null && annotation.getValue() != null) {
+ pathParamValues.add(annotation.getValue());
+ }
+ }
+ final ISourceRange nameRange = resourceMethod.getJavaElement().getNameRange();
+ for (String pathTemplateParameter : pathParamValueProposals) {
+ if (!pathParamValues.contains(pathTemplateParameter)) {
+ Logger.debug("Reporting problem of type {} on ResourceMethod {}.{}",
+ JaxrsPreferences.RESOURCE_METHOD_UNBOUND_PATH_ANNOTATION_TEMPLATE_PARAMETER, resourceMethod
+ .getParentResource().getName(), resourceMethod.getName());
+ getMarkerManager().addProblem(
+ JaxrsValidationMessages.RESOURCE_METHOD_UNBOUND_PATH_ANNOTATION_TEMPLATE_PARAMETER,
+ JaxrsPreferences.RESOURCE_METHOD_UNBOUND_PATH_ANNOTATION_TEMPLATE_PARAMETER,
+ new String[] { pathTemplateParameter }, nameRange.getLength(), nameRange.getOffset(),
+ resourceMethod.getResource());
+ resourceMethod.hasErrors(true);
+ }
+ }
+ }
+
+ /**
+ * Report a problem for each <code>@PathParam</code> annotation value that have no counterpart in the
+ * <code>@Path</code> template parameters.
+ *
+ * @return
+ * @throws JavaModelException
+ */
+ private void validateNoUnboundPathParamAnnotationValues(final JaxrsResourceMethod resourceMethod)
+ throws JavaModelException {
+ final List<String> pathParamValueProposals = resourceMethod.getPathParamValueProposals();
+ for (JavaMethodParameter parameter : resourceMethod.getJavaMethodParameters()) {
+ final Annotation annotation = parameter.getAnnotation(PATH_PARAM.qualifiedName);
+ if (annotation != null) {
+ final String pathParamValue = annotation.getValue("value");
+ if (pathParamValue != null) {
+ if (!pattern.matcher(pathParamValue).matches()) {
+ final ISourceRange sourceRange = annotation.getSourceRange();
+ Logger.debug("Reporting problem of type {} on ResourceMethod {}.{}",
+ JaxrsPreferences.RESOURCE_METHOD_INVALID_PATHPARAM_ANNOTATION_VALUE, resourceMethod
+ .getParentResource().getName(), resourceMethod.getName());
+ getMarkerManager().addProblem(
+ JaxrsValidationMessages.RESOURCE_METHOD_UNBOUND_PATHPARAM_ANNOTATION_VALUE,
+ JaxrsPreferences.RESOURCE_METHOD_UNBOUND_PATHPARAM_ANNOTATION_VALUE,
+ new String[] { pathParamValue }, sourceRange.getLength(), sourceRange.getOffset(),
+ resourceMethod.getResource());
+ resourceMethod.hasErrors(true);
+ } else if (!pathParamValueProposals.contains(pathParamValue)) {
+ final ISourceRange sourceRange = annotation.getSourceRange();
+ Logger.debug("Reporting problem of type {} on ResourceMethod {}.{}",
+ JaxrsPreferences.RESOURCE_METHOD_UNBOUND_PATHPARAM_ANNOTATION_VALUE, resourceMethod
+ .getParentResource().getName(), resourceMethod.getName());
+ getMarkerManager().addProblem(
+ JaxrsValidationMessages.RESOURCE_METHOD_UNBOUND_PATHPARAM_ANNOTATION_VALUE,
+ JaxrsPreferences.RESOURCE_METHOD_UNBOUND_PATHPARAM_ANNOTATION_VALUE,
+ new String[] { pathParamValue }, sourceRange.getLength(), sourceRange.getOffset(),
+ resourceMethod.getResource());
+ resourceMethod.hasErrors(true);
+ }
+ }
+ }
+ }
+ }
+
+ private void validatePublicModifierOnJavaMethod(final JaxrsResourceMethod resourceMethod) throws JavaModelException {
+ final IMethod javaMethod = resourceMethod.getJavaElement();
+ if(javaMethod != null && !Flags.isPublic(javaMethod.getFlags())) {
+ final ISourceRange nameRange = javaMethod.getNameRange();
+ getMarkerManager().addProblem(
+ JaxrsValidationMessages.RESOURCE_METHOD_NO_PUBLIC_MODIFIER,
+ JaxrsPreferences.RESOURCE_METHOD_NO_PUBLIC_MODIFIER,
+ new String[0], nameRange.getLength(), nameRange.getOffset(),
+ resourceMethod.getResource());
+ }
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceMethodValidatorDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceValidatorDelegate.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceValidatorDelegate.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceValidatorDelegate.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,28 @@
+package org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation;
+
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.common.validation.TempMarkerManager;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsResource;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsResourceMethod;
+import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsResourceMethod;
+
+public class JaxrsResourceValidatorDelegate extends AbstractJaxrsElementValidatorDelegate<JaxrsResource> {
+
+ public JaxrsResourceValidatorDelegate(TempMarkerManager markerManager, JaxrsResource element) {
+ super(markerManager, element);
+ }
+
+ @Override
+ public void validate() throws CoreException {
+ final JaxrsResource resource = getElement();
+ MarkerUtils.clearMarkers(resource.getResource());
+ for(IJaxrsResourceMethod resourceMethod : resource.getAllMethods()) {
+ new JaxrsResourceMethodValidatorDelegate(getMarkerManager(), (JaxrsResourceMethod) resourceMethod).validate();
+ }
+ }
+
+ private void validateConstructorParameters() {
+ //TODO...
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceValidatorDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationErrorManager.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationErrorManager.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationErrorManager.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.core.internal.metamodel.validation;
+
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.common.validation.TempMarkerManager;
+import org.jboss.tools.ws.jaxrs.core.preferences.JaxrsPreferences;
+
+abstract public class JaxrsValidationErrorManager extends TempMarkerManager {
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#getPreference(org.eclipse.core.resources.IProject, java.lang.String)
+ */
+ @Override
+ protected String getPreference(IProject project, String preferenceKey) {
+ return severityPreferences.getProjectPreference(project, preferenceKey);
+ }
+
+ SeverityPreferences severityPreferences = JaxrsPreferences.getInstance();
+
+ protected void setSeverityPreferences(SeverityPreferences severityPreferences) {
+ this.severityPreferences = (severityPreferences == null) ? JaxrsPreferences.getInstance() : severityPreferences;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#getMaxNumberOfMarkersPerFile(org.eclipse.core.resources.IProject)
+ */
+ @Override
+ public int getMaxNumberOfMarkersPerFile(IProject project) {
+ return JaxrsPreferences.getMaxNumberOfProblemMarkersPerFile(project);
+ }
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationErrorManager.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationMessages.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationMessages.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.core.internal.metamodel.validation;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class JaxrsValidationMessages {
+
+ private static final String BUNDLE_NAME = JaxrsValidationMessages.class.getName(); //$NON-NLS-1$
+
+ public static String SEARCHING_RESOURCES;
+ public static String VALIDATING_RESOURCE;
+ public static String VALIDATING_PROJECT;
+
+ public static String HTTP_METHOD_MISSING_RETENTION_ANNOTATION;
+ public static String HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE;
+ public static String HTTP_METHOD_MISSING_TARGET_ANNOTATION;
+ public static String HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE;
+
+ public static String RESOURCE_METHOD_ILLEGAL_CONTEXT_ANNOTATION;
+ public static String RESOURCE_METHOD_UNBOUND_PATHPARAM_ANNOTATION_VALUE;
+ public static String RESOURCE_METHOD_UNBOUND_PATH_ANNOTATION_TEMPLATE_PARAMETER;
+ public static String RESOURCE_METHOD_MORE_THAN_ONE_UNANNOTATED_PARAMETER;
+ public static String RESOURCE_METHOD_INVALID_PATHPARAM_ANNOTATION_VALUE;
+ public static String RESOURCE_METHOD_NO_PUBLIC_MODIFIER;
+
+ public static String APPLICATION_NO_OCCURRENCE_FOUND;
+ public static String APPLICATION_TOO_MANY_OCCURRENCES;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, JaxrsValidationMessages.class);
+ }
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationMessages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationMessages.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationMessages.properties (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationMessages.properties 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,18 @@
+SEARCHING_RESOURCES=project "{0}"; searching resources for validation (JAX-RS Validator).
+VALIDATING_RESOURCE=project "{0}"; resource "{1}" (JAX-RS Validator)
+VALIDATING_PROJECT=project "{0}" (JAX-RS Validator)
+
+
+HTTP_METHOD_MISSING_RETENTION_ANNOTATION=The HTTP Method should have a @Retention(RetentionPolicy.RUNTIME) annotation on its type.
+HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE=The @Retention annotation value is not correct. It should be RetentionPolicy.RUNTIME
+HTTP_METHOD_MISSING_TARGET_ANNOTATION=The HTTP Method should have a @Target(ElementType.METHOD) annotation on its type.
+HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE=The @Target annotation value is not correct. It should be ElementType.METHOD
+
+RESOURCE_METHOD_ILLEGAL_CONTEXT_ANNOTATION=@Context annotation is only allowed on method parameters of type {0}.
+RESOURCE_METHOD_MORE_THAN_ONE_UNANNOTATED_PARAMETER=At most one method parameter may be declared without any JAX-RS annotation to map the incoming request entity body.
+RESOURCE_METHOD_UNBOUND_PATHPARAM_ANNOTATION_VALUE=@PathParam value "{0}" does not match any @Path annotation template parameters of the java method and the enclosing java type.
+RESOURCE_METHOD_UNBOUND_PATH_ANNOTATION_TEMPLATE_PARAMETER=The @Path template parameter "{0}" is not bound to any @Path template parameter.
+RESOURCE_METHOD_INVALID_PATHPARAM_ANNOTATION_VALUE=The @PathParam annotation value "{0}" should be alphanumeric.
+RESOURCE_METHOD_NO_PUBLIC_MODIFIER=The method "{0}" should be public.
+APPLICATION_NO_OCCURRENCE_FOUND=No JAX-RS Activator is defined for the project.
+APPLICATION_TOO_MANY_OCCURRENCES=Multiple JAX-RS Activators are defined for the project.
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsValidationMessages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.core.internal.metamodel.validation;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
+
+/**
+ * @author Xavier Coulon
+ * The class name says it all.
+ */
+public class MarkerUtils {
+
+ public static void clearMarkers(IResource resource) throws CoreException {
+ if (resource == null) {
+ return;
+ }
+ Logger.debug("Clearing JAXRS markers for resource " + resource.getName());
+ resource.deleteMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, true, org.eclipse.core.resources.IResource.DEPTH_INFINITE);
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/Annotation.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/Annotation.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/Annotation.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -95,14 +95,26 @@
public ISourceRange getSourceRange() {
return sourceRange;
}
-
+
/** @return the value */
- public List<String> getValues(String elementName) {
+ public List<String> getValues(final String elementName) {
return javaAnnotationElements.get(elementName);
}
+ /** @return the default value */
+ public String getValue() {
+ final List<String> values = javaAnnotationElements.get("value");
+ if (values != null) {
+ assert !(values.size() > 1);
+ if (values.size() == 1) {
+ return values.get(0);
+ }
+ }
+ return null;
+ }
+
/** @return the value */
- public String getValue(String elementName) {
+ public String getValue(final String elementName) {
final List<String> values = javaAnnotationElements.get(elementName);
if (values != null) {
assert !(values.size() > 1);
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/EnumJaxrsClassname.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/EnumJaxrsClassname.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/EnumJaxrsClassname.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -10,55 +10,62 @@
******************************************************************************/
package org.jboss.tools.ws.jaxrs.core.jdt;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
/**
* @author Xavier Coulon
*
*/
public enum EnumJaxrsClassname {
- DELETE("javax.ws.rs.DELETE"),
+ DELETE("javax.ws.rs.DELETE", "DELETE"),
- GET("javax.ws.rs.GET"),
+ GET("javax.ws.rs.GET", "GET"),
- POST("javax.ws.rs.POST"),
+ POST("javax.ws.rs.POST", "POST"),
- PUT("javax.ws.rs.PUT"),
+ PUT("javax.ws.rs.PUT", "PUT"),
- HEAD("javax.ws.rs.HEAD"),
+ HEAD("javax.ws.rs.HEAD", "HEAD"),
- OPTIONS("javax.ws.rs.OPTIONS"),
+ OPTIONS("javax.ws.rs.OPTIONS", "OPTIONS"),
- HTTP_METHOD("javax.ws.rs.HttpMethod"),
+ HTTP_METHOD("javax.ws.rs.HttpMethod", "HttpMethod"),
- APPLICATION("javax.ws.rs.core.Application"),
+ TARGET(Target.class.getName(), "Target"),
- APPLICATION_PATH("javax.ws.rs.ApplicationPath"),
+ RETENTION(Retention.class.getName(), "Retention"),
+ APPLICATION("javax.ws.rs.core.Application", "Application"),
+
+ APPLICATION_PATH("javax.ws.rs.ApplicationPath", "ApplicationPath"),
+
MESSAGE_BODY_READER("javax.ws.rs.ext.MessageBodyReader"),
MESSAGE_BODY_WRITER("javax.ws.rs.ext.MessageBodyWriter"),
EXCEPTION_MAPPER("javax.ws.rs.ext.ExceptionMapper"),
- PATH("javax.ws.rs.Path"),
+ PATH("javax.ws.rs.Path", "Path"),
- PATH_PARAM("javax.ws.rs.PathParam"),
+ PATH_PARAM("javax.ws.rs.PathParam", "PathParam"),
- CONSUMES("javax.ws.rs.Consumes"),
+ CONSUMES("javax.ws.rs.Consumes", "Consumes"),
- PRODUCES("javax.ws.rs.Produces"),
+ PRODUCES("javax.ws.rs.Produces", "Produces"),
- DEFAULT_VALUE("javax.ws.rs.DefaultValue"),
+ DEFAULT_VALUE("javax.ws.rs.DefaultValue", "DefaultValue"),
- COOKIE_PARAM("javax.ws.rs.CookieParam"),
+ COOKIE_PARAM("javax.ws.rs.CookieParam", "CookieParam"),
- HEADER_PARAM("javax.ws.rs.HeaderParam"),
+ HEADER_PARAM("javax.ws.rs.HeaderParam", "HeaderParam"),
- MATRIX_PARAM("javax.ws.rs.MatrixParam"),
+ MATRIX_PARAM("javax.ws.rs.MatrixParam", "MatrixParam"),
- QUERY_PARAM("javax.ws.rs.QueryParam"),
+ QUERY_PARAM("javax.ws.rs.QueryParam", "QueryParam"),
- CONTEXT("javax.ws.rs.core.Context"),
+ CONTEXT("javax.ws.rs.core.Context", "Context"),
HTTP_HEADERS("javax.ws.rs.core.HttpHeaders"),
@@ -68,14 +75,22 @@
URI_INFO("javax.ws.rs.core.UriInfo"),
- ENCODED("javax.ws.rs.Encoded"),
+ ENCODED("javax.ws.rs.Encoded", "Encoded"),
- PROVIDER("javax.ws.rs.ext.Provider");
+ PROVIDER("javax.ws.rs.ext.Provider", "Provider");
public final String qualifiedName;
+
+ public final String annotationName;
private EnumJaxrsClassname(final String qualifiedName) {
this.qualifiedName = qualifiedName;
+ this.annotationName = null;
}
+ private EnumJaxrsClassname(final String qualifiedName, final String annotationName) {
+ this.qualifiedName = qualifiedName;
+ this.annotationName = annotationName;
+ }
+
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaAnnotationsVisitor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaAnnotationsVisitor.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaAnnotationsVisitor.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -28,6 +28,8 @@
import org.eclipse.jdt.core.dom.FieldDeclaration;
import org.eclipse.jdt.core.dom.IAnnotationBinding;
import org.eclipse.jdt.core.dom.IMemberValuePairBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.IVariableBinding;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
@@ -239,10 +241,10 @@
final List<String> values = new ArrayList<String>();
if (binding.getValue() instanceof Object[]) {
for (Object v : (Object[]) binding.getValue()) {
- values.add(v.toString());
+ values.add(toString(v));
}
} else {
- values.add(binding.getValue().toString());
+ values.add(toString(binding.getValue()));
}
annotationElements.put(binding.getName(), values);
}
@@ -258,4 +260,25 @@
return annotationElements;
}
+ /**
+ * Converts the given value into String. The actual types that are supported are:
+ * java.lang.Class - the ITypeBinding for the class object
+ * java.lang.String - the string value itself
+ * enum type - the IVariableBinding for the enum constant
+ * annotation type - an IAnnotationBinding
+ * for other types, the <code>java.lang.Object{@link #toString()}</code> method is used.
+ * @param value
+ * @return litteral value
+ */
+ private static String toString(Object value) {
+ if(value instanceof ITypeBinding) {
+ return ((ITypeBinding)value).getQualifiedName();
+ } else if(value instanceof IVariableBinding) {
+ return ((IVariableBinding)value).getName();
+ } else if(value instanceof IAnnotationBinding) {
+ return ((IAnnotationBinding)value).getName();
+ }
+ return value.toString();
+ }
+
}
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodParameter.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodParameter.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodParameter.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -13,30 +13,22 @@
import java.util.List;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.TypedRegion;
-import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.IValidable;
+import org.eclipse.jdt.core.ISourceRange;
-public class JavaMethodParameter implements IValidable {
+public class JavaMethodParameter {
private final String typeName;
private final List<Annotation> annotations;
- private final TypedRegion region;
+ private final ISourceRange sourceRange;
- public JavaMethodParameter(String name, String typeName, List<Annotation> annotations, final TypedRegion region) {
+ public JavaMethodParameter(String name, String typeName, List<Annotation> annotations, final ISourceRange sourceRange) {
this.typeName = typeName;
this.annotations = annotations;
- this.region = region;
+ this.sourceRange = sourceRange;
}
- @Override
- public void validate(IProgressMonitor progressMonitor) throws CoreException {
- // TODO Auto-generated method stub
- }
-
/** @return the parameterType */
public String getTypeName() {
return this.typeName;
@@ -58,8 +50,8 @@
/**
* @return the region
*/
- public TypedRegion getRegion() {
- return region;
+ public ISourceRange getRegion() {
+ return sourceRange;
}
@Override
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -30,8 +30,6 @@
import org.eclipse.jdt.core.dom.IVariableBinding;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.TypedRegion;
import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
public class JavaMethodSignaturesVisitor extends ASTVisitor {
@@ -110,9 +108,8 @@
annotationElements, sourceRange));
}
}
- final TypedRegion typedRegion = new TypedRegion(parameter.getStartPosition(),
- parameter.getLength(), IDocument.DEFAULT_CONTENT_TYPE);
- methodParameters.add(new JavaMethodParameter(paramName, paramTypeName, paramAnnotations, typedRegion));
+ final ISourceRange sourceRange = new SourceRange(parameter.getStartPosition(), parameter.getLength());
+ methodParameters.add(new JavaMethodParameter(paramName, paramTypeName, paramAnnotations, sourceRange));
}
// TODO : add support for thrown exceptions
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtils.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtils.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -195,6 +195,28 @@
}
return element;
}
+
+ /**
+ * Returns the closest Java Element of the expected type that surrounds the given location in the
+ * given compilationUnit. This method can return SimpleAnnotation, which the
+ * default JDT ICompilationUnit implementation does not support.
+ *
+ * @param sourceRange
+ * @param location
+ * @param type
+ * @return
+ * @throws JavaModelException
+ */
+ public static IJavaElement getElementAt(ICompilationUnit compilationUnit, int location, int type) throws JavaModelException {
+ IJavaElement element = getElementAt(compilationUnit, location);
+ while (element != null && element.exists()) {
+ if (element.getElementType() == type) {
+ return element;
+ }
+ element = element.getParent();
+ }
+ return null;
+ }
/**
* Parse the DOM of the given member, and resolve bindings. If the given
@@ -592,4 +614,6 @@
}
+
+
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IJaxrsHttpMethod.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IJaxrsHttpMethod.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IJaxrsHttpMethod.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -11,7 +11,6 @@
package org.jboss.tools.ws.jaxrs.core.metamodel;
import org.eclipse.jdt.core.IType;
-import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
public interface IJaxrsHttpMethod extends IJaxrsElement, Comparable<IJaxrsHttpMethod> {
@@ -21,8 +20,6 @@
/** @return the name */
String getFullyQualifiedName();
- Annotation getHttpMethodAnnotation();
-
IType getJavaElement();
}
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IJaxrsMetamodel.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IJaxrsMetamodel.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IJaxrsMetamodel.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -17,7 +17,6 @@
public interface IJaxrsMetamodel {
- /** @return the JAX-RS Ednpoints */
public abstract List<IJaxrsEndpoint> getAllEndpoints();
public abstract <T> T getElement(IJavaElement invocationElement, Class<T> clazz);
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IMarkerResolutionDelegate.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IMarkerResolutionDelegate.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IMarkerResolutionDelegate.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.core.metamodel;
+
+import org.eclipse.core.runtime.CoreException;
+
+
+/**
+ * @author Xavier Coulon
+ *
+ */
+public interface IMarkerResolutionDelegate {
+
+ public static final String MARKER_RESOLUTION = "MARKER_RESOLUTION";
+
+ public abstract void applyQuickFix() throws CoreException;
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/IMarkerResolutionDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/quickfix/JaxrsValidationQuickFixes.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/quickfix/JaxrsValidationQuickFixes.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/quickfix/JaxrsValidationQuickFixes.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,10 @@
+package org.jboss.tools.ws.jaxrs.core.metamodel.quickfix;
+
+public class JaxrsValidationQuickFixes {
+
+ public static final int HTTP_METHOD_MISSING_RETENTION_ANNOTATION_ID = 1;
+ public static final int HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE_ID = 2;
+ public static final int HTTP_METHOD_MISSING_TARGET_ANNOTATION_ID = 3;
+ public static final int HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE_ID = 4;
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/quickfix/JaxrsValidationQuickFixes.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/JaxrsPreferenceInitializer.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/JaxrsPreferenceInitializer.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/JaxrsPreferenceInitializer.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.core.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.ws.jaxrs.core.JBossJaxrsCorePlugin;
+
+/**
+ * @author Alexey Kazakov
+ * @author Xavier Coulon
+ */
+public class JaxrsPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ @Override
+ public void initializeDefaultPreferences() {
+ IEclipsePreferences defaultPreferences = ((IScopeContext)DefaultScope.INSTANCE).getNode(JBossJaxrsCorePlugin.PLUGIN_ID);
+ defaultPreferences.putBoolean(SeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME, true);
+ defaultPreferences.put(SeverityPreferences.WRONG_BUILDER_ORDER_PREFERENCE_NAME, JaxrsPreferences.ERROR);
+ for (String name : JaxrsPreferences.SEVERITY_OPTION_NAMES) {
+ defaultPreferences.put(name, SeverityPreferences.ERROR);
+ }
+ defaultPreferences.put(JaxrsPreferences.APPLICATION_NO_OCCURRENCE_FOUND, JaxrsPreferences.WARNING);
+ defaultPreferences.put(JaxrsPreferences.APPLICATION_TOO_MANY_OCCURRENCES, JaxrsPreferences.WARNING);
+
+ defaultPreferences.put(JaxrsPreferences.HTTP_METHOD_MISSING_TARGET_ANNOTATION, JaxrsPreferences.ERROR);
+ defaultPreferences.put(JaxrsPreferences.HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE, JaxrsPreferences.ERROR);
+ defaultPreferences.put(JaxrsPreferences.HTTP_METHOD_MISSING_RETENTION_ANNOTATION, JaxrsPreferences.ERROR);
+ defaultPreferences.put(JaxrsPreferences.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE, JaxrsPreferences.ERROR);
+
+ defaultPreferences.put(JaxrsPreferences.RESOURCE_METHOD_ILLEGAL_CONTEXT_ANNOTATION, JaxrsPreferences.ERROR);
+ defaultPreferences.put(JaxrsPreferences.RESOURCE_METHOD_INVALID_PATHPARAM_ANNOTATION_VALUE, JaxrsPreferences.ERROR);
+ defaultPreferences.put(JaxrsPreferences.RESOURCE_METHOD_MORE_THAN_ONE_UNANNOTATED_PARAMETER, JaxrsPreferences.ERROR);
+ defaultPreferences.put(JaxrsPreferences.RESOURCE_METHOD_NO_PUBLIC_MODIFIER, JaxrsPreferences.WARNING);
+ defaultPreferences.put(JaxrsPreferences.RESOURCE_METHOD_UNBOUND_PATH_ANNOTATION_TEMPLATE_PARAMETER, JaxrsPreferences.ERROR);
+ defaultPreferences.put(JaxrsPreferences.RESOURCE_METHOD_UNBOUND_PATHPARAM_ANNOTATION_VALUE, JaxrsPreferences.ERROR);
+
+ defaultPreferences.putInt(SeverityPreferences.MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME, SeverityPreferences.DEFAULT_MAX_NUMBER_OF_MARKERS_PER_FILE);
+ }
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/JaxrsPreferenceInitializer.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/JaxrsPreferences.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/JaxrsPreferences.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/JaxrsPreferences.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.core.preferences;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.common.validation.ValidationSeverityPreferences;
+import org.jboss.tools.ws.jaxrs.core.JBossJaxrsCorePlugin;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class JaxrsPreferences extends ValidationSeverityPreferences {
+
+ public static final Set<String> SEVERITY_OPTION_NAMES = new HashSet<String>();
+
+ private static JaxrsPreferences INSTANCE = new JaxrsPreferences();
+
+ public static final String WARNING_GROUP_ID = "jaxrs";
+
+ // HTTP Method group
+ public static final String HTTP_METHOD_MISSING_RETENTION_ANNOTATION = INSTANCE
+ .createSeverityOption("httpMethodMissingRetentionAnnotation"); //$NON-NLS-1$
+
+ public static final String HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE = INSTANCE
+ .createSeverityOption("httpMethodInvalidRetentionAnnotationValue"); //$NON-NLS-1$
+
+ public static final String HTTP_METHOD_MISSING_TARGET_ANNOTATION = INSTANCE
+ .createSeverityOption("httpMethodMissingTargetAnnotation"); //$NON-NLS-1$
+
+ public static final String HTTP_METHOD_INVALID_TARGET_ANNOTATION_VALUE = INSTANCE
+ .createSeverityOption("httpMethodInvalidTargetAnnotationValue"); //$NON-NLS-1$
+
+ // Resource Method group
+ public static final String RESOURCE_METHOD_ILLEGAL_CONTEXT_ANNOTATION = INSTANCE
+ .createSeverityOption("resourceMethodIllegalContextAnnotation"); //$NON-NLS-1$
+
+ public static final String RESOURCE_METHOD_UNBOUND_PATHPARAM_ANNOTATION_VALUE = INSTANCE
+ .createSeverityOption("resourceMethodUnboundPathParameterAnnotationValue"); //$NON-NLS-1$
+
+ public static final String RESOURCE_METHOD_UNBOUND_PATH_ANNOTATION_TEMPLATE_PARAMETER = INSTANCE
+ .createSeverityOption("resourceMethodUnboundPathAnnotationTemplateParameter"); //$NON-NLS-1$
+
+ public static final String RESOURCE_METHOD_MORE_THAN_ONE_UNANNOTATED_PARAMETER = INSTANCE
+ .createSeverityOption("resourceMethodMoreThanOneUnannotatedParameter"); //$NON-NLS-1$
+
+ public static final String RESOURCE_METHOD_INVALID_PATHPARAM_ANNOTATION_VALUE = INSTANCE
+ .createSeverityOption("resourceMethodInvalidPathParamAnnotationValue"); //$NON-NLS-1$
+
+ public static final String RESOURCE_METHOD_NO_PUBLIC_MODIFIER = INSTANCE
+ .createSeverityOption("resourceMethodNoPublicModifier"); //$NON-NLS-1$
+
+ public static final String APPLICATION_NO_OCCURRENCE_FOUND = INSTANCE
+ .createSeverityOption("applicationNoOccurrenceFound"); //$NON-NLS-1$
+
+ public static final String APPLICATION_TOO_MANY_OCCURRENCES = INSTANCE
+ .createSeverityOption("applicationTooManyOccurrencesFound"); //$NON-NLS-1$
+ /**
+ * @return the only instance of {@link JaxrsPreferences}
+ */
+ public static JaxrsPreferences getInstance() {
+ return INSTANCE;
+ }
+
+ private JaxrsPreferences() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.validation.ValidationSeverityPreferences#getWarningGroupID()
+ */
+ @Override
+ public String getWarningGroupID() {
+ return WARNING_GROUP_ID;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.preferences.SeverityPreferences#createSeverityOption(java.lang.String)
+ */
+ @Override
+ protected String createSeverityOption(String shortName) {
+ String name = getPluginId() + ".validator.problem." + shortName; //$NON-NLS-1$
+ SEVERITY_OPTION_NAMES.add(name);
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.preferences.SeverityPreferences#getPluginId()
+ */
+ @Override
+ protected String getPluginId() {
+ return JBossJaxrsCorePlugin.PLUGIN_ID;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.preferences.SeverityPreferences#getSeverityOptionNames()
+ */
+ @Override
+ protected Set<String> getSeverityOptionNames() {
+ return SEVERITY_OPTION_NAMES;
+ }
+
+ public static boolean shouldValidateCore(IProject project) {
+ return true;
+ }
+
+ public static boolean isValidationEnabled(IProject project) {
+ return INSTANCE.isEnabled(project);
+ }
+
+ public static int getMaxNumberOfProblemMarkersPerFile(IProject project) {
+ return INSTANCE.getMaxNumberOfProblemMarkersPerResource(project);
+ }
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/JaxrsPreferences.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/package-info.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/package-info.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/package-info.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * 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
+ ******************************************************************************/
+/**
+ * @author Xavier Coulon
+ *
+ */
+package org.jboss.tools.ws.jaxrs.core.preferences;
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/preferences/package-info.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF 2012-08-24 16:20:04 UTC (rev 43224)
@@ -36,7 +36,10 @@
org.eclipse.wst.validation;bundle-version="1.2.300",
org.eclipse.wst.server.core;bundle-version="1.1.303",
org.eclipse.debug.core;bundle-version="3.7.0",
- org.eclipse.debug.ui;bundle-version="3.7.101"
+ org.eclipse.debug.ui;bundle-version="3.7.101",
+ org.jboss.tools.common;bundle-version="3.4.0",
+ org.jboss.tools.common.ui;bundle-version="3.4.0",
+ org.jboss.tools.common.validation;bundle-version="3.4.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.properties 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.properties 2012-08-24 16:20:04 UTC (rev 43224)
@@ -1,3 +1,9 @@
PLUGIN_NAME=JBoss JAX-RS Tooling (UI)
PLUGIN_PROVIDER=JBoss by Red Hat
navigatorContentName=JAX-RS REST Web Services
+
+
+PreferencePage_JaxrsSettings=JAX-RS Validator
+PreferencePage_Validator=JAX-RS Validator
+PreferencePage=JAX-RS
+
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml 2012-08-24 16:20:04 UTC (rev 43224)
@@ -354,4 +354,51 @@
</adapter>
</factory>
</extension>
+ <extension point="org.eclipse.ui.ide.markerResolution">
+ <markerResolutionGenerator
+ markerType="org.jboss.tools.ws.jaxrs.metamodelMarker"
+ class="org.jboss.tools.ws.jaxrs.ui.quickfix.JaxrsMarkerResolutionGenerator"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.propertyPages">
+ <page
+ name="%PreferencePage_JaxrsSettings"
+ class="org.jboss.tools.ws.jaxrs.ui.preferences.JaxrsSettingsPreferencePage"
+ id="org.jboss.tools.ws.jaxrs.ui.propertyPages.JaxrsSettingsPreferencePage">
+ <enabledWhen>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.jdt.core.javanature"/>
+ </adapt>
+ </enabledWhen>
+ </page>
+ <page
+ name="%PreferencePage_Validator"
+ class="org.jboss.tools.ws.jaxrs.ui.preferences.JaxrsValidatorPreferencePage"
+ id="org.jboss.tools.ws.jaxrs.ui.propertyPages.JaxrsValidatorPreferencePage"
+ category="org.jboss.tools.ws.jaxrs.ui.propertyPages.JaxrsSettingsPreferencePage">
+ <enabledWhen>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test property="org.eclipse.core.resources.projectNature" value="org.jboss.tools.ws.jaxrs.nature"/>
+ </adapt>
+ </enabledWhen>
+ </page>
+ </extension>
+
+ <extension point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.jboss.tools.ws.jaxrs.ui"
+ class="org.jboss.tools.ws.jaxrs.ui.preferences.JaxrsValidatorPreferencePage"
+ id="org.jboss.tools.ws.jaxrs.ui.JAXRSValidatorPreferencePage"
+ name="%PreferencePage_Validator">
+ </page>
+ <page
+ category="org.jboss.tools.common.model.ui.MainPreferencePage"
+ class="org.jboss.tools.ws.jaxrs.ui.preferences.JaxrsPreferencePage"
+ id="org.jboss.tools.ws.jaxrs.ui"
+ name="%PreferencePage">
+ </page>
+ </extension>
+
+
</plugin>
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateElementAdapterFactory.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateElementAdapterFactory.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateElementAdapterFactory.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -6,6 +6,7 @@
public class UriPathTemplateElementAdapterFactory implements IAdapterFactory {
@Override
+ @SuppressWarnings("rawtypes")
public Object getAdapter(Object adaptableObject, Class adapterType) {
if( adapterType.equals(ILaunchable.class)) {
if( adaptableObject instanceof UriPathTemplateElement ) {
@@ -15,6 +16,7 @@
return null;
}
+ @SuppressWarnings("rawtypes")
@Override
public Class[] getAdapterList() {
return new Class[]{ILaunchable.class};
Deleted: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/JaxrsMarkerResolutionGenerator.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/JaxrsMarkerResolutionGenerator.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/JaxrsMarkerResolutionGenerator.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -1,21 +0,0 @@
-package org.jboss.tools.ws.jaxrs.ui.contentassist;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.ui.IMarkerResolution;
-import org.eclipse.ui.IMarkerResolutionGenerator2;
-
-public class JaxrsMarkerResolutionGenerator implements IMarkerResolutionGenerator2 {
-
- @Override
- public IMarkerResolution[] getResolutions(IMarker marker) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean hasResolutions(IMarker marker) {
-
- return false;
- }
-
-}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/facet/JaxrsFacetedProjectListener.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/facet/JaxrsFacetedProjectListener.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/facet/JaxrsFacetedProjectListener.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -57,6 +57,8 @@
ProjectNatureUtils.uninstallProjectNature(project, ProjectNatureUtils.JAXRS_NATURE_ID);
}
break;
+ default:
+ break;
}
} catch (CoreException ex) {
Logger.error("Failed to add or remove JAX-RS 1.1 support Nature", ex);
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/IConfigurationBlockDescriptionProvider.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/IConfigurationBlockDescriptionProvider.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/IConfigurationBlockDescriptionProvider.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.ui.preferences;
+
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public interface IConfigurationBlockDescriptionProvider {
+ public SectionDescription[] getSections();
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/IConfigurationBlockDescriptionProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencePage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencePage.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencePage.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.ui.preferences;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * @author Xavier Coulon
+ */
+public class JaxrsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ /**
+ * @see plugin.xml descriptor for ID
+ */
+ public static final String ID = "org.jboss.tools.ws.jaxrs.ui";
+
+ @Override
+ protected Control createContents(Composite parent) {
+ Composite root = new Composite(parent, SWT.NONE);
+ GridLayout gl = new GridLayout(1, false);
+ root.setLayout(gl);
+
+ return root;
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencesMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencesMessages.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencesMessages.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.ui.preferences;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Alexey Kazakov
+ * @author Xavier Coulon
+ */
+public class JaxrsPreferencesMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.ws.jaxrs.ui.preferences.JaxrsPreferencesMessages"; //$NON-NLS-1$
+
+ public static String JAXRS_SETTINGS_PREFERENCE_PAGE_JAXRS_SUPPORT;
+
+ // Validator Preference page
+ public static String JaxrsValidatorConfigurationBlock_common_description;
+
+ public static String JaxrsValidatorConfigurationBlock_needsbuild_title;
+ public static String JaxrsValidatorConfigurationBlock_needsfullbuild_message;
+ public static String JaxrsValidatorConfigurationBlock_needsprojectbuild_message;
+
+ // Section Application/Activators
+ public static String JaxrsValidatorConfigurationBlock_section_applications ;
+ public static String JaxrsValidatorConfigurationBlock_pb_applicationNoOccurrenceFound_label;
+ public static String JaxrsValidatorConfigurationBlock_pb_applicationTooManyOccurrencesFound_label;
+
+ // Section HTTP Method
+ public static String JaxrsValidatorConfigurationBlock_section_httpMethods;
+ public static String JaxrsValidatorConfigurationBlock_pb_httpMethodMissingRetentionAnnotation_label;
+ public static String JaxrsValidatorConfigurationBlock_pb_httpMethodInvalidRetentionAnnotationValue_label;
+ public static String JaxrsValidatorConfigurationBlock_pb_httpMethodMissingTargetAnnotation_label;
+ public static String JaxrsValidatorConfigurationBlock_pb_httpMethodInvalidTargetAnnotationValue_label;
+
+ // Section Resource
+
+ // Section Resource Methods
+ public static String JaxrsValidatorConfigurationBlock_section_resourceMethods;
+ public static String JaxrsValidatorConfigurationBlock_pb_resourceMethodIllegalContextAnnotation_label;
+ public static String JaxrsValidatorConfigurationBlock_pb_resourceMethodUnboundPathParameterAnnotationValue_label;
+ public static String JaxrsValidatorConfigurationBlock_pb_resourceMethodUnboundPathAnnotationTemplateParameter_label;
+ public static String JaxrsValidatorConfigurationBlock_pb_resourceMethodMoreThanOneUnannotatedParameter_label;
+ public static String JaxrsValidatorConfigurationBlock_pb_resourceMethodInvalidPathParamAnnotationValue_label;
+ public static String JaxrsValidatorConfigurationBlock_pb_resourceMethodNoPublicModifier_label;
+
+ // Section Resource Fields
+
+ public static String JAXRS_VALIDATOR_PREFERENCE_PAGE_JAXRS_VALIDATOR;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, JaxrsPreferencesMessages.class);
+ }
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencesMessages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencesMessages.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencesMessages.properties (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencesMessages.properties 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,43 @@
+##################################################################################
+### 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
+##################################################################################
+
+JAXRS_SETTINGS_PREFERENCE_PAGE_JAXRS_SUPPORT=JAX-RS support\:
+
+JaxrsValidatorConfigurationBlock_common_description=Select the severity level for the following optional JAX-RS Validator problems:
+
+JaxrsValidatorConfigurationBlock_needsbuild_title=JAX-RS Validator Settings Changed
+JaxrsValidatorConfigurationBlock_needsfullbuild_message=The JAX-RS Validator settings have changed. A full rebuild is required for changes to take effect. Do the full build now?
+JaxrsValidatorConfigurationBlock_needsprojectbuild_message=The JAX-RS Validator settings have changed. A rebuild of the project is required for changes to take effect. Build the project now?
+
+#Section Applications/JAX-RS Activators
+JaxrsValidatorConfigurationBlock_section_applications=JAX-RS Activators
+JaxrsValidatorConfigurationBlock_pb_applicationNoOccurrenceFound_label=No JAX-RS Activator configured
+JaxrsValidatorConfigurationBlock_pb_applicationTooManyOccurrencesFound_label=Multiple JAX-RS Activators configured
+
+#Section HTTP Methods
+JaxrsValidatorConfigurationBlock_section_httpMethods=User-defined HTTP Methods
+JaxrsValidatorConfigurationBlock_pb_httpMethodMissingRetentionAnnotation_label=Missing @Retention annotation:
+JaxrsValidatorConfigurationBlock_pb_httpMethodInvalidRetentionAnnotationValue_label=Invalid @Retention annotation value:
+JaxrsValidatorConfigurationBlock_pb_httpMethodMissingTargetAnnotation_label=Missing @Target annotation:
+JaxrsValidatorConfigurationBlock_pb_httpMethodInvalidTargetAnnotationValue_label=Invalid @Target annotation:
+
+#Section Resource Methods
+JaxrsValidatorConfigurationBlock_section_resourceMethods=JAX-RS Resource Methods
+JaxrsValidatorConfigurationBlock_pb_resourceMethodIllegalContextAnnotation_label=Illegal @Context annotation
+JaxrsValidatorConfigurationBlock_pb_resourceMethodUnboundPathParameterAnnotationValue_label=Unbound @PathParam annotation value
+JaxrsValidatorConfigurationBlock_pb_resourceMethodUnboundPathAnnotationTemplateParameter_label=Unbound @Path template parameter
+JaxrsValidatorConfigurationBlock_pb_resourceMethodMoreThanOneUnannotatedParameter_label=Too many entity parameters
+JaxrsValidatorConfigurationBlock_pb_resourceMethodInvalidPathParamAnnotationValue_label=Invalid @PathParam annotation value
+JaxrsValidatorConfigurationBlock_pb_resourceMethodNoPublicModifier_label=Missing 'public' method modifier
+
+
+
+JAXRS_VALIDATOR_PREFERENCE_PAGE_JAXRS_VALIDATOR=JAX-RS Validator
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsPreferencesMessages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsSettingsPreferencePage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsSettingsPreferencePage.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsSettingsPreferencePage.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.ui.preferences;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.jboss.tools.common.ui.preferences.SettingsPage;
+import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
+import org.jboss.tools.common.ui.widget.editor.IFieldEditorFactory;
+import org.jboss.tools.ws.jaxrs.core.configuration.ProjectNatureUtils;
+import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class JaxrsSettingsPreferencePage extends SettingsPage {
+
+ public static final String ID = "org.jboss.tools.ws.jaxrs.ui.propertyPages.JaxrsSettingsPreferencePage";
+
+ private IProject project;
+ private boolean jaxrsEnabled;
+ private boolean initialState;
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.PropertyPage#setElement(org.eclipse.core.runtime.IAdaptable)
+ */
+ @Override
+ public void setElement(IAdaptable element) {
+ super.setElement(element);
+ project = (IProject) getElement().getAdapter(IProject.class);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createContents(Composite parent) {
+ Composite root = new Composite(parent, SWT.NONE);
+ try {
+
+ GridData gd = new GridData();
+
+ gd.horizontalSpan = 1;
+ gd.horizontalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = false;
+
+ GridLayout gridLayout = new GridLayout(1, false);
+ root.setLayout(gridLayout);
+
+ Composite generalGroup = new Composite(root, SWT.NONE);
+ generalGroup.setLayoutData(gd);
+ gridLayout = new GridLayout(4, false);
+
+ generalGroup.setLayout(gridLayout);
+
+ initialState = isJaxrsEnabled(project);
+ IFieldEditor jaxrsSupportCheckBox = IFieldEditorFactory.INSTANCE.createCheckboxEditor(
+ JaxrsPreferencesMessages.JAXRS_SETTINGS_PREFERENCE_PAGE_JAXRS_SUPPORT,
+ JaxrsPreferencesMessages.JAXRS_SETTINGS_PREFERENCE_PAGE_JAXRS_SUPPORT, initialState);
+ jaxrsSupportCheckBox.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ Object value = evt.getNewValue();
+ if (value instanceof Boolean) {
+ boolean v = ((Boolean) value).booleanValue();
+ setEnabledJaxrsSuport(v);
+ }
+ }
+ });
+ jaxrsEnabled = isJaxrsEnabled(project);
+ registerEditor(jaxrsSupportCheckBox, generalGroup);
+
+ validate();
+
+ } catch (CoreException e) {
+ Logger.error("Failed to display JAX-RS settings page", e);
+ }
+ return root;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+ */
+ @Override
+ protected void performDefaults() {
+ try {
+ getEditor(JaxrsPreferencesMessages.JAXRS_SETTINGS_PREFERENCE_PAGE_JAXRS_SUPPORT).setValue(
+ isJaxrsEnabled(project));
+ validate();
+ } catch (CoreException e) {
+ Logger.error("Failed to restore defaults on JAX-RS settings page", e);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performOk()
+ */
+ @Override
+ public boolean performOk() {
+ try {
+ if (isJaxrsEnabled() != initialState) {
+ if (isJaxrsEnabled()) {
+ addJaxrsSupport(project);
+ } else {
+ removeJaxrsSupport(project);
+ }
+ }
+ } catch (CoreException e) {
+ Logger.error("Failed to apply changes on JAX-RS settings page", e);
+ }
+ return true;
+ }
+
+ private void addJaxrsSupport(IProject project) throws CoreException {
+ if (project == null) {
+ return;
+ }
+ ProjectNatureUtils.installProjectNature(project, ProjectNatureUtils.JAXRS_NATURE_ID);
+ }
+
+ private void removeJaxrsSupport(IProject project) throws CoreException {
+ ProjectNatureUtils.uninstallProjectNature(project, ProjectNatureUtils.JAXRS_NATURE_ID);
+ }
+
+ private boolean isJaxrsEnabled(IProject project) throws CoreException {
+ return ProjectNatureUtils.isProjectNatureInstalled(project, ProjectNatureUtils.JAXRS_NATURE_ID);
+ }
+
+ private boolean isJaxrsEnabled() {
+ return jaxrsEnabled;
+ }
+
+ public void setEnabledJaxrsSuport(boolean enabled) {
+ jaxrsEnabled = enabled;
+ editorRegistry.get(JaxrsPreferencesMessages.JAXRS_SETTINGS_PREFERENCE_PAGE_JAXRS_SUPPORT).setValue(enabled);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.ui.preferences.SettingsPage#validate()
+ */
+ @Override
+ protected void validate() {
+ }
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsSettingsPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorConfigurationBlock.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorConfigurationBlock.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorConfigurationBlock.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.ui.preferences;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock;
+import org.jboss.tools.ws.jaxrs.core.JBossJaxrsCorePlugin;
+
+/**
+ * @author Alexey Kazakov
+ * @author Xavier Coulon
+ */
+@SuppressWarnings("restriction")
+public class JaxrsValidatorConfigurationBlock extends SeverityConfigurationBlock {
+
+ private static final String SETTINGS_SECTION_NAME = "JaxrsValidatorConfigurationBlock";
+
+ private static Key[] getKeys() {
+ ArrayList<Key> keys = new ArrayList<Key>();
+ for (SectionDescription s: JaxrsValidatorConfigurationBlockDescriptionProvider.getInstance().getSections()) {
+ s.collectKeys(keys);
+ }
+ keys.add(MAX_NUMBER_OF_PROBLEMS_KEY);
+ keys.add(WRONG_BUILDER_ORDER_KEY);
+ return keys.toArray(new Key[0]);
+ }
+
+ private static final Key MAX_NUMBER_OF_PROBLEMS_KEY = getKey(JBossJaxrsCorePlugin.PLUGIN_ID, SeverityPreferences.MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME);
+
+ @Override
+ protected Key getMaxNumberOfProblemsKey() {
+ return MAX_NUMBER_OF_PROBLEMS_KEY;
+ }
+
+ private static final Key WRONG_BUILDER_ORDER_KEY = getKey(JBossJaxrsCorePlugin.PLUGIN_ID, SeverityPreferences.WRONG_BUILDER_ORDER_PREFERENCE_NAME);
+
+ protected Key getWrongBuilderOrderKey() {
+ return WRONG_BUILDER_ORDER_KEY;
+ }
+
+ @SuppressWarnings("restriction")
+ public JaxrsValidatorConfigurationBlock(IStatusChangeListener context,
+ IProject project, IWorkbenchPreferenceContainer container) {
+ super(context, project, getKeys(), container);
+ }
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return JaxrsValidatorConfigurationBlockDescriptionProvider.getInstance().getSections();
+ }
+
+ @Override
+ protected String getCommonDescription() {
+ return JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_common_description;
+ }
+
+ @Override
+ protected IDialogSettings getDialogSettings() {
+ return JBossJaxrsCorePlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
+ }
+
+ @Override
+ protected String getQualifier() {
+ return JBossJaxrsCorePlugin.PLUGIN_ID;
+ }
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorConfigurationBlock.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorConfigurationBlockDescriptionProvider.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorConfigurationBlockDescriptionProvider.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorConfigurationBlockDescriptionProvider.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.ui.preferences;
+
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
+import org.jboss.tools.ws.jaxrs.core.JBossJaxrsCorePlugin;
+import org.jboss.tools.ws.jaxrs.core.preferences.JaxrsPreferences;
+
+/**
+ *
+ * @author Alexey Kazakov & Viacheslav Kabanovich
+ *
+ */
+public class JaxrsValidatorConfigurationBlockDescriptionProvider {
+
+ private static JaxrsValidatorConfigurationBlockDescriptionProvider INSTANCE = null;
+
+ private JaxrsValidatorConfigurationBlockDescriptionProvider() {
+ }
+
+ public static JaxrsValidatorConfigurationBlockDescriptionProvider getInstance() {
+ if(INSTANCE == null) {
+ JaxrsValidatorConfigurationBlockDescriptionProvider q = new JaxrsValidatorConfigurationBlockDescriptionProvider();
+ INSTANCE = q;
+ }
+ return INSTANCE;
+ }
+
+ private SectionDescription SECTION_ACTIVATORS = new SectionDescription(
+ JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_section_httpMethods,
+ new String[][]{
+ {JaxrsPreferences.APPLICATION_NO_OCCURRENCE_FOUND, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_applicationNoOccurrenceFound_label},
+ {JaxrsPreferences.APPLICATION_TOO_MANY_OCCURRENCES, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_applicationTooManyOccurrencesFound_label}
+ },
+ JBossJaxrsCorePlugin.PLUGIN_ID
+ );
+ private SectionDescription SECTION_HTTP_METHODS = new SectionDescription(
+ JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_section_httpMethods,
+ new String[][]{
+ {JaxrsPreferences.HTTP_METHOD_MISSING_RETENTION_ANNOTATION, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_httpMethodMissingRetentionAnnotation_label},
+ {JaxrsPreferences.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_httpMethodInvalidRetentionAnnotationValue_label},
+ {JaxrsPreferences.HTTP_METHOD_MISSING_RETENTION_ANNOTATION, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_httpMethodMissingTargetAnnotation_label},
+ {JaxrsPreferences.HTTP_METHOD_INVALID_RETENTION_ANNOTATION_VALUE, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_httpMethodInvalidTargetAnnotationValue_label},
+ },
+ JBossJaxrsCorePlugin.PLUGIN_ID
+ );
+ private SectionDescription SECTION_RESOURCE_METHODS = new SectionDescription(
+ JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_section_resourceMethods,
+ new String[][]{
+ {JaxrsPreferences.RESOURCE_METHOD_NO_PUBLIC_MODIFIER, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_resourceMethodNoPublicModifier_label},
+ {JaxrsPreferences.RESOURCE_METHOD_UNBOUND_PATH_ANNOTATION_TEMPLATE_PARAMETER, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_resourceMethodUnboundPathAnnotationTemplateParameter_label},
+ {JaxrsPreferences.RESOURCE_METHOD_UNBOUND_PATHPARAM_ANNOTATION_VALUE, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_resourceMethodUnboundPathParameterAnnotationValue_label},
+ {JaxrsPreferences.RESOURCE_METHOD_INVALID_PATHPARAM_ANNOTATION_VALUE, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_resourceMethodInvalidPathParamAnnotationValue_label},
+ {JaxrsPreferences.RESOURCE_METHOD_MORE_THAN_ONE_UNANNOTATED_PARAMETER, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_resourceMethodMoreThanOneUnannotatedParameter_label},
+ {JaxrsPreferences.RESOURCE_METHOD_ILLEGAL_CONTEXT_ANNOTATION, JaxrsPreferencesMessages.JaxrsValidatorConfigurationBlock_pb_resourceMethodIllegalContextAnnotation_label}
+ },
+ JBossJaxrsCorePlugin.PLUGIN_ID
+ );
+
+ private SectionDescription[] ALL_SECTIONS = new SectionDescription[]{
+ SECTION_ACTIVATORS,
+ SECTION_HTTP_METHODS,
+ SECTION_RESOURCE_METHODS
+ };
+
+ public SectionDescription[] getSections() {
+ return ALL_SECTIONS;
+ }
+
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorConfigurationBlockDescriptionProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorPreferencePage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorPreferencePage.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorPreferencePage.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.ui.preferences;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.jboss.tools.common.ui.preferences.SeverityConfigurationBlock.SectionDescription;
+import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
+import org.jboss.tools.ws.jaxrs.core.JBossJaxrsCorePlugin;
+
+/**
+ * @author Xavier Coulon
+ */
+public class JaxrsValidatorPreferencePage extends SeverityPreferencePage {
+
+ /** The JAX-RS Validation preference page ID (at the workspace level). */
+ public static final String PREF_ID = "org.jboss.tools.ws.jaxrs.ui.JAXRSValidatorPreferencePage"; //$NON-NLS-1$
+ /** The JAX-RS Validation property page ID (at the project level). */
+ public static final String PROP_ID = "org.jboss.tools.ws.jaxrs.ui.propertyPages.JaxrsValidatorPreferencePage"; //$NON-NLS-1$
+
+ public JaxrsValidatorPreferencePage() {
+ setPreferenceStore(JBossJaxrsCorePlugin.getDefault().getPreferenceStore());
+ setTitle(JaxrsPreferencesMessages.JAXRS_VALIDATOR_PREFERENCE_PAGE_JAXRS_VALIDATOR);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPreferencePageID()
+ */
+ @Override
+ protected String getPreferencePageID() {
+ return PREF_ID;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPropertyPageID()
+ */
+ @Override
+ protected String getPropertyPageID() {
+ return PROP_ID;
+ }
+
+ @SuppressWarnings("restriction")
+ @Override
+ public void createControl(Composite parent) {
+ IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer) getContainer();
+ fConfigurationBlock = new JaxrsValidatorConfigurationBlock(getNewStatusChangedListener(), getProject(), container);
+
+ super.createControl(parent);
+ }
+
+ @Override
+ protected SectionDescription[] getAllSections() {
+ return JaxrsValidatorConfigurationBlockDescriptionProvider.getInstance().getSections();
+ }
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/JaxrsValidatorPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/package-info.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/package-info.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/package-info.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * 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
+ ******************************************************************************/
+/**
+ * @author Xavier Coulon
+ *
+ */
+package org.jboss.tools.ws.jaxrs.ui.preferences;
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/preferences/package-info.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/AddTargetAnnotationMarkerResolution.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/AddTargetAnnotationMarkerResolution.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/AddTargetAnnotationMarkerResolution.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.ui.quickfix;
+
+
+import java.lang.annotation.ElementType;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.refactoring.CompilationUnitChange;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.jboss.tools.common.refactoring.BaseMarkerResolution;
+import org.jboss.tools.common.refactoring.MarkerResolutionUtils;
+import org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname;
+import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
+
+/**
+ * @author Xavier Coulon
+ *
+ */
+public class AddTargetAnnotationMarkerResolution extends BaseMarkerResolution {
+
+ private final IType type;
+
+ public AddTargetAnnotationMarkerResolution(IType type){
+ super(type.getCompilationUnit());
+ this.type = type;
+ label = NLS.bind(JaxrsQuickFixMessages.ADD_TARGET_ANNOTATION_MARKER_RESOLUTION_TITLE, type.getElementName());
+ init();
+ }
+
+ @Override
+ protected CompilationUnitChange getChange(ICompilationUnit compilationUnit){
+ CompilationUnitChange change = new CompilationUnitChange("", compilationUnit);
+ MultiTextEdit edit = new MultiTextEdit();
+ change.setEdit(edit);
+ try{
+ MarkerResolutionUtils.addImport(EnumJaxrsClassname.TARGET.qualifiedName, compilationUnit, edit);
+ MarkerResolutionUtils.addImport(ElementType.class.getName(), compilationUnit, edit);
+ MarkerResolutionUtils.addAnnotation(EnumJaxrsClassname.TARGET.annotationName, compilationUnit, type, "(ElementType.METHOD)", edit);
+ } catch (JavaModelException e) {
+ Logger.error("Failed to add @Target annotation on type " + type.getFullyQualifiedName(), e);
+ }
+ return change;
+ }
+
+ @Override
+ public Image getImage() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/AddTargetAnnotationMarkerResolution.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsMarkerResolutionGenerator.java (from rev 42677, trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/JaxrsMarkerResolutionGenerator.java)
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsMarkerResolutionGenerator.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsMarkerResolutionGenerator.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,63 @@
+package org.jboss.tools.ws.jaxrs.ui.quickfix;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolutionGenerator2;
+import org.jboss.tools.common.validation.ValidationErrorManager;
+import org.jboss.tools.ws.jaxrs.core.jdt.JdtUtils;
+import org.jboss.tools.ws.jaxrs.core.metamodel.quickfix.JaxrsValidationQuickFixes;
+import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
+
+public class JaxrsMarkerResolutionGenerator implements IMarkerResolutionGenerator2 {
+
+ @Override
+ public IMarkerResolution[] getResolutions(IMarker marker) {
+ return getMarkerResolutions(marker);
+ }
+
+ @Override
+ public boolean hasResolutions(IMarker marker) {
+ return getMarkerResolutions(marker).length > 0;
+ }
+
+ /**
+ * Null-safe extraction of the potential marker resolutions bound to this marker.
+ *
+ * @param marker
+ * the marker
+ * @return a array of marker resolutions. If no resolution is bound to the marker, the returned array is empty (not
+ * null).
+ */
+ private IMarkerResolution[] getMarkerResolutions(final IMarker marker) {
+ try {
+ final int quickfixId = getQuickFixID(marker);
+ switch (quickfixId) {
+ case JaxrsValidationQuickFixes.HTTP_METHOD_MISSING_TARGET_ANNOTATION_ID:
+ final ICompilationUnit compilationUnit = JdtUtils.getCompilationUnit(marker.getResource());
+ final IType type = (IType) JdtUtils.getElementAt(compilationUnit,
+ marker.getAttribute(IMarker.CHAR_START, 0), IJavaElement.TYPE);
+ if (type != null) {
+ return new IMarkerResolution[] { new AddTargetAnnotationMarkerResolution(type) };
+ }
+ }
+ } catch (CoreException e) {
+ Logger.error("Failed to retrieve marker resolution", e);
+ }
+ return new IMarkerResolution[0];
+ }
+
+ /**
+ * return message id or -1 if impossible to find
+ *
+ * @param marker
+ * @return
+ */
+ private int getQuickFixID(IMarker marker) throws CoreException {
+ return ((Integer) marker.getAttribute(ValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME, -1));
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsMarkerResolutionGenerator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsQuickFixMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsQuickFixMessages.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsQuickFixMessages.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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.ws.jaxrs.ui.quickfix;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Alexey Kazakov
+ * @author Xavier Coulon
+ */
+public class JaxrsQuickFixMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.ws.jaxrs.ui.quickfix.JaxrsQuickFixMessages"; //$NON-NLS-1$
+
+ public static String ADD_TARGET_ANNOTATION_MARKER_RESOLUTION_TITLE;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, JaxrsQuickFixMessages.class);
+ }
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsQuickFixMessages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsQuickFixMessages.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsQuickFixMessages.properties (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsQuickFixMessages.properties 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,12 @@
+##################################################################################
+### 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
+##################################################################################
+
+ADD_TARGET_ANNOTATION_MARKER_RESOLUTION_TITLE=Add @Target annotation on type {0}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/JaxrsQuickFixMessages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/package-info.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/package-info.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/package-info.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * 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
+ ******************************************************************************/
+/**
+ * @author Xavier Coulon
+ *
+ */
+package org.jboss.tools.ws.jaxrs.ui.quickfix;
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/quickfix/package-info.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF 2012-08-24 16:20:04 UTC (rev 43224)
@@ -30,7 +30,8 @@
org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
org.eclipse.wst.validation;bundle-version="1.2.300",
- org.apache.commons.io;bundle-version="2.0.1"
+ org.apache.commons.io;bundle-version="2.0.1",
+ org.jboss.tools.common.validation;bundle-version="3.4.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: org.apache.log4j
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/plugin.properties
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/plugin.properties 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/plugin.properties 2012-08-24 16:20:04 UTC (rev 43224)
@@ -1,2 +1,3 @@
PLUGIN_NAME=JBoss JAX-RS Tooling (Core Tests)
PLUGIN_PROVIDER=JBoss by Red Hat
+
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/BarResource.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/BarResource.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/BarResource.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -1,27 +1,65 @@
package org.jboss.tools.ws.jaxrs.sample.services;
import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
+/**
+ * Resource with a template parameter on the @Path annotation at the type level.
+ * @author Xavier Coulon
+ *
+ */
@Path("/foo/bar/{param1}")
public class BarResource {
+ // missing @PathParam("param2") annotation
+ @GET
+ @Path("/{param2}")
+ public Response getContent1(@PathParam("param1") int id) {
+ return null;
+ }
+
+ // missing @PathParam("param1") annotation
+ // missing @PathParam("id") annotation
+ // unbound @PathParam("i") annotation
+ @GET
+ @Path("/user/{id}/{format:(/format/[^/]+?)?}/{encoding:(/encoding/[^/]+?)?}")
+ public Response getContent2(@PathParam("i") int id,
+ @PathParam("format") String format,
+ @PathParam("encoding") String encoding,
+ @QueryParam("start") int start) {
+ return null;
+ }
+
+ // invalid "{param2}" value (because of "{" and "}" chars)
+ // unbound path template parameter "param2"
@PUT
@Path("{param2}")
public Response update1(@Context HttpServletRequest requestContext,
- String bar, @PathParam("{param1}") String param1, @PathParam("{param2}") String param2) throws Exception {
+ String bar, @PathParam("param1") String param1, @PathParam("{param2}") String param2) throws Exception {
return null;
}
+ // missing @PathParam("param1") annotation
@PUT
@Path("{param2}")
public Response update2(@Context HttpServletRequest requestContext,
- String bar, @PathParam("{param2}") String param2) throws Exception {
+ String bar, @PathParam("param2") String param2) throws Exception {
return null;
}
+
+ // more than 1 parameter without annotation
+ @PUT
+ @Path("{param2}")
+ public Response update3(@Context HttpServletRequest requestContext,
+ @PathParam("param1") String param2,
+ @PathParam("param2") String param2,
+ String bar, String foo) throws Exception {
+ return null;
+ }
}
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/BazResource.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/BazResource.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/BazResource.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -7,31 +7,54 @@
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
+/**
+ * Resource without any template parameter on the @Path annotation at the type level.
+ *
+ * @author Xavier Coulon
+ *
+ */
@Path("/foo/baz")
public class BazResource {
+ // missing @PathParam("param2") annotation
@GET
- @Path("/{id}")
- public Response getContent(@PathParam("id") int id) {
+ @Path("/{param2}")
+ public Response getContent1() {
return null;
}
-
+
+ // missing @PathParam("id") annotation
+ // unbound @PathParam("i") annotation
@GET
@Path("/user/{id}/{format:(/format/[^/]+?)?}/{encoding:(/encoding/[^/]+?)?}")
- public Response getContent(@PathParam("id") int id,
- @PathParam("format") String format,
- @PathParam("encoding") String encoding,
- @QueryParam("start") int start) {
+ public Response getContent2(@PathParam("i") int id, @PathParam("format") String format,
+ @PathParam("encoding") String encoding, @QueryParam("start") int start) {
return null;
}
- @GET
- @Path("/user2/{id}/{format:(/format/[^/]+?)?}/{encoding:(/encoding/[^/]+?)?}")
- public Response getContent2(@PathParam("id") int id,
- @PathParam("format") String format,
- @PathParam("encoding") String encoding,
- @QueryParam("start") int start) {
+ // invalid "{param2}" value (because of "{" and "}" chars)
+ // unbound path template parameter "param2"
+ @PUT
+ @Path("{param2}")
+ public Response update1(@Context HttpServletRequest requestContext, String bar,
+ @PathParam("{param2}") String param2) throws Exception {
return null;
}
+ //OK
+ @PUT
+ @Path("{param2}")
+ public Response update2(@Context HttpServletRequest requestContext, String bar, @PathParam("param2") String param2)
+ throws Exception {
+ return null;
+ }
+
+ // more than 1 parameter without annotation
+ @PUT
+ @Path("{param2}")
+ public Response update3(@Context HttpServletRequest requestContext,
+ @PathParam("param2") String param2, String bar, String foo) throws Exception {
+ return null;
+ }
+
}
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/FOO.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/FOO.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/projects/org.jboss.tools.ws.jaxrs.tests.sampleproject/src/main/java/org/jboss/tools/ws/jaxrs/sample/services/FOO.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -8,8 +8,9 @@
import javax.ws.rs.HttpMethod;
@Retention(value=RetentionPolicy.RUNTIME)
-(a)Target(value=ElementType.ANNOTATION_TYPE)
+(a)Target(value=ElementType.METHOD)
@HttpMethod("FOO")
+@SuppressWarnings("unused") // keep it for some junit tests
public @interface FOO {
}
Property changes on: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src
___________________________________________________________________
Added: svn:ignore
+ test
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/WorkbenchUtils.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/WorkbenchUtils.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/WorkbenchUtils.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -848,7 +848,7 @@
return JdtUtils.resolveAnnotation(member, JdtUtils.parse(member, null), annotationName);
}
- public static Annotation getAnnotation(final IMember member, final String annotationName, String... values)
+ public static Annotation changeAnnotation(final IMember member, final String annotationName, String... values)
throws JavaModelException {
Annotation annotation = JdtUtils.resolveAnnotation(member, JdtUtils.parse(member, null), annotationName);
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/configuration/ProjectBuilderUtilsTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/configuration/ProjectBuilderUtilsTestCase.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/configuration/ProjectBuilderUtilsTestCase.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -53,37 +53,14 @@
}
@Test
- public void shouldInstallProjectFacetAndCheckPositionWithValidation() throws Exception {
+ public void shouldInstallProjectFacetAndCheckPosition() throws Exception {
// pre-conditions
- ProjectBuilderUtils.installProjectBuilder(javaProject.getProject(), ProjectBuilderUtils.VALIDATION_BUILDER_ID);
- Assert.assertTrue("Wrong result", ProjectBuilderUtils.isProjectBuilderInstalled(javaProject.getProject(),
- ProjectBuilderUtils.VALIDATION_BUILDER_ID));
ProjectBuilderUtils.uninstallProjectBuilder(javaProject.getProject(), BUILDER_ID);
Assert.assertFalse("Wrong result",
ProjectBuilderUtils.isProjectBuilderInstalled(javaProject.getProject(), BUILDER_ID));
// operation
ProjectBuilderUtils.installProjectBuilder(javaProject.getProject(), BUILDER_ID);
// post-conditions
- int customBuilderPosition = ProjectBuilderUtils.getBuilderPosition(project, BUILDER_ID);
- int validationBuilderPosition = ProjectBuilderUtils.getBuilderPosition(project,
- ProjectBuilderUtils.VALIDATION_BUILDER_ID);
- Assert.assertTrue("Wrong ordering:" + customBuilderPosition + " < " + validationBuilderPosition,
- customBuilderPosition == validationBuilderPosition - 1);
- }
-
- @Test
- public void shouldInstallProjectFacetAndCheckPositionWithoutValidation() throws Exception {
- // pre-conditions
- ProjectBuilderUtils
- .uninstallProjectBuilder(javaProject.getProject(), ProjectBuilderUtils.VALIDATION_BUILDER_ID);
- Assert.assertFalse("Wrong result", ProjectBuilderUtils.isProjectBuilderInstalled(javaProject.getProject(),
- ProjectBuilderUtils.VALIDATION_BUILDER_ID));
- ProjectBuilderUtils.uninstallProjectBuilder(javaProject.getProject(), BUILDER_ID);
- Assert.assertFalse("Wrong result",
- ProjectBuilderUtils.isProjectBuilderInstalled(javaProject.getProject(), BUILDER_ID));
- // operation
- ProjectBuilderUtils.installProjectBuilder(javaProject.getProject(), BUILDER_ID);
- // post-conditions
int p = ProjectBuilderUtils.getBuilderPosition(project, BUILDER_ID);
Assert.assertTrue("Wrong index" + p, p != -1);
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessorTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessorTestCase.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessorTestCase.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -18,6 +18,7 @@
import static org.hamcrest.Matchers.everyItem;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
+import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.changeAnnotation;
import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.getAnnotation;
import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.getMethod;
import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.getType;
@@ -76,6 +77,7 @@
import org.jboss.tools.ws.jaxrs.core.AbstractCommonTestCase;
import org.jboss.tools.ws.jaxrs.core.JBossJaxrsCorePlugin;
import org.jboss.tools.ws.jaxrs.core.WorkbenchUtils;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsBaseElement;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsHttpMethod;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsJavaApplication;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel;
@@ -124,7 +126,7 @@
private JaxrsHttpMethod createHttpMethod(EnumJaxrsClassname httpMethodElement) throws CoreException, JavaModelException {
final IType httpMethodType = JdtUtils.resolveType(httpMethodElement.qualifiedName, javaProject, progressMonitor);
final Annotation httpMethodAnnotation = getAnnotation(httpMethodType, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(httpMethodType, httpMethodAnnotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(httpMethodType, metamodel).httpMethod(httpMethodAnnotation).build();
return httpMethod;
}
@@ -193,9 +195,9 @@
final JavaElementDelta event = createEvent(sourceFolder, ADDED);
final List<JaxrsElementDelta> impacts = processEvent(event, progressMonitor);
// verifications
- // 1 Application + 1 HttpMethod + 6 RootResources + 2 Subresources + all their methods and fields (total of 16)..
- assertThat(impacts.size(), equalTo(30));
- assertThat(metamodel.getElements(javaProject).size(), equalTo(34)); // 4 previous HttpMethods + 29 added items
+ // 1 Application + 1 HttpMethod + 6 RootResources + 2 Subresources + all their methods and fields..
+ assertThat(impacts.size(), equalTo(35));
+ assertThat(metamodel.getElements(javaProject).size(), equalTo(39)); // 4 previous HttpMethods + all added items
assertThat(impacts, everyItem(Matchers.<JaxrsElementDelta> hasProperty("deltaKind", equalTo(ADDED))));
}
@@ -288,7 +290,7 @@
// pre-conditions
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.RestApplication",
javaProject, progressMonitor);
- final Annotation annotation = getAnnotation(type, APPLICATION_PATH.qualifiedName, "/bar");
+ final Annotation annotation = changeAnnotation(type, APPLICATION_PATH.qualifiedName, "/bar");
final JaxrsJavaApplication application = new JaxrsJavaApplication(type, annotation, metamodel);
metamodel.add(application);
// operation
@@ -486,7 +488,7 @@
// pre-conditions
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, getAnnotation(type, HTTP_METHOD.qualifiedName), metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(getAnnotation(type, HTTP_METHOD.qualifiedName)).build();
metamodel.add(httpMethod);
final Annotation annotation = getAnnotation(type, Target.class.getName());
// operation
@@ -503,8 +505,8 @@
// pre-conditions
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
- final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName, "BAR");
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final Annotation annotation = changeAnnotation(type, HTTP_METHOD.qualifiedName, "BAR");
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
// operation
final JavaElementDelta event = createEvent(annotation, CHANGED);
@@ -523,7 +525,7 @@
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
// operation
final JavaElementDelta event = createEvent(annotation, CHANGED);
@@ -539,7 +541,7 @@
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
final Annotation httpMethodAnnotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, httpMethodAnnotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(httpMethodAnnotation).build();
metamodel.add(httpMethod);
final Annotation targetAnnotation = getAnnotation(type, Target.class.getName());
// operation
@@ -557,7 +559,7 @@
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
// operation
final JavaElementDelta event = createEvent(type.getCompilationUnit(), REMOVED);
@@ -576,7 +578,7 @@
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
// operation
final JavaElementDelta event = createEvent(type, REMOVED);
@@ -595,7 +597,7 @@
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
// operation
final JavaElementDelta event = createEvent(annotation, REMOVED);
@@ -613,7 +615,7 @@
// pre-conditions
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, getAnnotation(type, HTTP_METHOD.qualifiedName), metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(getAnnotation(type, HTTP_METHOD.qualifiedName)).build();
metamodel.add(httpMethod);
// operation
final JavaElementDelta event = createEvent(getAnnotation(type, Target.class.getName()), REMOVED);
@@ -629,7 +631,7 @@
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
final IPackageFragmentRoot sourceFolder = WorkbenchUtils.getPackageFragmentRoot(javaProject, "src/main/java",
progressMonitor);
@@ -652,7 +654,7 @@
// let's suppose that this jar only contains 1 HTTP Methods ;-)
final IType type = JdtUtils.resolveType("javax.ws.rs.GET", javaProject, progressMonitor);
final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
// operation
final JavaElementDelta event = createEvent(lib, REMOVED);
@@ -798,7 +800,7 @@
public void shouldUpdateResourceWhenChangingPathAnnotationValue() throws CoreException {
// pre-conditions
final IType type = getType("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource", javaProject);
- final Annotation annotation = getAnnotation(type, PATH.qualifiedName, "/bar");
+ final Annotation annotation = changeAnnotation(type, PATH.qualifiedName, "/bar");
final JaxrsResource resource = new JaxrsResource.Builder(type, metamodel).pathTemplate(annotation).build();
metamodel.add(resource);
// operation
@@ -835,7 +837,7 @@
// pre-conditions
final IType type = getType("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource", javaProject);
final Annotation pathAnnotation = getAnnotation(type, PATH.qualifiedName);
- final Annotation consumesAnnotation = getAnnotation(type, CONSUMES.qualifiedName, "application/foo");
+ final Annotation consumesAnnotation = changeAnnotation(type, CONSUMES.qualifiedName, "application/foo");
final JaxrsResource resource = new JaxrsResource.Builder(type, metamodel).pathTemplate(pathAnnotation)
.consumes(consumesAnnotation).build();
metamodel.add(resource);
@@ -890,7 +892,7 @@
public void shouldUpdateResourceWhenChangingProducesAnnotationValue() throws CoreException {
// pre-conditions
final IType type = getType("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource", javaProject);
- final Annotation annotation = getAnnotation(type, PRODUCES.qualifiedName, "application/foo");
+ final Annotation annotation = changeAnnotation(type, PRODUCES.qualifiedName, "application/foo");
final Annotation pathAnnotation = getAnnotation(type, PATH.qualifiedName);
final JaxrsResource resource = new JaxrsResource.Builder(type, metamodel).pathTemplate(pathAnnotation)
.produces(annotation).build();
@@ -1080,7 +1082,7 @@
final JaxrsResource resource = new JaxrsResource.Builder(type, metamodel).pathTemplate(pathAnnotation).build();
metamodel.add(resource);
final IField field = type.getField("productType");
- final Annotation annotation = getAnnotation(field, PATH_PARAM.qualifiedName, "foo");
+ final Annotation annotation = changeAnnotation(field, PATH_PARAM.qualifiedName, "foo");
final JaxrsResourceField resourceField = new JaxrsResourceField(field, annotation, resource, metamodel);
metamodel.add(resourceField);
// operation
@@ -1100,7 +1102,7 @@
final JaxrsResource resource = new JaxrsResource.Builder(type, metamodel).pathTemplate(pathAnnotation).build();
metamodel.add(resource);
final IField field = type.getField("foo");
- final Annotation annotation = getAnnotation(field, QUERY_PARAM.qualifiedName, "foo!");
+ final Annotation annotation = changeAnnotation(field, QUERY_PARAM.qualifiedName, "foo!");
final JaxrsResourceField resourceField = new JaxrsResourceField(field, annotation, resource, metamodel);
metamodel.add(resourceField);
// operation
@@ -1120,7 +1122,7 @@
final JaxrsResource resource = new JaxrsResource.Builder(type, metamodel).pathTemplate(pathAnnotation).build();
metamodel.add(resource);
final IField field = type.getField("bar");
- final Annotation annotation = getAnnotation(field, MATRIX_PARAM.qualifiedName, "bar!");
+ final Annotation annotation = changeAnnotation(field, MATRIX_PARAM.qualifiedName, "bar!");
final JaxrsResourceField resourceField = new JaxrsResourceField(field, annotation, resource, metamodel);
metamodel.add(resourceField);
// operation
@@ -1140,7 +1142,7 @@
final JaxrsResource resource = new JaxrsResource.Builder(type, metamodel).pathTemplate(pathAnnotation).build();
metamodel.add(resource);
final IField field = type.getField("bar");
- final Annotation annotation = getAnnotation(field, SuppressWarnings.class.getName(), "bar");
+ final Annotation annotation = changeAnnotation(field, SuppressWarnings.class.getName(), "bar");
final JaxrsResourceField resourceField = new JaxrsResourceField(field, annotation, resource, metamodel);
metamodel.add(resourceField);
// operation
@@ -1360,7 +1362,7 @@
final Annotation annotation = getAnnotation(type, PATH.qualifiedName);
final JaxrsResource resource = new JaxrsResource.Builder(type, metamodel).pathTemplate(annotation).build();
metamodel.add(resource);
- for (JaxrsResourceMethod resourceMethod : resource.getMethods().values()) {
+ for (JaxrsBaseElement resourceMethod : resource.getMethods().values()) {
metamodel.remove(resourceMethod);
}
// operation
@@ -1671,7 +1673,7 @@
metamodel.add(resource);
// JAX-RS Resource Method
final IMethod method = getMethod(type, "getCustomer");
- final Annotation pathAnnotation = getAnnotation(method, PATH.qualifiedName, "/foo");
+ final Annotation pathAnnotation = changeAnnotation(method, PATH.qualifiedName, "/foo");
final Annotation httpAnnotation = getAnnotation(method, GET.qualifiedName);
final JaxrsResourceMethod resourceMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(httpAnnotation).pathTemplate(pathAnnotation).build();
@@ -1727,7 +1729,7 @@
metamodel.add(resource);
// JAX-RS Resource Method
final IMethod method = getMethod(type, "createCustomer");
- final Annotation consumesAnnotation = getAnnotation(method, CONSUMES.qualifiedName, "application/foo");
+ final Annotation consumesAnnotation = changeAnnotation(method, CONSUMES.qualifiedName, "application/foo");
final Annotation httpAnnotation = getAnnotation(method, POST.qualifiedName);
final JaxrsResourceMethod resourceMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(httpAnnotation).consumes(consumesAnnotation).build();
@@ -1812,7 +1814,7 @@
// JAX-RS Resource Method
final IMethod method = getMethod(type, "getCustomerAsVCard");
final Annotation httpAnnotation = getAnnotation(method, GET.qualifiedName);
- final Annotation producesAnnotation = getAnnotation(method, PRODUCES.qualifiedName, "application/foo");
+ final Annotation producesAnnotation = changeAnnotation(method, PRODUCES.qualifiedName, "application/foo");
final JaxrsResourceMethod resourceMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(httpAnnotation).produces(producesAnnotation).build();
metamodel.add(resourceMethod);
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilderTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilderTestCase.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuilderTestCase.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -73,7 +73,7 @@
// verification
final IJaxrsMetamodel metamodel = JaxrsMetamodelLocator.get(javaProject);
assertThat(metamodel, notNullValue());
- assertThat(metamodel.getAllEndpoints().size(), equalTo(14));
+ assertThat(metamodel.getAllEndpoints().size(), equalTo(20));
}
@Test
@@ -90,7 +90,7 @@
// verification
final IJaxrsMetamodel metamodel = JaxrsMetamodelLocator.get(javaProject);
assertThat(metamodel, notNullValue());
- assertThat(metamodel.getAllEndpoints().size(), equalTo(14));
+ assertThat(metamodel.getAllEndpoints().size(), equalTo(20));
}
@Test
@@ -139,8 +139,8 @@
// verification
final IJaxrsMetamodel metamodel = JaxrsMetamodelLocator.get(javaProject);
assertThat(metamodel, notNullValue());
- // 13 usual endpoints + 2 newly created
- assertThat(metamodel.getAllEndpoints().size(), equalTo(16));
+ // 13 usual endpoints + some newly created
+ assertThat(metamodel.getAllEndpoints().size(), equalTo(22));
}
@Test
@@ -157,8 +157,8 @@
// verification
final IJaxrsMetamodel metamodel = JaxrsMetamodelLocator.get(javaProject);
assertThat(metamodel, notNullValue());
- // 13 usual endpoints + 2 newly created
- assertThat(metamodel.getAllEndpoints().size(), equalTo(16));
+ // 13 usual endpoints + some newly created
+ assertThat(metamodel.getAllEndpoints().size(), equalTo(22));
}
@Test
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessorTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessorTestCase.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessorTestCase.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -16,6 +16,7 @@
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isOneOf;
+import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.changeAnnotation;
import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.getAnnotation;
import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.getMethod;
import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.getType;
@@ -43,6 +44,7 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.ws.jaxrs.core.AbstractCommonTestCase;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsBaseElement;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsBuiltinHttpMethod;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsEndpoint;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsHttpMethod;
@@ -119,7 +121,7 @@
private JaxrsHttpMethod createHttpMethod(String qualifiedName) throws JavaModelException, CoreException {
final IType type = getType(qualifiedName, javaProject);
final Annotation httpAnnotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, httpAnnotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(httpAnnotation).build();
metamodel.add(httpMethod);
return httpMethod;
}
@@ -205,7 +207,7 @@
public void shoudCreateEndpointWhenAddingResourceMethodInRootResource() throws CoreException {
// pre-conditions
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
- final JaxrsResourceMethod customerResourceMethod = createResourceMethod("getCustomers", customerResource,
+ final JaxrsBaseElement customerResourceMethod = createResourceMethod("getCustomers", customerResource,
GET);
// operation
JaxrsElementDelta event = new JaxrsElementDelta(customerResourceMethod, ADDED);
@@ -219,7 +221,7 @@
public void shoudCreateEndpointWhenAddingSubresourceMethodInRootResource() throws JavaModelException, CoreException {
// pre-conditions
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
- final JaxrsResourceMethod customerSubresourceMethod = createResourceMethod("getCustomer", customerResource,
+ final JaxrsBaseElement customerSubresourceMethod = createResourceMethod("getCustomer", customerResource,
GET);
// operation
JaxrsElementDelta event = new JaxrsElementDelta(customerSubresourceMethod, ADDED);
@@ -241,7 +243,7 @@
// createEndpoint(httpMethod, gameResourceMethod);
final JaxrsResource productResourceLocator = createResource("org.jboss.tools.ws.jaxrs.sample.services.ProductResourceLocator");
- final JaxrsResourceMethod productResourceLocatorMethod = createResourceMethod("getProductResourceLocator",
+ final JaxrsBaseElement productResourceLocatorMethod = createResourceMethod("getProductResourceLocator",
productResourceLocator, null);
// operation
JaxrsElementDelta event = new JaxrsElementDelta(productResourceLocatorMethod, ADDED);
@@ -258,7 +260,7 @@
final JaxrsResource productResourceLocator = createResource("org.jboss.tools.ws.jaxrs.sample.services.ProductResourceLocator");
createResourceMethod("getProductResourceLocator", productResourceLocator, null);
final JaxrsResource bookResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.BookResource");
- final JaxrsResourceMethod bookResourceMethod = createResourceMethod("getAllProducts", bookResource, GET);
+ final JaxrsBaseElement bookResourceMethod = createResourceMethod("getAllProducts", bookResource, GET);
// operation
final JaxrsElementDelta event = new JaxrsElementDelta(bookResourceMethod, ADDED);
final List<JaxrsEndpointDelta> changes = processEvent(event, progressMonitor);
@@ -292,7 +294,7 @@
final JaxrsResource productResourceLocator = createResource("org.jboss.tools.ws.jaxrs.sample.services.ProductResourceLocator");
createResourceMethod("getProductResourceLocator", productResourceLocator, null);
final JaxrsResource bookResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.BookResource");
- final JaxrsResourceMethod bookResourceMethod = createResourceMethod("getProduct", bookResource, GET);
+ final JaxrsBaseElement bookResourceMethod = createResourceMethod("getProduct", bookResource, GET);
// operation
final JaxrsElementDelta event = new JaxrsElementDelta(bookResourceMethod, ADDED);
final List<JaxrsEndpointDelta> changes = processEvent(event, progressMonitor);
@@ -383,7 +385,7 @@
final JaxrsEndpoint endpoint = createEndpoint(metamodel, httpMethod, customerResourceMethod);
assertThat(endpoint.getUriPathTemplate(), equalTo("/app/customers/{id}"));
// operation
- final Annotation annotation = getAnnotation(application.getJavaElement(), APPLICATION_PATH.qualifiedName, "/foo");
+ final Annotation annotation = changeAnnotation(application.getJavaElement(), APPLICATION_PATH.qualifiedName, "/foo");
int flags = application.addOrUpdateAnnotation(annotation);
final JaxrsElementDelta event = new JaxrsElementDelta(application, CHANGED, flags);
final List<JaxrsEndpointDelta> changes = processEvent(event, progressMonitor);
@@ -406,7 +408,7 @@
final JaxrsEndpoint endpoint = createEndpoint(httpMethod, customerResourceMethod);
assertThat(endpoint.getUriPathTemplate(), equalTo("/customers/{id}"));
// operation
- final Annotation annotation = getAnnotation(customerResource.getJavaElement(), PATH.qualifiedName, "/foo");
+ final Annotation annotation = changeAnnotation(customerResource.getJavaElement(), PATH.qualifiedName, "/foo");
customerResource.addOrUpdateAnnotation(annotation);
final JaxrsElementDelta event = new JaxrsElementDelta(customerResource, CHANGED, F_PATH_VALUE);
final List<JaxrsEndpointDelta> changes = processEvent(event, progressMonitor);
@@ -429,7 +431,7 @@
final JaxrsEndpoint endpoint = createEndpoint(httpMethod, customerResourceMethod);
assertThat(endpoint.getUriPathTemplate(), equalTo("/customers/{id}"));
// operation
- final Annotation annotation = getAnnotation(customerResourceMethod.getJavaElement(), PATH.qualifiedName, "{foo}");
+ final Annotation annotation = changeAnnotation(customerResourceMethod.getJavaElement(), PATH.qualifiedName, "{foo}");
final int flags = customerResourceMethod.addOrUpdateAnnotation(annotation);
final JaxrsElementDelta event = new JaxrsElementDelta(customerResourceMethod, CHANGED, flags);
final List<JaxrsEndpointDelta> changes = processEvent(event, progressMonitor);
@@ -483,7 +485,7 @@
assertThat(endpoint.getUriPathTemplate(), equalTo("/customers/{id}"));
// operation
int flags = httpMethod
- .addOrUpdateAnnotation(getAnnotation(httpMethod.getJavaElement(), HTTP_METHOD.qualifiedName, "BAR"));
+ .addOrUpdateAnnotation(changeAnnotation(httpMethod.getJavaElement(), HTTP_METHOD.qualifiedName, "BAR"));
final JaxrsElementDelta event = new JaxrsElementDelta(httpMethod, CHANGED, flags);
final List<JaxrsEndpointDelta> changes = processEvent(event, progressMonitor);
// verifications
@@ -592,7 +594,7 @@
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
final JaxrsResourceMethod customerResourceMethod = createResourceMethod("createCustomer", customerResource,
POST);
- final Annotation annotation = getAnnotation(customerResourceMethod.getJavaElement(), CONSUMES.qualifiedName,
+ final Annotation annotation = changeAnnotation(customerResourceMethod.getJavaElement(), CONSUMES.qualifiedName,
"application/foo");
customerResourceMethod.addOrUpdateAnnotation(annotation);
final JaxrsEndpoint endpoint = createEndpoint(httpMethod, customerResourceMethod);
@@ -615,7 +617,7 @@
// pre-conditions
final JaxrsHttpMethod httpMethod = JaxrsBuiltinHttpMethod.POST;
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
- final Annotation annotation = getAnnotation(customerResource.getJavaElement(), CONSUMES.qualifiedName,
+ final Annotation annotation = changeAnnotation(customerResource.getJavaElement(), CONSUMES.qualifiedName,
"application/foo");
customerResource.addOrUpdateAnnotation(annotation);
final JaxrsResourceMethod customerResourceMethod = createResourceMethod("createCustomer", customerResource,
@@ -641,11 +643,11 @@
// pre-conditions
final JaxrsHttpMethod httpMethod = JaxrsBuiltinHttpMethod.POST;
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
- customerResource.addOrUpdateAnnotation(getAnnotation(customerResource.getJavaElement(), CONSUMES.qualifiedName,
+ customerResource.addOrUpdateAnnotation(changeAnnotation(customerResource.getJavaElement(), CONSUMES.qualifiedName,
"application/xml"));
final JaxrsResourceMethod customerResourceMethod = createResourceMethod("createCustomer", customerResource,
POST);
- final Annotation annotation = getAnnotation(customerResourceMethod.getJavaElement(), CONSUMES.qualifiedName,
+ final Annotation annotation = changeAnnotation(customerResourceMethod.getJavaElement(), CONSUMES.qualifiedName,
"application/foo");
customerResourceMethod.addOrUpdateAnnotation(annotation);
final JaxrsEndpoint endpoint = createEndpoint(httpMethod, customerResourceMethod);
@@ -670,7 +672,7 @@
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
final JaxrsResourceMethod customerResourceMethod = createResourceMethod("createCustomer", customerResource,
POST);
- final Annotation annotation = getAnnotation(customerResourceMethod.getJavaElement(), CONSUMES.qualifiedName,
+ final Annotation annotation = changeAnnotation(customerResourceMethod.getJavaElement(), CONSUMES.qualifiedName,
"application/foo");
customerResourceMethod.addOrUpdateAnnotation(annotation);
final JaxrsEndpoint endpoint = createEndpoint(httpMethod, customerResourceMethod);
@@ -697,7 +699,7 @@
final JaxrsEndpoint endpoint = createEndpoint(httpMethod, customerResourceMethod);
assertThat(endpoint.getProducedMediaTypes(), equalTo(Arrays.asList("*/*")));
// operation
- final int flags = customerResource.addOrUpdateAnnotation(getAnnotation(customerResource.getJavaElement(),
+ final int flags = customerResource.addOrUpdateAnnotation(changeAnnotation(customerResource.getJavaElement(),
PRODUCES.qualifiedName, "application/xml"));
final JaxrsElementDelta event = new JaxrsElementDelta(customerResource, CHANGED, flags);
final List<JaxrsEndpointDelta> changes = processEvent(event, progressMonitor);
@@ -737,7 +739,7 @@
// pre-conditions
final JaxrsHttpMethod httpMethod = JaxrsBuiltinHttpMethod.GET;
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
- final Annotation annotation = getAnnotation(customerResource.getJavaElement(), PRODUCES.qualifiedName,
+ final Annotation annotation = changeAnnotation(customerResource.getJavaElement(), PRODUCES.qualifiedName,
"application/foo");
customerResource.addOrUpdateAnnotation(annotation);
final JaxrsResourceMethod customerResourceMethod = createResourceMethod("getCustomerAsVCard", customerResource,
@@ -745,7 +747,7 @@
final JaxrsEndpoint endpoint = createEndpoint(httpMethod, customerResourceMethod);
assertThat(endpoint.getProducedMediaTypes(), equalTo(Arrays.asList("application/foo")));
// operation
- int flags = customerResource.addOrUpdateAnnotation(getAnnotation(customerResource.getJavaElement(),
+ int flags = customerResource.addOrUpdateAnnotation(changeAnnotation(customerResource.getJavaElement(),
PRODUCES.qualifiedName, "application/xml"));
final JaxrsElementDelta event = new JaxrsElementDelta(customerResource, CHANGED, flags);
final List<JaxrsEndpointDelta> changes = processEvent(event, progressMonitor);
@@ -765,7 +767,7 @@
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
final JaxrsResourceMethod customerResourceMethod = createResourceMethod("getCustomerAsVCard", customerResource,
POST);
- final Annotation annotation = getAnnotation(customerResourceMethod.getJavaElement(), PRODUCES.qualifiedName,
+ final Annotation annotation = changeAnnotation(customerResourceMethod.getJavaElement(), PRODUCES.qualifiedName,
"application/foo");
customerResourceMethod.addOrUpdateAnnotation(annotation);
final JaxrsEndpoint endpoint = createEndpoint(httpMethod, customerResourceMethod);
@@ -789,11 +791,11 @@
// pre-conditions
final JaxrsHttpMethod httpMethod = JaxrsBuiltinHttpMethod.GET;
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
- customerResource.addOrUpdateAnnotation(getAnnotation(customerResource.getJavaElement(), PRODUCES.qualifiedName,
+ customerResource.addOrUpdateAnnotation(changeAnnotation(customerResource.getJavaElement(), PRODUCES.qualifiedName,
"application/xml"));
final JaxrsResourceMethod customerResourceMethod = createResourceMethod("getCustomerAsVCard", customerResource,
POST);
- final Annotation annotation = getAnnotation(customerResourceMethod.getJavaElement(), PRODUCES.qualifiedName,
+ final Annotation annotation = changeAnnotation(customerResourceMethod.getJavaElement(), PRODUCES.qualifiedName,
"application/foo");
customerResourceMethod.addOrUpdateAnnotation(annotation);
final JaxrsEndpoint endpoint = createEndpoint(httpMethod, customerResourceMethod);
@@ -818,7 +820,7 @@
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
final JaxrsResourceMethod customerResourceMethod = createResourceMethod("createCustomer", customerResource,
POST);
- final Annotation annotation = getAnnotation(customerResourceMethod.getJavaElement(), CONSUMES.qualifiedName,
+ final Annotation annotation = changeAnnotation(customerResourceMethod.getJavaElement(), CONSUMES.qualifiedName,
"application/foo");
customerResourceMethod.addOrUpdateAnnotation(annotation);
final JaxrsEndpoint endpoint = createEndpoint(httpMethod, customerResourceMethod);
@@ -960,7 +962,7 @@
createEndpoint(httpMethod, productResourceLocatorMethod, bookResourceMethod);
// adding an extra subresource that should be affected later
final JaxrsResource gameResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.GameResource");
- final JaxrsResourceMethod gameResourceMethod = createResourceMethod("getProduct", gameResource, GET);
+ final JaxrsBaseElement gameResourceMethod = createResourceMethod("getProduct", gameResource, GET);
assertThat(metamodel.getAllEndpoints().size(), equalTo(1));
// operation
final IType objectType = JdtUtils.resolveType(Object.class.getName(), javaProject, progressMonitor);
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedProcessorTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedProcessorTestCase.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedProcessorTestCase.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -17,6 +17,7 @@
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.everyItem;
import static org.hamcrest.Matchers.notNullValue;
+import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.changeAnnotation;
import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.getAnnotation;
import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.getType;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.APPLICATION_PATH;
@@ -26,7 +27,10 @@
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.HTTP_METHOD;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.POST;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.PUT;
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.RETENTION;
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.TARGET;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.spy;
@@ -114,7 +118,7 @@
* @throws JavaModelException
*/
private JaxrsJavaApplication createApplication(IType type, String applicationPath) throws JavaModelException {
- final Annotation annotation = getAnnotation(type, APPLICATION_PATH.qualifiedName, applicationPath);
+ final Annotation annotation = changeAnnotation(type, APPLICATION_PATH.qualifiedName, applicationPath);
return new JaxrsJavaApplication(type, annotation, metamodel);
}
@@ -137,19 +141,22 @@
private JaxrsHttpMethod createHttpMethod(EnumJaxrsClassname httpMethodElement) throws CoreException, JavaModelException {
final IType httpMethodType = JdtUtils.resolveType(httpMethodElement.qualifiedName, javaProject, progressMonitor);
final Annotation httpMethodAnnotation = getAnnotation(httpMethodType, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(httpMethodType, httpMethodAnnotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(httpMethodType, metamodel).httpMethod(httpMethodAnnotation).build();
+
return httpMethod;
}
private JaxrsHttpMethod createHttpMethod(IType type) throws JavaModelException {
- final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final Annotation httpMethodAnnotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
+ final Annotation targetAnnotation = getAnnotation(type, TARGET.qualifiedName);
+ final Annotation retentionAnnotation = getAnnotation(type, RETENTION.qualifiedName);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(httpMethodAnnotation).target(targetAnnotation).retention(retentionAnnotation).build();
return httpMethod;
}
private JaxrsHttpMethod createHttpMethod(IType type, String httpVerb) throws JavaModelException {
- final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName, httpVerb);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final Annotation annotation = changeAnnotation(type, HTTP_METHOD.qualifiedName, httpVerb);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
return httpMethod;
}
@@ -188,7 +195,7 @@
assertThat(affectedElements.size(), equalTo(9));
assertThat(affectedElements, everyItem(Matchers.<JaxrsElementDelta> hasProperty("deltaKind", equalTo(ADDED))));
// all HttpMethods, Resources, ResourceMethods and ResourceFields. only application is available: the java-based one found in src/main/java
- assertThat(metamodel.getElements(javaProject).size(), equalTo(30));
+ assertThat(metamodel.getElements(javaProject).size(), equalTo(35));
}
@Test
@@ -211,7 +218,7 @@
assertThat(affectedElements, everyItem(Matchers.<JaxrsElementDelta> hasProperty("deltaKind", equalTo(ADDED))));
// all project-specific Applications, HttpMethods, Resources, ResourceMethods and ResourceFields (built-in HttpMethods are not bound to a project)
// 2 applications are available: the java-based and the web.xml since a full build was performed
- assertThat(metamodel.getElements(javaProject).size(), equalTo(31));
+ assertThat(metamodel.getElements(javaProject).size(), equalTo(36));
}
/**
@@ -242,7 +249,7 @@
final List<JaxrsElementDelta> affectedElements = affectedMetamodel.getAffectedElements();
assertThat(affectedElements.size(), equalTo(9));
// all Applications, HttpMethods, Resources, ResourceMethods and ResourceFields specific to the project
- assertThat(metamodel.getElements(javaProject).size(), equalTo(31));
+ assertThat(metamodel.getElements(javaProject).size(), equalTo(36));
}
@@ -354,7 +361,7 @@
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
// operation
WorkbenchUtils.delete(type);
@@ -563,7 +570,7 @@
// let's suppose that this jar only contains 1 HTTP Methods ;-)
final IType type = JdtUtils.resolveType("javax.ws.rs.GET", javaProject, progressMonitor);
final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
// operation
final ResourceDelta event = createEvent(lib.getResource(), REMOVED);
@@ -595,7 +602,8 @@
// pre-conditions
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
- metamodel.add(createHttpMethod(type, "bar"));
+ final JaxrsHttpMethod httpMethod = createHttpMethod(type, "bar");
+ metamodel.add(httpMethod);
// operation
final ResourceDelta event = createEvent(type.getResource(), CHANGED);
final List<JaxrsElementDelta> affectedElements = processResourceChanges(event, progressMonitor);
@@ -606,9 +614,48 @@
assertThat(((IJaxrsHttpMethod) affectedElements.get(0).getElement()).getHttpVerb(), equalTo("FOO"));
verify(metamodel, times(1)).add(any(JaxrsHttpMethod.class));
assertThat(metamodel.getElements(javaProject).size(), equalTo(1));
+ assertThat(httpMethod.getHttpVerb(), equalTo("FOO"));
}
@Test
+ public void shouldChangeHttpMethodWhenRemovingTargetAnnotation() throws CoreException {
+ // pre-conditions
+ final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
+ progressMonitor);
+ final JaxrsHttpMethod httpMethod = createHttpMethod(type);
+ metamodel.add(httpMethod);
+ final Annotation annotation = getAnnotation(type, TARGET.qualifiedName);
+ // operation
+ WorkbenchUtils.delete(annotation.getJavaAnnotation(), false);
+ final ResourceDelta event = createEvent(annotation.getJavaParent().getResource(), CHANGED);
+ final List<JaxrsElementDelta> affectedElements = processResourceChanges(event, progressMonitor);
+ // verifications
+ assertThat(affectedElements.size(), equalTo(1));
+ assertThat(affectedElements.get(0).getElement().getElementCategory(), equalTo(EnumElementCategory.HTTP_METHOD));
+ assertThat(affectedElements.get(0).getDeltaKind(), equalTo(CHANGED));
+ assertThat(((IJaxrsHttpMethod) affectedElements.get(0).getElement()).getHttpVerb(), equalTo("FOO"));
+ verify(metamodel, times(1)).add(any(JaxrsHttpMethod.class));
+ assertThat(metamodel.getElements(javaProject).size(), equalTo(1));
+ assertNull(httpMethod.getAnnotations().get(TARGET.qualifiedName));
+ }
+
+ @Test
+ public void shouldNotChangeHttpMethodWhenAddingDeprecatedAnnotation() throws CoreException {
+ // pre-conditions
+ final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
+ progressMonitor);
+ final JaxrsHttpMethod httpMethod = createHttpMethod(type);
+ metamodel.add(httpMethod);
+ final Annotation annotation = getAnnotation(type, TARGET.qualifiedName);
+ // operation
+ WorkbenchUtils.addTypeAnnotation(type, "@Deprecated", false);
+ final ResourceDelta event = createEvent(annotation.getJavaParent().getResource(), CHANGED);
+ final List<JaxrsElementDelta> affectedElements = processResourceChanges(event, progressMonitor);
+ // verifications
+ assertThat(affectedElements.size(), equalTo(0));
+ }
+
+ @Test
public void shouldRemoveHttpMethodWhenChangingResource() throws CoreException {
// pre-conditions
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
@@ -635,7 +682,7 @@
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
// operation
final ResourceDelta event = createEvent(type.getResource(), REMOVED);
@@ -654,7 +701,7 @@
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
// operation
WorkbenchUtils.delete(type);
@@ -674,7 +721,7 @@
final IType type = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
final Annotation annotation = getAnnotation(type, HTTP_METHOD.qualifiedName);
- final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(type, annotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(type, metamodel).httpMethod(annotation).build();
metamodel.add(httpMethod);
final IPackageFragmentRoot sourceFolder = WorkbenchUtils.getPackageFragmentRoot(javaProject, "src/main/java",
progressMonitor);
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactoryTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactoryTestCase.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactoryTestCase.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -117,7 +117,7 @@
// pre-conditions
final IType httpType = getType(GET.qualifiedName, javaProject);
final Annotation httpAnnotation = getAnnotation(httpType, HTTP_METHOD.qualifiedName);
- JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(httpType, httpAnnotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(httpType, metamodel).httpMethod(httpAnnotation).build();
metamodel.add(httpMethod);
final IType type = getType("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource", javaProject);
final IMethod method = getMethod(type, "getCustomerAsVCard");
@@ -135,7 +135,7 @@
// pre-conditions
final IType httpType = getType(GET.qualifiedName, javaProject);
final Annotation httpAnnotation = getAnnotation(httpType, HTTP_METHOD.qualifiedName);
- JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(httpType, httpAnnotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(httpType, metamodel).httpMethod(httpAnnotation).build();
metamodel.add(httpMethod);
final IType type = getType("org.jboss.tools.ws.jaxrs.sample.services.BookResource", javaProject);
final IMethod method = getMethod(type, "getProduct");
@@ -153,7 +153,7 @@
// pre-conditions
final IType httpType = getType(GET.qualifiedName, javaProject);
final Annotation httpAnnotation = getAnnotation(httpType, HTTP_METHOD.qualifiedName);
- JaxrsHttpMethod httpMethod = new JaxrsHttpMethod(httpType, httpAnnotation, metamodel);
+ final JaxrsHttpMethod httpMethod = new JaxrsHttpMethod.Builder(httpType, metamodel).httpMethod(httpAnnotation).build();
metamodel.add(httpMethod);
final IType type = getType("org.jboss.tools.ws.jaxrs.sample.services.ProductResourceLocator", javaProject);
IField field = type.getField("foo");
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodelTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodelTestCase.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodelTestCase.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -78,7 +78,7 @@
IType javaType = JdtUtils.resolveType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject,
progressMonitor);
final Annotation annotation = JdtUtils.resolveAnnotation(javaType, JdtUtils.parse(javaType, progressMonitor),
- Target.class);
+ SuppressWarnings.class);
assertThat(metamodel.getElement(annotation), nullValue());
}
@@ -144,7 +144,7 @@
@Test
public void shouldAssertResolvedEndpoints() throws CoreException {
List<IJaxrsEndpoint> endpoints = metamodel.getAllEndpoints();
- Assert.assertEquals("Wrong result", 14, endpoints.size());
+ Assert.assertEquals("Wrong result", 20, endpoints.size());
for (IJaxrsEndpoint endpoint : endpoints) {
Assert.assertFalse("Empty list of resourceMethods", endpoint.getResourceMethods().isEmpty());
Assert.assertNotNull("No URI Path template", endpoint.getUriPathTemplate());
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidatorTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidatorTestCase.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidatorTestCase.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -11,102 +11,343 @@
package org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation;
import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.is;
+import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.changeAnnotation;
import static org.jboss.tools.ws.jaxrs.core.WorkbenchUtils.getAnnotation;
import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.HTTP_METHOD;
-import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.PATH;
+import static org.jboss.tools.ws.jaxrs.core.jdt.EnumJaxrsClassname.TARGET;
import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IMethod;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
-import org.eclipse.wst.validation.ValidatorMessage;
+import org.eclipse.wst.validation.ReporterHelper;
+import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.jboss.tools.common.validation.ContextValidationHelper;
+import org.jboss.tools.common.validation.IProjectValidationContext;
+import org.jboss.tools.common.validation.ValidationErrorManager;
+import org.jboss.tools.common.validation.ValidatorManager;
+import org.jboss.tools.common.validation.internal.ProjectValidationContext;
import org.jboss.tools.ws.jaxrs.core.WorkbenchUtils;
import org.jboss.tools.ws.jaxrs.core.builder.AbstractMetamodelBuilderTestCase;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsBaseElement;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsHttpMethod;
+import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsResource;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsResourceMethod;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
+import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
+import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsApplication;
+import org.jboss.tools.ws.jaxrs.core.preferences.JaxrsPreferences;
import org.junit.Test;
/**
* @author Xi
- *
+ *
*/
+@SuppressWarnings("restriction")
public class JaxrsMetamodelValidatorTestCase extends AbstractMetamodelBuilderTestCase {
-
+
+ private final IReporter reporter = new ReporterHelper(new NullProgressMonitor());
+ private final ContextValidationHelper validationHelper = new ContextValidationHelper();
+ private final IProjectValidationContext context = new ProjectValidationContext();
+ private final ValidatorManager validatorManager = new ValidatorManager();
+
+ private Set<IFile> toSet(IResource resource) {
+ final Set<IFile> changedFiles = new HashSet<IFile>();
+ changedFiles.add((IFile) resource);
+ return changedFiles;
+ }
+
+ /**
+ * @param element
+ * @return
+ * @throws CoreException
+ */
+ private IMarker[] findJaxrsMarkers(final JaxrsBaseElement element) throws CoreException {
+ switch (element.getElementCategory()) {
+ case HTTP_METHOD:
+ case RESOURCE:
+ return element.getResource().findMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, true,
+ IResource.DEPTH_INFINITE);
+ case RESOURCE_METHOD:
+ final IMarker[] markers = element.getResource().findMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE,
+ true, IResource.DEPTH_INFINITE);
+ final List<IMarker> resourceMethodMarkers = new ArrayList<IMarker>();
+ final ISourceRange methodSourceRange = ((JaxrsResourceMethod) element).getJavaElement().getSourceRange();
+
+ for (IMarker marker : markers) {
+ final int markerCharStart = marker.getAttribute(IMarker.CHAR_START, -1);
+ if (markerCharStart >= methodSourceRange.getOffset()
+ && markerCharStart <= (methodSourceRange.getOffset() + methodSourceRange.getLength())) {
+ resourceMethodMarkers.add(marker);
+ }
+ }
+ return resourceMethodMarkers.toArray(new IMarker[resourceMethodMarkers.size()]);
+ default:
+ return new IMarker[0];
+ }
+ }
+
+ /**
+ * @param element
+ * @throws CoreException
+ */
+ private void deleteJaxrsMarkers(final JaxrsBaseElement element) throws CoreException {
+ element.getResource()
+ .deleteMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, false, IResource.DEPTH_INFINITE);
+ }
+
+ /**
+ * @param element
+ * @throws CoreException
+ */
+ private void deleteJaxrsMarkers(final IProject project) throws CoreException {
+ project.deleteMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, false, IResource.DEPTH_INFINITE);
+ }
+
@Test
- public void shouldValidateHttpMethod() throws CoreException {
+ public void shouldValidateHttpMethod() throws CoreException, ValidationException {
// preconditions
- IType fooType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject);
+ final IType fooType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject);
final JaxrsBaseElement httpMethod = metamodel.getElement(fooType);
+ assertThat(findJaxrsMarkers(httpMethod).length, equalTo(0));
+ deleteJaxrsMarkers(httpMethod);
// operation
- final List<ValidatorMessage> validationMessages = httpMethod.validate();
+ new JaxrsMetamodelValidator().validate(toSet(httpMethod.getResource()), project, validationHelper, context,
+ validatorManager, reporter);
// validation
- assertThat(validationMessages.size(), equalTo(0));
+ assertThat(findJaxrsMarkers(httpMethod).length, equalTo(0));
}
@Test
- public void shouldNotValidateHttpMethod() throws CoreException {
+ public void shouldReportProblemWhenHttpMethodVerbIsEmpty() throws CoreException, ValidationException {
// preconditions
- IType fooType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject);
+ final IType fooType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject);
final JaxrsHttpMethod httpMethod = metamodel.getElement(fooType, JaxrsHttpMethod.class);
- Annotation httpAnnotation = getAnnotation(fooType, HTTP_METHOD.qualifiedName, new String[0]);
+ final Annotation httpAnnotation = changeAnnotation(fooType, HTTP_METHOD.qualifiedName, new String[0]);
httpMethod.addOrUpdateAnnotation(httpAnnotation);
+ deleteJaxrsMarkers(httpMethod);
// operation
- final List<ValidatorMessage> validationMessages = httpMethod.validate();
+ new JaxrsMetamodelValidator().validate(toSet(httpMethod.getResource()), project, validationHelper, context,
+ validatorManager, reporter);
// validation
- assertThat(validationMessages.size(), equalTo(1));
+ final IMarker[] markers = findJaxrsMarkers(httpMethod);
+ assertThat(markers.length, equalTo(1));
}
-
+
@Test
- public void shouldValidateCustomerResourceMethod() throws CoreException {
+ public void shouldReportProblemWhenHttpMethodVerbIsNull() throws CoreException, ValidationException {
// preconditions
- IType customerJavaType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource", javaProject);
- final JaxrsBaseElement customerResource = metamodel.getElement(customerJavaType);
+ final IType fooType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject);
+ final JaxrsHttpMethod httpMethod = metamodel.getElement(fooType, JaxrsHttpMethod.class);
+ final Annotation httpAnnotation = changeAnnotation(fooType, HTTP_METHOD.qualifiedName, (String) null);
+ httpMethod.addOrUpdateAnnotation(httpAnnotation);
+ deleteJaxrsMarkers(httpMethod);
// operation
- final List<ValidatorMessage> validationMessages = customerResource.validate();
+ new JaxrsMetamodelValidator().validate(toSet(httpMethod.getResource()), project, validationHelper, context,
+ validatorManager, reporter);
// validation
- assertThat(validationMessages.size(), equalTo(0));
+ assertThat(findJaxrsMarkers(httpMethod).length, equalTo(1));
}
@Test
- public void shouldValidateBarResourceMethod() throws CoreException {
+ public void shouldReportProblemWhenHttpMethodTypeMissesTargetAnnotation() throws CoreException, ValidationException {
// preconditions
- IType barJavaType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.BarResource", javaProject);
- final JaxrsBaseElement barResource = metamodel.getElement(barJavaType);
+ final IType fooType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject);
+ final JaxrsHttpMethod httpMethod = metamodel.getElement(fooType, JaxrsHttpMethod.class);
+ final Annotation targetAnnotation = getAnnotation(fooType, TARGET.qualifiedName);
+ httpMethod.removeAnnotation(targetAnnotation);
+ deleteJaxrsMarkers(httpMethod);
// operation
- final List<ValidatorMessage> validationMessages = barResource.validate();
+ new JaxrsMetamodelValidator().validate(toSet(httpMethod.getResource()), project, validationHelper, context,
+ validatorManager, reporter);
// validation
- // 3 errors because of curly brackets + 4 warnings because of missing (correct) parameters
- assertThat(validationMessages.size(), equalTo(7));
+ assertThat(findJaxrsMarkers(httpMethod).length, equalTo(1));
}
@Test
- public void shouldValidateBazResourceMethod() throws CoreException {
+ public void shouldReportProblemWhenHttpMethodTypeTargetAnnotationHasNullValue() throws CoreException,
+ ValidationException {
// preconditions
- IType bazJavaType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.BazResource", javaProject);
- final JaxrsBaseElement barResource = metamodel.getElement(bazJavaType);
+ final IType fooType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject);
+ final JaxrsHttpMethod httpMethod = metamodel.getElement(fooType, JaxrsHttpMethod.class);
+ final Annotation targetAnnotation = changeAnnotation(fooType, TARGET.qualifiedName, (String) null);
+ httpMethod.addOrUpdateAnnotation(targetAnnotation);
+ deleteJaxrsMarkers(httpMethod);
// operation
- final List<ValidatorMessage> validationMessages = barResource.validate();
+ new JaxrsMetamodelValidator().validate(toSet(httpMethod.getResource()), project, validationHelper, context,
+ validatorManager, reporter);
// validation
- assertThat(validationMessages.size(), equalTo(0));
+ assertThat(findJaxrsMarkers(httpMethod).length, equalTo(1));
+
}
@Test
- public void shouldNotValidateResourceMethod() throws CoreException {
+ public void shouldReportProblemWhenHttpMethodTypeTargetAnnotationHasWrongValue() throws CoreException,
+ ValidationException {
// preconditions
- IType customerJavaType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource", javaProject);
+ final IType fooType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.FOO", javaProject);
+ final JaxrsHttpMethod httpMethod = metamodel.getElement(fooType, JaxrsHttpMethod.class);
+ final Annotation targetAnnotation = changeAnnotation(fooType, TARGET.qualifiedName, "FOO");
+ httpMethod.addOrUpdateAnnotation(targetAnnotation);
+ deleteJaxrsMarkers(httpMethod);
+ // operation
+ new JaxrsMetamodelValidator().validate(toSet(httpMethod.getResource()), project, validationHelper, context,
+ validatorManager, reporter);
+ // validation
+ assertThat(findJaxrsMarkers(httpMethod).length, equalTo(1));
+ }
+
+ @Test
+ public void shouldValidateCustomerResourceMethod() throws CoreException, ValidationException {
+ // preconditions
+ final IType customerJavaType = WorkbenchUtils.getType(
+ "org.jboss.tools.ws.jaxrs.sample.services.CustomerResource", javaProject);
final JaxrsBaseElement customerResource = metamodel.getElement(customerJavaType);
- IMethod customerJavaMethod = WorkbenchUtils.getMethod(customerJavaType, "getCustomer");
- final JaxrsResourceMethod customerResourceMethod = metamodel.getElement(customerJavaMethod, JaxrsResourceMethod.class);
- Annotation pathAnnotation = getAnnotation(customerJavaMethod, PATH.qualifiedName, "/{foo}");
- customerResourceMethod.addOrUpdateAnnotation(pathAnnotation);
+ deleteJaxrsMarkers(customerResource);
// operation
- final List<ValidatorMessage> validationMessages = customerResource.validate();
+ new JaxrsMetamodelValidator().validate(toSet(customerResource.getResource()), project, validationHelper,
+ context, validatorManager, reporter);
// validation
- assertThat(validationMessages.size(), equalTo(2));
+ assertThat(findJaxrsMarkers(customerResource).length, equalTo(0));
}
+ @Test
+ public void shouldReportProblemsOnBarResourceMethods() throws CoreException, ValidationException {
+ // preconditions
+ final IType barJavaType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.BarResource",
+ javaProject);
+ final JaxrsResource barResource = metamodel.getElement(barJavaType, JaxrsResource.class);
+ deleteJaxrsMarkers(barResource);
+ // operation
+ new JaxrsMetamodelValidator().validate(toSet(barResource.getResource()), project, validationHelper, context,
+ validatorManager, reporter);
+ // validation
+ final IMarker[] markers = findJaxrsMarkers(barResource);
+ assertThat(markers.length, equalTo(8));
+ final Map<String, JaxrsResourceMethod> resourceMethods = barResource.getMethods();
+ for (Entry<String, JaxrsResourceMethod> entry : resourceMethods.entrySet()) {
+ final IMarker[] methodMarkers = findJaxrsMarkers(entry.getValue());
+ if (entry.getKey().contains("getContent1")) {
+ assertThat(entry.getValue().hasErrors(), is(true));
+ assertThat(methodMarkers.length, equalTo(1));
+ assertThat(methodMarkers[0].getType(), equalTo(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE));
+ assertThat(methodMarkers[0].getAttribute(ValidationErrorManager.PREFERENCE_KEY_ATTRIBUTE_NAME, ""),
+ equalTo(JaxrsPreferences.RESOURCE_METHOD_UNBOUND_PATH_ANNOTATION_TEMPLATE_PARAMETER));
+ } else if (entry.getKey().contains("getContent2")) {
+ assertThat(entry.getValue().hasErrors(), is(true));
+ assertThat(methodMarkers.length, equalTo(3));
+ } else if (entry.getKey().contains("update1")) {
+ assertThat(entry.getValue().hasErrors(), is(true));
+ assertThat(methodMarkers.length, equalTo(2));
+ } else if (entry.getKey().contains("update2")) {
+ assertThat(entry.getValue().hasErrors(), is(true));
+ assertThat(methodMarkers.length, equalTo(1));
+ } else if (entry.getKey().contains("update3")) {
+ assertThat(entry.getValue().hasErrors(), is(true));
+ assertThat(methodMarkers.length, equalTo(1));
+ } else {
+ fail("Unexpected method " + entry.getKey());
+ }
+ }
+ }
+
+ @Test
+ public void shouldReportProblemsOnBazResourceMethods() throws CoreException, ValidationException {
+ // preconditions
+ final IType barJavaType = WorkbenchUtils.getType("org.jboss.tools.ws.jaxrs.sample.services.BazResource",
+ javaProject);
+ final JaxrsResource barResource = metamodel.getElement(barJavaType, JaxrsResource.class);
+ deleteJaxrsMarkers(barResource);
+ // operation
+ new JaxrsMetamodelValidator().validate(toSet(barResource.getResource()), project, validationHelper, context,
+ validatorManager, reporter);
+ // validation
+ final IMarker[] markers = findJaxrsMarkers(barResource);
+ assertThat(markers.length, equalTo(6));
+ final Map<String, JaxrsResourceMethod> resourceMethods = barResource.getMethods();
+ for (Entry<String, JaxrsResourceMethod> entry : resourceMethods.entrySet()) {
+ final IMarker[] methodMarkers = findJaxrsMarkers(entry.getValue());
+ if (entry.getKey().contains("getContent1")) {
+ assertThat(entry.getValue().hasErrors(), is(true));
+ assertThat(methodMarkers.length, equalTo(1));
+ assertThat(methodMarkers[0].getType(), equalTo(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE));
+ assertThat(methodMarkers[0].getAttribute(ValidationErrorManager.PREFERENCE_KEY_ATTRIBUTE_NAME, ""),
+ equalTo(JaxrsPreferences.RESOURCE_METHOD_UNBOUND_PATH_ANNOTATION_TEMPLATE_PARAMETER));
+ } else if (entry.getKey().contains("getContent2")) {
+ assertThat(entry.getValue().hasErrors(), is(true));
+ assertThat(methodMarkers.length, equalTo(2));
+ } else if (entry.getKey().contains("update1")) {
+ assertThat(entry.getValue().hasErrors(), is(true));
+ assertThat(methodMarkers.length, equalTo(2));
+ } else if (entry.getKey().contains("update2")) {
+ assertThat(entry.getValue().hasErrors(), is(false));
+ assertThat(methodMarkers.length, equalTo(0));
+ } else if (entry.getKey().contains("update3")) {
+ assertThat(entry.getValue().hasErrors(), is(true));
+ assertThat(methodMarkers.length, equalTo(1));
+ } else {
+ fail("Unexpected method " + entry.getKey());
+ }
+ }
+ }
+
+ @Test
+ public void shouldNotWarnIfOneApplicationExists() throws CoreException, ValidationException {
+ // preconditions
+ final List<IJaxrsApplication> applications = metamodel.getAllApplications();
+ for (IJaxrsApplication application : applications) {
+ if (application.getElementKind() == EnumElementKind.APPLICATION_WEBXML) {
+ metamodel.remove((JaxrsBaseElement) application);
+ }
+ }
+ deleteJaxrsMarkers(project);
+ // operation
+ new JaxrsMetamodelValidator().validateAll(project, validationHelper, context, validatorManager, reporter);
+ // validation
+ assertThat(project.findMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, false, 0).length, equalTo(0));
+ }
+
+ @Test
+ public void shouldWarnOnProjectIfNoApplicationExists() throws CoreException, ValidationException {
+ // preconditions
+ final List<IJaxrsApplication> applications = metamodel.getAllApplications();
+ for (IJaxrsApplication application : applications) {
+ metamodel.remove((JaxrsBaseElement) application);
+ }
+ deleteJaxrsMarkers(project);
+ // operation
+ new JaxrsMetamodelValidator().validateAll(project, validationHelper, context, validatorManager, reporter);
+ // validation
+ final IMarker[] projectMarkers = project.findMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, false, 0);
+ assertThat(projectMarkers.length, equalTo(1));
+ }
+
+ @Test
+ public void shouldWarnOnProjectIfMultipleApplicationsExist() throws CoreException, ValidationException {
+ // preconditions
+ final List<IJaxrsApplication> applications = metamodel.getAllApplications();
+ assertThat(applications, hasSize(2));
+ deleteJaxrsMarkers(project);
+ // operation
+ new JaxrsMetamodelValidator().validateAll(project, validationHelper, context, validatorManager, reporter);
+ // validation
+ final IMarker[] projectMarkers = project.findMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, false, 0);
+ assertThat(projectMarkers.length, equalTo(1));
+ }
}
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JaxrsAnnotationScannerTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JaxrsAnnotationScannerTestCase.java 2012-08-24 14:11:54 UTC (rev 43223)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JaxrsAnnotationScannerTestCase.java 2012-08-24 16:20:04 UTC (rev 43224)
@@ -60,7 +60,7 @@
final List<IMethod> resourceMethods = JaxrsAnnotationsScanner.findResourceMethods(javaProject,new ArrayList<IJaxrsHttpMethod>(),
new NullProgressMonitor());
// verifications
- assertThat(resourceMethods.size(), equalTo(14)); // just sub resource methods with @Path annotation
+ assertThat(resourceMethods.size(), equalTo(19)); // just sub resource methods with @Path annotation
}
@Test
12 years, 4 months
JBoss Tools SVN: r43223 - branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-08-24 10:11:54 -0400 (Fri, 24 Aug 2012)
New Revision: 43223
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java
Log:
Added special treatment for Windows.
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java 2012-08-24 13:36:32 UTC (rev 43222)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java 2012-08-24 14:11:54 UTC (rev 43223)
@@ -6,7 +6,6 @@
import java.awt.Robot;
import java.awt.event.KeyEvent;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.jboss.tools.portlet.ui.bot.entity.WorkspaceFile;
import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
import org.jboss.tools.portlet.ui.bot.task.workspace.FileContextMenuSelectingTask;
@@ -28,25 +27,10 @@
@Override
public void perform() {
- System.out.println("*** Shells: ***");
- SWTBotShell activeShell = SWTBotFactory.getBot().activeShell();
- System.out.println("A: " + activeShell.getText());
- for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
- System.out.println(shell.getText());
- }
-
-
performInnerTask(new FileContextMenuSelectingTask(workspaceFile, "Mark as Deployable"));
SWTBotFactory.getBot().waitUntil(shellIsActive("Really mark these resources as deployable?"));
- System.out.println("---------");
- activeShell = SWTBotFactory.getBot().activeShell();
- System.out.println("A: " + activeShell.getText());
- for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
- System.out.println(shell.getText());
- }
-
// for the confirmation dialog select OK (the dialog is native and normal swtbot functions do now work)
try {
Robot robot = new Robot();
12 years, 4 months
JBoss Tools SVN: r43222 - trunk/build/tycho-plugins/repository-utils/src/main/java/org/jboss/tools/tycho/sitegenerator.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-08-24 09:36:32 -0400 (Fri, 24 Aug 2012)
New Revision: 43222
Modified:
trunk/build/tycho-plugins/repository-utils/src/main/java/org/jboss/tools/tycho/sitegenerator/GenerateRepositoryFacadeMojo.java
Log:
JBIDE-11065: Fix plugin to write zipped repo at same path as expected later
Modified: trunk/build/tycho-plugins/repository-utils/src/main/java/org/jboss/tools/tycho/sitegenerator/GenerateRepositoryFacadeMojo.java
===================================================================
--- trunk/build/tycho-plugins/repository-utils/src/main/java/org/jboss/tools/tycho/sitegenerator/GenerateRepositoryFacadeMojo.java 2012-08-24 13:22:27 UTC (rev 43221)
+++ trunk/build/tycho-plugins/repository-utils/src/main/java/org/jboss/tools/tycho/sitegenerator/GenerateRepositoryFacadeMojo.java 2012-08-24 13:36:32 UTC (rev 43222)
@@ -130,7 +130,7 @@
}
- File repoZipFile = new File(project.getBuild().getDirectory(), project.getArtifactId() + ".zip");
+ File repoZipFile = new File(project.getBuild().getDirectory(), project.getArtifactId() + "-" + project.getVersion() + ".zip");
repoZipFile.delete();
try {
ZipArchiver archiver = new ZipArchiver();
12 years, 4 months
JBoss Tools SVN: r43221 - in trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup: internal/identification and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-08-24 09:22:27 -0400 (Fri, 24 Aug 2012)
New Revision: 43221
Added:
trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/AbstractArtifactIdentifier.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/NexusRepository.java
trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/FileIdentificationManager.java
trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/MavenPropertiesIdentifier.java
trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/NexusIndexIdentifier.java
trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/NexusRepositoryIdentifier.java
Log:
JBIDE-8973 : don't discard identified file if sources are missing
Modified: trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/NexusRepository.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/NexusRepository.java 2012-08-24 13:15:06 UTC (rev 43220)
+++ trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/NexusRepository.java 2012-08-24 13:22:27 UTC (rev 43221)
@@ -10,6 +10,12 @@
************************************************************************************/
package org.jboss.tools.maven.sourcelookup;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import org.eclipse.core.runtime.Assert;
+
+
/**
*
* @author snjeza
@@ -20,7 +26,8 @@
private String url;
private boolean enabled;
-
+ private static final String PATH_SEPARATOR = "/";
+
public NexusRepository() {
super();
}
@@ -61,4 +68,44 @@
return "NexusRepository [name=" + name + ", url=" + url + ", enabled="
+ enabled + "]";
}
+
+ public String getSearchUrl(String sha1) throws UnsupportedEncodingException {
+ // "https://repository.jboss.org/nexus/service/local/data_index?sha1=";
+ Assert.isNotNull(sha1);
+ StringBuilder searchUrl = getBaseUrl()
+ .append("service/local/data_index?sha1=")
+ .append(URLEncoder.encode(sha1, "UTF-8"));
+ return searchUrl.toString();
+ }
+
+ public String getSearchUrl(String groupId, String artifactId, String version, String classifier) throws UnsupportedEncodingException {
+ Assert.isNotNull(artifactId);
+ StringBuilder searchUrl = getBaseUrl().append("service/local/data_index?");
+ searchUrl.append("a=").append(URLEncoder.encode(artifactId, "UTF-8")).append("&");
+ if (groupId != null) {
+ searchUrl.append("g=").append(URLEncoder.encode(groupId, "UTF-8")).append("&");
+ }
+ if (version != null) {
+ searchUrl.append("v=").append(URLEncoder.encode(version, "UTF-8")).append("&");
+ }
+ if (classifier != null) {
+ searchUrl.append("c=").append(URLEncoder.encode(classifier, "UTF-8"));
+ }
+ return searchUrl.toString();
+ }
+
+ private StringBuilder getBaseUrl() {
+ StringBuilder sb = new StringBuilder();
+ String base = getUrl();
+ sb.append(base);
+ if (!base.endsWith(PATH_SEPARATOR)) {
+ sb.append(PATH_SEPARATOR);
+ }
+ return sb;
+ }
+
+
+
+
+
}
Added: trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/AbstractArtifactIdentifier.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/AbstractArtifactIdentifier.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/AbstractArtifactIdentifier.java 2012-08-24 13:22:27 UTC (rev 43221)
@@ -0,0 +1,40 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.sourcelookup.internal.identification;
+
+import org.jboss.tools.maven.sourcelookup.identification.ArtifactIdentifier;
+
+abstract class AbstractArtifactIdentifier implements ArtifactIdentifier {
+
+ private String name;
+
+ AbstractArtifactIdentifier() {
+ }
+
+ AbstractArtifactIdentifier(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ if (name == null) {
+ name = getClass().getSimpleName();
+ }
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String toString() {
+ return (name == null)? super.toString():name;
+ }
+}
Modified: trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/FileIdentificationManager.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/FileIdentificationManager.java 2012-08-24 13:15:06 UTC (rev 43220)
+++ trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/FileIdentificationManager.java 2012-08-24 13:22:27 UTC (rev 43221)
@@ -14,8 +14,10 @@
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.jboss.tools.maven.sourcelookup.identification.ArtifactIdentifier;
import org.jboss.tools.maven.sourcelookup.identification.IFileIdentificationManager;
@@ -33,30 +35,60 @@
initArtifactIdentifiers();
}
- private void initArtifactIdentifiers() {
+ protected void initArtifactIdentifiers() {
//TODO read from extension points?
- artifactIdentifiers = new ArrayList<ArtifactIdentifier>(3);
- artifactIdentifiers.add(new MavenPropertiesIdentifier());
- artifactIdentifiers.add(new NexusIndexIdentifier());
- artifactIdentifiers.add(new NexusRepositoryIdentifier());
+ addArtifactIdentifier(new MavenPropertiesIdentifier());
+ addArtifactIdentifier(new NexusIndexIdentifier());
+ addArtifactIdentifier(new NexusRepositoryIdentifier());
}
+ public synchronized void addArtifactIdentifier(ArtifactIdentifier identifier) {
+ Assert.isNotNull(identifier, "Artifact identifier can not be null");
+ if (artifactIdentifiers == null) {
+ artifactIdentifiers = new ArrayList<ArtifactIdentifier>();
+ }
+ artifactIdentifiers.add(identifier);
+ //System.err.println("Added "+ identifier);
+ }
+
+ public synchronized void removeArtifactIdentifier(ArtifactIdentifier identifier) {
+ if (identifier != null) {
+ getArtifactIdentifiers().remove(identifier);
+ }
+ }
+
+ protected List<ArtifactIdentifier> getArtifactIdentifiers() {
+ if (artifactIdentifiers == null) {
+ initArtifactIdentifiers();
+ }
+ return artifactIdentifiers;
+ }
+
@Override
public ArtifactKey identify(File file, IProgressMonitor monitor) throws CoreException {
+ if (file == null) {
+ return null;
+ }
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
ArtifactKey artifactKey = null;
- long start = System.currentTimeMillis();
+ //long start = System.currentTimeMillis();
for (ArtifactIdentifier identifier : artifactIdentifiers) {
if (monitor.isCanceled()) {
return null;
}
artifactKey = identifier.identify(file);
if (artifactKey != null) {
- long stop = System.currentTimeMillis();
- System.err.println(file.getName() + " identified as " + artifactKey + " in " + (stop-start) + " ms");
+ //long stop = System.currentTimeMillis();
+ //System.err.println(file.getName() + " identified as " + artifactKey + " in " + (stop-start) + " ms");
break;
}
}
+ //if (artifactKey == null)
+ //System.err.println("Could not identify "+file);
return artifactKey;
}
+
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/MavenPropertiesIdentifier.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/MavenPropertiesIdentifier.java 2012-08-24 13:15:06 UTC (rev 43220)
+++ trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/MavenPropertiesIdentifier.java 2012-08-24 13:22:27 UTC (rev 43221)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.maven.sourcelookup.internal.identification;
import java.io.File;
@@ -10,27 +20,25 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.jboss.tools.maven.sourcelookup.identification.ArtifactIdentifier;
-public class MavenPropertiesIdentifier implements ArtifactIdentifier {
+public class MavenPropertiesIdentifier extends AbstractArtifactIdentifier {
+ public MavenPropertiesIdentifier() {
+ super("Maven Properties identifier");
+ }
+
@Override
public ArtifactKey identify(File file) throws CoreException {
ZipFile jar;
try {
-// try {
-// Random r = new Random();
-// Thread.sleep(r.nextInt(10)*1000);
-// } catch (InterruptedException e) {
-// }
jar = new ZipFile(file);
return getArtifactFromMetaInf(jar);
} catch (ZipException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
+ //System.err.println(getName() + " could not identify "+file);
return null;
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/NexusIndexIdentifier.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/NexusIndexIdentifier.java 2012-08-24 13:15:06 UTC (rev 43220)
+++ trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/NexusIndexIdentifier.java 2012-08-24 13:22:27 UTC (rev 43221)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.maven.sourcelookup.internal.identification;
import java.io.File;
@@ -14,14 +24,14 @@
import org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager;
import org.eclipse.m2e.core.repository.IRepository;
import org.eclipse.m2e.core.repository.IRepositoryRegistry;
-import org.jboss.tools.maven.sourcelookup.identification.ArtifactIdentifier;
@SuppressWarnings("restriction")
-public class NexusIndexIdentifier implements ArtifactIdentifier {
+public class NexusIndexIdentifier extends AbstractArtifactIdentifier {
private List<IRepository> globalRepositories;
-
+
public NexusIndexIdentifier() {
+ super("Nexus Index identifier");
globalRepositories = initGlobalRepositories();
}
@@ -61,6 +71,7 @@
}
}
}
+ //System.err.println(getName() + " could not identify "+file);
return artifact;
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/NexusRepositoryIdentifier.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/NexusRepositoryIdentifier.java 2012-08-24 13:15:06 UTC (rev 43220)
+++ trunk/maven/plugins/org.jboss.tools.maven.sourcelookup.core/src/org/jboss/tools/maven/sourcelookup/internal/identification/NexusRepositoryIdentifier.java 2012-08-24 13:22:27 UTC (rev 43221)
@@ -1,12 +1,21 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.maven.sourcelookup.internal.identification;
import static org.jboss.tools.maven.sourcelookup.identification.IdentificationUtil.getSHA1;
-import static org.jboss.tools.maven.sourcelookup.identification.IdentificationUtil.getSourcesClassifier;
import java.io.File;
+import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
-import java.net.URLEncoder;
import java.util.Set;
import javax.xml.bind.JAXBContext;
@@ -16,20 +25,21 @@
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.jboss.tools.maven.sourcelookup.NexusRepository;
import org.jboss.tools.maven.sourcelookup.SourceLookupActivator;
-import org.jboss.tools.maven.sourcelookup.identification.ArtifactIdentifier;
import org.sonatype.nexus.rest.model.NexusArtifact;
import org.sonatype.nexus.rest.model.SearchResponse;
-public class NexusRepositoryIdentifier implements ArtifactIdentifier {
+public class NexusRepositoryIdentifier extends AbstractArtifactIdentifier {
- private static final String PATH_SEPARATOR = "/";
-
+ public NexusRepositoryIdentifier() {
+ super("Nexus repository identifier");
+ }
+
@Override
public ArtifactKey identify(File file) throws CoreException {
return getArtifactFromRemoteNexusRepository(file);
}
- private static ArtifactKey getArtifactFromRemoteNexusRepository(File file) {
+ private ArtifactKey getArtifactFromRemoteNexusRepository(File file) {
String sha1;
try {
sha1 = getSHA1(file);
@@ -42,55 +52,52 @@
if (!repository.isEnabled()) {
continue;
}
- ArtifactKey key = getArtifactFromRemoteNexusRepository(sha1, repository);
- if (key != null) {
- ArtifactKey sourcesArtifact = new ArtifactKey(
- key.getGroupId(), key.getArtifactId(),
- key.getVersion(),
- getSourcesClassifier(key.getClassifier()));
- ArtifactKey resolvedKey = getSourcesArtifactFromJBossNexusRepository(sourcesArtifact, repository);
- if (resolvedKey != null) {
+ try {
+ ArtifactKey key = searchArtifactFromRemoteNexusRepository(repository.getSearchUrl(sha1));
+ if (key != null) {
+ /*
+ Searching for sources here makes no sense here :
+ ex : guice.jar (from seam 2.3) is found in jboss nexus via a SHA1 search but subsequent search
+ of its sources on this repo returns null => guice.jar can never be identified in that case!
+ Source resolution / Missing sources should be dealt upstream from here
+
+ String searchSourcesUrl = repository.getSearchUrl(key.getArtifactId(),
+ key.getGroupId(),
+ key.getVersion(),
+ getSourcesClassifier(key.getClassifier()));
+
+ ArtifactKey resolvedKey = searchArtifactFromRemoteNexusRepository(searchSourcesUrl);
+
+ if (resolvedKey != null) {
+ return key;
+ }
+ */
return key;
}
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
}
}
+ System.err.println(getName()+ "Couldn't find match for SHA1="+sha1);
return null;
}
- private static ArtifactKey getArtifactFromRemoteNexusRepository(String sha1,
- NexusRepository nexusRepository) {
- if (sha1 == null || nexusRepository == null || nexusRepository.getUrl() == null) {
+ private static ArtifactKey searchArtifactFromRemoteNexusRepository(String searchUrl) {
+ if (searchUrl == null) {
return null;
}
- HttpURLConnection connection = null;
+ HttpURLConnection connection = null;//TODO use eclipse connections to handle proxies
try {
- String base = nexusRepository.getUrl();
- if (!base.endsWith(PATH_SEPARATOR)) {
- base = base + PATH_SEPARATOR;
- }
- // String url =
- // "https://repository.jboss.org/nexus/service/local/data_index?sha1=";
- String url = base + "service/local/data_index?sha1=";
- url = url + URLEncoder.encode(sha1, "UTF-8");
JAXBContext context = JAXBContext.newInstance(SearchResponse.class);
Unmarshaller unmarshaller = context.createUnmarshaller();
- connection = (HttpURLConnection) new URL(url).openConnection();
+ connection = (HttpURLConnection) new URL(searchUrl).openConnection();
connection.connect();
Object object = unmarshaller.unmarshal(connection.getInputStream());
if (object instanceof SearchResponse) {
- SearchResponse searchResponse = (SearchResponse) object;
- for (NexusArtifact nexusArtifact : searchResponse.getData()) {
- String groupId = nexusArtifact.getGroupId();
- String artifactId = nexusArtifact.getArtifactId();
- String version = nexusArtifact.getVersion();
- String classifier = nexusArtifact.getClassifier();
- ArtifactKey artifact = new ArtifactKey(groupId, artifactId,
- version, classifier);
- return artifact;
- }
+ return extractArtifactKey((SearchResponse)object);
}
} catch (Exception e) {
- return null;
+ e.printStackTrace();
} finally {
if (connection != null) {
connection.disconnect();
@@ -99,49 +106,16 @@
return null;
}
- private static ArtifactKey getSourcesArtifactFromJBossNexusRepository(ArtifactKey key,
- NexusRepository nexusRepository) {
- if (key == null || nexusRepository == null
- || nexusRepository.getUrl() == null) {
- return null;
+ private static ArtifactKey extractArtifactKey(SearchResponse searchResponse) {
+ for (NexusArtifact nexusArtifact : searchResponse.getData()) {
+ String groupId = nexusArtifact.getGroupId();
+ String artifactId = nexusArtifact.getArtifactId();
+ String version = nexusArtifact.getVersion();
+ String classifier = nexusArtifact.getClassifier();
+ ArtifactKey artifact = new ArtifactKey(groupId, artifactId,
+ version, classifier);
+ return artifact;
}
- HttpURLConnection connection = null;
- try {
- String base = nexusRepository.getUrl();
- if (!base.endsWith(PATH_SEPARATOR)) {
- base = base + PATH_SEPARATOR;
- }
- // String url =
- // "https://repository.jboss.org/nexus/service/local/data_index?g=groupId&a=a...";
- String url = base + "service/local/data_index?";
- url= url + "g=" + URLEncoder.encode(key.getGroupId(), "UTF-8") + "&";
- url= url + "a=" + URLEncoder.encode(key.getArtifactId(), "UTF-8") + "&";
- url= url + "v=" + URLEncoder.encode(key.getVersion(), "UTF-8") + "&";
- url= url + "c=" + URLEncoder.encode(key.getClassifier(), "UTF-8");
- JAXBContext context = JAXBContext.newInstance(SearchResponse.class);
- Unmarshaller unmarshaller = context.createUnmarshaller();
- connection = (HttpURLConnection) new URL(url).openConnection();
- connection.connect();
- Object object = unmarshaller.unmarshal(connection.getInputStream());
- if (object instanceof SearchResponse) {
- SearchResponse searchResponse = (SearchResponse) object;
- for (NexusArtifact nexusArtifact : searchResponse.getData()) {
- String groupId = nexusArtifact.getGroupId();
- String artifactId = nexusArtifact.getArtifactId();
- String version = nexusArtifact.getVersion();
- String classifier = nexusArtifact.getClassifier();
- ArtifactKey artifact = new ArtifactKey(groupId, artifactId,
- version, classifier);
- return artifact;
- }
- }
- } catch (Exception e) {
- return null;
- } finally {
- if (connection != null) {
- connection.disconnect();
- }
- }
return null;
}
12 years, 4 months
JBoss Tools SVN: r43220 - trunk/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-08-24 09:15:06 -0400 (Fri, 24 Aug 2012)
New Revision: 43220
Added:
trunk/build/aggregate/site/index.html
trunk/build/aggregate/site/jbosstools-directory.xml
trunk/build/aggregate/site/site.xml
Removed:
trunk/build/aggregate/site/category.xml
Modified:
trunk/build/aggregate/site/pom.xml
Log:
JBIDE-11065: Revert changes since build.xml requires way more effort before being ready
Deleted: trunk/build/aggregate/site/category.xml
===================================================================
--- trunk/build/aggregate/site/category.xml 2012-08-24 12:56:23 UTC (rev 43219)
+++ trunk/build/aggregate/site/category.xml 2012-08-24 13:15:06 UTC (rev 43220)
@@ -1,457 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<site>
- <description>JBoss Tools 3.4 (Juno) Updates - Core</description>
-
- <!-- PLEASE NOTE!
- When updating this file, please be sure that it parses as valid XML before committing it.
- To test, just run `mvn clean install` in this folder.
- -->
-
- <!-- only in JBDS
- <feature url="features/com.jboss.jbds.product.feature_0.0.0.jar" id="com.jboss.jbds.product.feature" version="0.0.0" patch="false">
- <category name="AbridgedTools" />
- </feature>
- <feature url="features/com.jboss.jbds.central.discovery.feature_0.0.0.jar" id="com.jboss.jbds.central.discovery.feature" version="0.0.0">
- </feature>
- -->
-
- <feature url="features/org.jboss.tools.central.feature_0.0.0.jar" id="org.jboss.tools.central.feature" version="0.0.0">
- </feature>
- <!-- only in JBT -->
- <feature url="features/org.jboss.tools.community.central.feature_0.0.0.jar" id="org.jboss.tools.community.central.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="GeneralTools" />
- </feature>
- <feature url="features/org.jboss.tools.central.discovery.feature_0.0.0.jar" id="org.jboss.tools.central.discovery.feature" version="0.0.0">
- </feature>
- <feature url="features/org.jboss.tools.richfaces.feature_0.0.0.jar" id="org.jboss.tools.richfaces.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.vpe.browsersim.feature_0.0.0.jar" id="org.jboss.tools.vpe.browsersim.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.jst.feature_0.0.0.jar" id="org.jboss.tools.jst.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.vpe.feature_0.0.0.jar" id="org.jboss.tools.vpe.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.jsf.feature_0.0.0.jar" id="org.jboss.tools.jsf.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
- <!-- include but do not categorize -->
- <feature url="features/org.jboss.tools.xulrunner.feature_0.0.0.jar" id="org.jboss.tools.xulrunner.feature" version="0.0.0">
- </feature>
- <feature url="features/org.mozilla.xulrunner.feature_0.0.0.jar" id="org.mozilla.xulrunner.feature" version="0.0.0">
- </feature>
-
- <feature url="features/org.jboss.tools.seam.feature_0.0.0.jar" id="org.jboss.tools.seam.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.cdi.feature_0.0.0.jar" id="org.jboss.tools.cdi.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- <category name="GeneralTools" />
- </feature>
- <feature url="features/org.jboss.tools.cdi.seam.feature_0.0.0.jar" id="org.jboss.tools.cdi.seam.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- <category name="GeneralTools" />
- </feature>
- <feature url="features/org.jboss.tools.cdi.deltaspike.feature_0.0.0.jar" id="org.jboss.tools.cdi.deltaspike.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- <category name="GeneralTools" />
- </feature>
- <feature url="features/org.jboss.tools.jmx.feature_0.0.0.jar" id="org.jboss.tools.jmx.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="GeneralTools" />
- </feature>
- <feature url="features/org.jboss.ide.eclipse.as.feature_0.0.0.jar" id="org.jboss.ide.eclipse.as.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.openshift.express.feature_0.0.0.jar" id="org.jboss.tools.openshift.express.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="CloudTools" />
- </feature>
- <feature url="features/org.jboss.tools.openshift.egit.integration.feature_0.0.0.jar" id="org.jboss.tools.openshift.egit.integration.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="CloudTools" />
- </feature>
- <!-- only in JBDS
- <feature url="features/org.eclipse.egit_0.0.0.jar" id="org.eclipse.egit" version="0.0.0">
- </feature>
- <feature url="features/org.eclipse.jgit_0.0.0.jar" id="org.eclipse.jgit" version="0.0.0">
- </feature>
- -->
- <feature url="features/org.jboss.ide.eclipse.archives.feature_0.0.0.jar" id="org.jboss.ide.eclipse.archives.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="GeneralTools" />
- </feature>
- <feature url="features/org.hibernate.eclipse.feature_0.0.0.jar" id="org.hibernate.eclipse.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- <category name="DataTools" />
- <category name="GeneralTools" />
- </feature>
- <feature url="features/org.jboss.ide.eclipse.freemarker.feature_0.0.0.jar" id="org.jboss.ide.eclipse.freemarker.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="GeneralTools" />
- </feature>
- <feature url="features/org.jboss.tools.struts.feature_0.0.0.jar" id="org.jboss.tools.struts.feature" version="0.0.0">
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.ws.feature_0.0.0.jar" id="org.jboss.tools.ws.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.ws.jaxrs.feature_0.0.0.jar" id="org.jboss.tools.ws.jaxrs.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.portlet.feature_0.0.0.jar" id="org.jboss.tools.portlet.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.forge.feature_0.0.0.jar" id="org.jboss.tools.forge.feature" version="0.0.0">
- <category name="AbridgedTools"/>
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.project.examples.feature_0.0.0.jar" id="org.jboss.tools.project.examples.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="GeneralTools" />
- </feature>
-
- <!-- only in JBT -->
- <feature url="features/org.jboss.tools.community.project.examples.feature_0.0.0.jar" id="org.jboss.tools.community.project.examples.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="GeneralTools" />
- </feature>
- <feature url="features/org.jboss.tools.birt.feature_0.0.0.jar" id="org.jboss.tools.birt.feature" version="0.0.0">
- <category name="ReportTools" />
- </feature>
-
- <!-- only in JBDS
- <feature url="features/com.jboss.jbds.m2e.feature_0.0.0.jar" id="com.jboss.jbds.m2e.feature" version="0.0.0">
- <category name="AbridgedTools"/>
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.eclipse.m2e.feature_0.0.0.jar" id="org.eclipse.m2e.feature" version="0.0.0">
- </feature>
- <feature url="features/org.maven.ide.eclipse.wtp.feature_0.0.0.jar" id="org.maven.ide.eclipse.wtp.feature" version="0.0.0">
- </feature>
- <feature url="features/org.sonatype.m2e.mavenarchiver.feature_0.0.0.jar" id="org.sonatype.m2e.mavenarchiver.feature" version="0.0.0">
- </feature>
- -->
- <feature url="features/org.jboss.tools.maven.feature_0.0.0.jar" id="org.jboss.tools.maven.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.jboss.tools.maven.cdi.feature_0.0.0.jar" id="org.jboss.tools.maven.cdi.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.jboss.tools.maven.hibernate.feature_0.0.0.jar" id="org.jboss.tools.maven.hibernate.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.jboss.tools.maven.jaxrs.feature_0.0.0.jar" id="org.jboss.tools.maven.jaxrs.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.jboss.tools.maven.jdt.feature_0.0.0.jar" id="org.jboss.tools.maven.jdt.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.jboss.tools.maven.jpa.feature_0.0.0.jar" id="org.jboss.tools.maven.jpa.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.jboss.tools.maven.jsf.feature_0.0.0.jar" id="org.jboss.tools.maven.jsf.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.jboss.tools.maven.portlet.feature_0.0.0.jar" id="org.jboss.tools.maven.portlet.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.jboss.tools.maven.profiles.feature_0.0.0.jar" id="org.jboss.tools.maven.profiles.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.jboss.tools.maven.project.examples.feature_0.0.0.jar" id="org.jboss.tools.maven.project.examples.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.jboss.tools.maven.seam.feature_0.0.0.jar" id="org.jboss.tools.maven.seam.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools"/>
- </feature>
- <feature url="features/org.jboss.tools.maven.sourcelookup.feature_0.0.0.jar" id="org.jboss.tools.maven.sourcelookup.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <!-- only in JBT and JBDS Extras -->
- <feature url="features/org.jboss.tools.maven.jbosspackaging.feature_0.0.0.jar" id="org.jboss.tools.maven.jbosspackaging.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="MavenTools" />
- </feature>
- <feature url="features/org.jboss.tools.maven.gwt.feature_0.0.0.jar" id="org.jboss.tools.maven.gwt.feature" version="0.0.0">
- <category name="MavenTools" />
- </feature>
- <!-- only in JBT -->
- <feature url="features/org.jboss.tools.gwt.feature_0.0.0.jar" id="org.jboss.tools.gwt.feature" version="0.0.0">
- <category name="GeneralTools" />
- </feature>
- <feature url="features/org.jboss.tools.common.mylyn.feature_0.0.0.jar" id="org.jboss.tools.common.mylyn.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="GeneralTools"/>
- </feature>
-
- <feature url="features/org.jboss.tools.common.jdt.feature_0.0.0.jar" id="org.jboss.tools.common.jdt.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="GeneralTools"/>
- </feature>
-
- <!-- include but do not categorize -->
- <feature url="features/org.jboss.tools.common.feature_0.0.0.jar" id="org.jboss.tools.common.feature" version="0.0.0">
- </feature>
- <feature url="features/org.jboss.tools.common.core.feature_0.0.0.jar" id="org.jboss.tools.common.core.feature" version="0.0.0">
- </feature>
- <feature url="features/org.jboss.tools.common.text.ext.feature_0.0.0.jar" id="org.jboss.tools.common.text.ext.feature" version="0.0.0">
- </feature>
- <feature url="features/org.jboss.tools.common.ui.feature_0.0.0.jar" id="org.jboss.tools.common.ui.feature" version="0.0.0">
- </feature>
- <feature url="features/org.jboss.tools.common.verification.feature_0.0.0.jar" id="org.jboss.tools.common.verification.feature" version="0.0.0">
- </feature>
-
- <feature url="features/org.jboss.tools.runtime.core.feature_0.0.0.jar" id="org.jboss.tools.runtime.core.feature" version="0.0.0">
- <category name="AbridgedTools" />
- </feature>
- <feature url="features/org.jboss.tools.runtime.as.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.as.detector.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
- <feature url="features/org.jboss.tools.runtime.seam.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.seam.detector.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="WebTools" />
- </feature>
-
- <feature url="features/org.jboss.tools.usage.feature_0.0.0.jar" id="org.jboss.tools.usage.feature" version="0.0.0">
- <category name="AbridgedTools" />
- <category name="GeneralTools"/>
- </feature>
-
-
- <!-- ####### -->
- <!-- SOURCES -->
- <!-- ####### -->
- <feature url="features/org.jboss.tools.central.feature.source_0.0.0.jar" id="org.jboss.tools.central.feature.source" version="0.0.0">
- </feature>
- <feature url="features/org.jboss.tools.community.central.feature.source_0.0.0.jar" id="org.jboss.tools.community.central.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.central.discovery.feature.source_0.0.0.jar" id="org.jboss.tools.central.discovery.feature.source" version="0.0.0">
- </feature>
- <feature url="features/org.jboss.tools.richfaces.feature.source_0.0.0.jar" id="org.jboss.tools.richfaces.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.vpe.browsersim.feature.source_0.0.0.jar" id="org.jboss.tools.vpe.browsersim.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.jst.feature.source_0.0.0.jar" id="org.jboss.tools.jst.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.vpe.feature.source_0.0.0.jar" id="org.jboss.tools.vpe.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.jsf.feature.source_0.0.0.jar" id="org.jboss.tools.jsf.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <!-- include but do not categorize -->
- <feature url="features/org.jboss.tools.xulrunner.feature.source_0.0.0.jar" id="org.jboss.tools.xulrunner.feature.source" version="0.0.0">
- </feature>
- <feature url="features/org.mozilla.xulrunner.feature.source_0.0.0.jar" id="org.mozilla.xulrunner.feature.source" version="0.0.0">
- </feature>
-
- <feature url="features/org.jboss.tools.seam.feature.source_0.0.0.jar" id="org.jboss.tools.seam.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.cdi.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.cdi.seam.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.seam.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.cdi.deltaspike.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.deltaspike.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.jmx.feature.source_0.0.0.jar" id="org.jboss.tools.jmx.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.ide.eclipse.as.feature.source_0.0.0.jar" id="org.jboss.ide.eclipse.as.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.openshift.express.feature.source_0.0.0.jar" id="org.jboss.tools.openshift.express.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.openshift.egit.integration.feature.source_0.0.0.jar" id="org.jboss.tools.openshift.egit.integration.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.ide.eclipse.archives.feature.source_0.0.0.jar" id="org.jboss.ide.eclipse.archives.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.hibernate.eclipse.feature.source_0.0.0.jar" id="org.hibernate.eclipse.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.ide.eclipse.freemarker.feature.source_0.0.0.jar" id="org.jboss.ide.eclipse.freemarker.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.struts.feature.source_0.0.0.jar" id="org.jboss.tools.struts.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.ws.feature.source_0.0.0.jar" id="org.jboss.tools.ws.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.ws.jaxrs.feature.source_0.0.0.jar" id="org.jboss.tools.ws.jaxrs.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.portlet.feature.source_0.0.0.jar" id="org.jboss.tools.portlet.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.forge.feature.source_0.0.0.jar" id="org.jboss.tools.forge.feature.source" version="0.0.0">
- <category name="AllSources"/>
- </feature>
- <feature url="features/org.jboss.tools.project.examples.feature.source_0.0.0.jar" id="org.jboss.tools.project.examples.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.community.project.examples.feature.source_0.0.0.jar" id="org.jboss.tools.community.project.examples.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.birt.feature.source_0.0.0.jar" id="org.jboss.tools.birt.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.feature.source_0.0.0.jar" id="org.jboss.tools.maven.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.cdi.feature.source_0.0.0.jar" id="org.jboss.tools.maven.cdi.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.hibernate.feature.source_0.0.0.jar" id="org.jboss.tools.maven.hibernate.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.jsf.feature.source_0.0.0.jar" id="org.jboss.tools.maven.jsf.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.portlet.feature.source_0.0.0.jar" id="org.jboss.tools.maven.portlet.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.seam.feature.source_0.0.0.jar" id="org.jboss.tools.maven.seam.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.project.examples.feature.source_0.0.0.jar" id="org.jboss.tools.maven.project.examples.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.jaxrs.feature.source_0.0.0.jar" id="org.jboss.tools.maven.jaxrs.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.jpa.feature.source_0.0.0.jar" id="org.jboss.tools.maven.jpa.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.jdt.feature.source_0.0.0.jar" id="org.jboss.tools.maven.jdt.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.profiles.feature.source_0.0.0.jar" id="org.jboss.tools.maven.profiles.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.sourcelookup.feature.source_0.0.0.jar" id="org.jboss.tools.maven.sourcelookup.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.runtime.core.featur.source_0.0.0.jar" id="org.jboss.tools.runtime.core.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.runtime.as.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.as.detector.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.runtime.seam.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.seam.detector.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.usage.feature.source_0.0.0.jar" id="org.jboss.tools.usage.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <!-- only in JBT and JBDS Extras -->
- <feature url="features/org.jboss.tools.maven.jbosspackaging.feature.source_0.0.0.jar" id="org.jboss.tools.maven.jbosspackaging.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.maven.gwt.feature.source_0.0.0.jar" id="org.jboss.tools.maven.gwt.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <!-- only in JBT -->
- <feature url="features/org.jboss.tools.gwt.feature.source_0.0.0.jar" id="org.jboss.tools.gwt.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.common.mylyn.feature.source_0.0.0.jar" id="org.jboss.tools.common.mylyn.feature.source" version="0.0.0">
- <category name="AllSources"/>
- </feature>
- <feature url="features/org.jboss.tools.common.jdt.feature.source_0.0.0.jar" id="org.jboss.tools.common.jdt.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.common.feature.source_0.0.0.jar" id="org.jboss.tools.common.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <!-- Not categorize -->
- <feature url="features/org.jboss.tools.common.core.feature.source_0.0.0.jar" id="org.jboss.tools.common.core.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.common.text.ext.feature.source_0.0.0.jar" id="org.jboss.tools.common.text.ext.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.common.ui.feature.source_0.0.0.jar" id="org.jboss.tools.common.ui.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
- <feature url="features/org.jboss.tools.common.verification.feature.source_0.0.0.jar" id="org.jboss.tools.common.verification.feature.source" version="0.0.0">
- <category name="AllSources" />
- </feature>
-
- <!-- ########## -->
- <!-- CATEGORIES -->
- <!-- ########## -->
- <category-def name="AbridgedTools" label="Abridged JBoss Tools 3.4">
- <description>Contains most of the JBoss Tools features. Excluded are those related to integration with 3rd party plugins. Selecting this category will give you all tools needed for Web and Seam Development.</description>
- </category-def>
-
- <category-def name="WebTools" label="JBoss Web and Java EE Development">
- <description>Tools to help create web and enterprise applications, using JSF, Facelets, Seam, Hibernate/JPA, CSS, Webservices and more.</description>
- </category-def>
-
- <category-def name="GeneralTools" label="JBoss Application Development">
- <description>Tools for general application development.</description>
- </category-def>
-
- <category-def name="DataTools" label="JBoss Data Services">
- <description>Tools related to data services such as persistence and transformation.</description>
- </category-def>
-
- <category-def name="MavenTools" label="JBoss Maven Support">
- <description>Plugins related to Maven and m2eclipse support. Use these to enable use of Maven.</description>
- </category-def>
- <category-def name="CloudTools" label="JBoss Cloud Development Tools">
- <description>Tools for Cloud Development.</description>
- </category-def>
- <!-- Only in JBT -->
- <category-def name="ReportTools" label="JBoss Business Intelligence, Reporting and Charting">
- <description>Business Intelligence, Reporting and Charting. Use these if you plan to integrate Hibernate or Seam with Eclipse BIRT.</description>
- </category-def>
-
- <category-def name="AllSources" label="Sources">
- <description>Source code for JBoss Tools features.</description>
- </category-def>
-
-</site>
Added: trunk/build/aggregate/site/index.html
===================================================================
--- trunk/build/aggregate/site/index.html (rev 0)
+++ trunk/build/aggregate/site/index.html 2012-08-24 13:15:06 UTC (rev 43220)
@@ -0,0 +1,1800 @@
+<html>
+<head>
+<title>JBoss Tools - Core - Nightly Build Update Site</title>
+<style>
+@import url("http://download.jboss.org/jbosstools/updates/web/site.css");
+</style>
+</head>
+<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
+<center>
+<table marginheight="0" marginwidth="0" leftmargin="0" topmargin="0"
+ cellspacing="0" cellpadding="0" width="920" class="bodyText">
+ <tr>
+ <td colspan="3"><img
+ src="https://www.jboss.org/dms/tools/images/tools-banner.png" /></td>
+ </tr>
+ <tr>
+ <td>      </td>
+ <td>      </td>
+ <td>      </td>
+ </tr>
+ <tr>
+ <td>      </td>
+ <td>
+ <h2 class="title">JBoss Tools - Core - Nightly Build Update Site</h2>
+ <table width="100%">
+ <tr class="header">
+ <td class="sub-header" width="100%"><span>Latest Build</span></td>
+ </tr>
+
+ <tr class="light-row" style="height: 30px">
+ <td class="bodyText">
+ <p class="bodyText">This is the <b>Nightly Build</b>
+ Update Site for JBoss Tools - Core.
+ <blockquote style="border: 1px dashed #1778be; padding: 2px">
+ <ol>
+ <li>To <a class="link"
+ href="http://www.jboss.org/tools/download/installation/update_3_3">install</a>
+ from this site, start up Eclipse 3.7, then do:
+ <ul>
+ <code><strong>Help > Install New Software... ></strong></code>
+ </ul>
+ </li>
+ <li>Copy this site's URL into Eclipse, and hit Enter.</li>
+ <li>When the site loads, select the features to install,
+ or click the <code><strong>Select All</strong></code> button.</li>
+ <li>To properly resolve all dependencies, check
+ <ul><code><strong>[x] Contact all update sites during install to find required software</strong></code></ul>
+
+ <li>Click <code><strong>Next</strong></code>, agree to the license
+ terms, and install.</li>
+
+ <p class="bodyText">
+ You can also download JBoss Tools as individual zips for
+ offline installation. See <a class="link"
+ href="http://www.jboss.org/tools/download">JBoss Tools
+ Downloads</a>.<br /> If you downloaded this site as a zip, see
+ <a href="README.installation.txt">Installation README</a>.
+ See also <a
+ href="http://www.jboss.org/tools/download/installation">Installation
+ methods</a>.
+ </p>
+ </ol>
+ </blockquote>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td>      </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>
+ <table xmlns="http://www.w3.org/1999/xhtml" xmlns:xalan="http://xml.apache.org/xalan" border="0" cellpadding="0" cellspacing="2">
+<tr style="background-color:#DDDDDD">
+<th style="font-size:small">Feature</th>
+<th style="font-size:small">Version</th>
+<th style="font-size:small">
+ Feature Categor(ies)
+ </th>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.archives.feature_3.2.1.v20120501-2007-H882-CR1.jar">org.jboss.ide.eclipse.archives.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.2.1.v20120501-2007-H882-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.archives.feature.source_3.2.1.v20120501-2007-H882-CR1.jar">org.jboss.ide.eclipse.archives.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.2.1.v20120501-2007-H882-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.as.feature_2.3.0.v20120501-2033-H1291-CR1.jar">org.jboss.ide.eclipse.as.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">2.3.0.v20120501-2033-H1291-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.as.feature.source_2.3.0.v20120501-2033-H1291-CR1.jar">org.jboss.ide.eclipse.as.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">2.3.0.v20120501-2033-H1291-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.freemarker.feature_1.2.0.v20120501-2008-H885-CR1.jar">org.jboss.ide.eclipse.freemarker.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120501-2008-H885-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.ide.eclipse.freemarker.feature.source_1.2.0.v20120501-2008-H885-CR1.jar">org.jboss.ide.eclipse.freemarker.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120501-2008-H885-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.birt.feature_1.3.0.v20120501-2046-H906-CR1.jar">org.jboss.tools.birt.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-2046-H906-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ ReportTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.birt.feature.source_1.3.0.v20120501-2046-H906-CR1.jar">org.jboss.tools.birt.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-2046-H906-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.feature_1.2.0.v20120501-1845-H1086-CR1.jar">org.jboss.tools.cdi.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120501-1845-H1086-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.feature.source_1.2.0.v20120501-1845-H1086-CR1.jar">org.jboss.tools.cdi.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120501-1845-H1086-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.seam.feature_1.2.0.v20120501-1845-H1086-CR1.jar">org.jboss.tools.cdi.seam.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120501-1845-H1086-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.cdi.seam.feature.source_1.2.0.v20120501-1845-H1086-CR1.jar">org.jboss.tools.cdi.seam.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120501-1845-H1086-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.central.discovery.feature_1.0.0.v20120501-1931-CR1.jar">org.jboss.tools.central.discovery.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.0.0.v20120501-1931-CR1</span>
+</td>
+<td/>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.central.feature_1.0.0.v20120501-1931-CR1.jar">org.jboss.tools.central.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.0.0.v20120501-1931-CR1</span>
+</td>
+<td/>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.core.feature_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.core.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td/>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.core.feature.source_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.core.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.feature_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td/>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.feature.source_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.jdt.feature_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.jdt.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.jdt.feature.source_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.jdt.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.mylyn.feature_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.mylyn.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.mylyn.feature.source_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.mylyn.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.text.ext.feature_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.text.ext.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td/>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.text.ext.feature.source_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.text.ext.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.ui.feature_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.ui.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td/>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.ui.feature.source_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.ui.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.verification.feature_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.verification.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td/>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.common.verification.feature.source_3.3.0.v20120501-1934-H877-CR1.jar">org.jboss.tools.common.verification.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1934-H877-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.community.central.feature_1.0.0.v20120501-1931-CR1.jar">org.jboss.tools.community.central.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.0.0.v20120501-1931-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.community.project.examples.feature_1.2.1.v20120501-1742-CR1.jar">org.jboss.tools.community.project.examples.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.1.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.community.project.examples.feature.source_1.2.1.v20120501-1742-CR1.jar">org.jboss.tools.community.project.examples.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.1.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.forge.feature_1.0.0.v20120501-2003-H705-CR1.jar">org.jboss.tools.forge.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.0.0.v20120501-2003-H705-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.forge.feature.source_1.0.0.v20120501-2003-H705-CR1.jar">org.jboss.tools.forge.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.0.0.v20120501-2003-H705-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.gwt.feature_1.0.2.v20120501-2003-H651-CR1.jar">org.jboss.tools.gwt.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.0.2.v20120501-2003-H651-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.gwt.feature.source_1.0.2.v20120501-2003-H651-CR1.jar">org.jboss.tools.gwt.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.0.2.v20120501-2003-H651-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.jmx.feature_1.2.0.v20120501-2006-H801-CR1.jar">org.jboss.tools.jmx.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120501-2006-H801-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.jmx.feature.source_1.2.0.v20120501-2006-H801-CR1.jar">org.jboss.tools.jmx.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120501-2006-H801-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.jsf.feature_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.jsf.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.jsf.feature.source_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.jsf.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.jst.feature_3.3.0.v20120501-2017-H1042-CR1.jar">org.jboss.tools.jst.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-2017-H1042-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.jst.feature.source_3.3.0.v20120501-2017-H1042-CR1.jar">org.jboss.tools.jst.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-2017-H1042-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.cdi.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.cdi.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.cdi.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.cdi.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.gwt.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.gwt.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.gwt.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.gwt.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.hibernate.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.hibernate.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.hibernate.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.hibernate.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.jaxrs.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.jaxrs.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.jaxrs.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.jaxrs.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.jbosspackaging.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.jbosspackaging.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.jbosspackaging.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.jbosspackaging.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.jpa.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.jpa.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.jpa.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.jpa.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.jsf.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.jsf.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.jsf.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.jsf.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.portlet.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.portlet.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.portlet.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.portlet.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.profiles.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.profiles.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.profiles.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.profiles.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.project.examples.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.project.examples.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.project.examples.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.project.examples.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.seam.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.seam.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.seam.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.seam.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.sourcelookup.feature_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.sourcelookup.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ MavenTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.maven.sourcelookup.feature.source_1.3.0.v20120501-1932-H620-CR1.jar">org.jboss.tools.maven.sourcelookup.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1932-H620-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.openshift.egit.integration.feature_2.3.0.v20120501-2100-H434-CR1.jar">org.jboss.tools.openshift.egit.integration.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">2.3.0.v20120501-2100-H434-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ CloudTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.openshift.egit.integration.feature.source_2.3.0.v20120501-2100-H434-CR1.jar">org.jboss.tools.openshift.egit.integration.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">2.3.0.v20120501-2100-H434-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.openshift.express.feature_2.3.0.v20120501-2100-H434-CR1.jar">org.jboss.tools.openshift.express.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">2.3.0.v20120501-2100-H434-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ CloudTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.openshift.express.feature.source_2.3.0.v20120501-2100-H434-CR1.jar">org.jboss.tools.openshift.express.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">2.3.0.v20120501-2100-H434-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.portlet.feature_1.2.0.v20120501-1742-CR1.jar">org.jboss.tools.portlet.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.portlet.feature.source_1.2.0.v20120501-1742-CR1.jar">org.jboss.tools.portlet.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.project.examples.feature_1.2.1.v20120501-1742-CR1.jar">org.jboss.tools.project.examples.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.1.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.project.examples.feature.source_1.2.1.v20120501-1742-CR1.jar">org.jboss.tools.project.examples.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.1.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.richfaces.feature_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.richfaces.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.richfaces.feature.source_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.richfaces.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.runtime.as.detector.feature_1.3.0.v20120501-1742-CR1.jar">org.jboss.tools.runtime.as.detector.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.runtime.as.detector.feature.source_1.3.0.v20120501-1742-CR1.jar">org.jboss.tools.runtime.as.detector.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.runtime.core.feature_1.3.0.v20120501-1742-CR1.jar">org.jboss.tools.runtime.core.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.runtime.core.feature.source_1.3.0.v20120501-1742-CR1.jar">org.jboss.tools.runtime.core.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.runtime.seam.detector.feature_1.3.0.v20120501-1742-CR1.jar">org.jboss.tools.runtime.seam.detector.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.runtime.seam.detector.feature.source_1.3.0.v20120501-1742-CR1.jar">org.jboss.tools.runtime.seam.detector.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.seam.feature_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.seam.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.seam.feature.source_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.seam.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.struts.feature_3.3.0.v20120501-0233-H818-CR1.jar">org.jboss.tools.struts.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-0233-H818-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.struts.feature.source_3.3.0.v20120501-0233-H818-CR1.jar">org.jboss.tools.struts.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-0233-H818-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.usage.feature_1.1.0.v20120501-1954-H711-CR1.jar">org.jboss.tools.usage.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.1.0.v20120501-1954-H711-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.usage.feature.source_1.1.0.v20120501-1954-H711-CR1.jar">org.jboss.tools.usage.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.1.0.v20120501-1954-H711-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.vpe.browsersim.feature_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.vpe.browsersim.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.vpe.browsersim.feature.source_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.vpe.browsersim.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.vpe.feature_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.vpe.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.vpe.feature.source_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.vpe.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.ws.feature_1.2.2.v20120501-2054-H937-CR1.jar">org.jboss.tools.ws.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.2.v20120501-2054-H937-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.ws.feature.source_1.2.2.v20120501-2054-H937-CR1.jar">org.jboss.tools.ws.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.2.v20120501-2054-H937-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.ws.jaxrs.feature_1.2.2.v20120501-2054-H937-CR1.jar">org.jboss.tools.ws.jaxrs.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.2.v20120501-2054-H937-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.ws.jaxrs.feature.source_1.2.2.v20120501-2054-H937-CR1.jar">org.jboss.tools.ws.jaxrs.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.2.2.v20120501-2054-H937-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.xulrunner.feature_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.xulrunner.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td/>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.jboss.tools.xulrunner.feature.source_3.3.0.v20120501-1742-CR1.jar">org.jboss.tools.xulrunner.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.3.0.v20120501-1742-CR1</span>
+</td>
+<td/>
+</tr>
+<tr style="background-color:#DDDDDD">
+<th style="font-size:small">Feature</th>
+<th style="font-size:small">Version</th>
+<th style="font-size:small">
+ Feature Categor(ies)
+ </th>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.hibernate.eclipse.feature_3.4.0.v20120501-2016-H943-CR1.jar">org.hibernate.eclipse.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">3.4.0.v20120501-2016-H943-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AbridgedTools</span>
+<span style="font-size:x-small">
+ |
+ WebTools</span>
+<span style="font-size:x-small">
+ |
+ DataTools</span>
+<span style="font-size:x-small">
+ |
+ GeneralTools</span>
+</td>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.hibernate.eclipse.feature.source_3.4.0.v20120501-2016-H943-CR1.jar">org.hibernate.eclipse.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">3.4.0.v20120501-2016-H943-CR1</span>
+</td>
+<td>
+<span style="font-size:x-small">
+ |
+ AllSources</span>
+</td>
+</tr>
+<tr style="background-color:
+ #EEEEEE
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.mozilla.xulrunner.feature_1.9.218.v20120426-1730-H146-Beta3.jar">org.mozilla.xulrunner.feature</a>
+</td>
+<td>
+<span style="font-size:x-small">1.9.218.v20120426-1730-H146-Beta3</span>
+</td>
+<td/>
+</tr>
+<tr style="background-color:
+ #FFFFFF
+ ">
+<td class="rowLine">
+<a style="font-size:x-small" href="features/org.mozilla.xulrunner.feature.source_1.9.218.v20120426-1730-H146-Beta3.jar">org.mozilla.xulrunner.feature.source</a>
+</td>
+<td>
+<span style="font-size:x-small">1.9.218.v20120426-1730-H146-Beta3</span>
+</td>
+<td/>
+</tr>
+<tr style="background-color:#DDDDDD">
+<th style="font-size:small" colspan="1">Metadata</th>
+<th style="font-size:small" colspan="1"/>
+<th style="font-size:small" colspan="1"/>
+</tr>
+<tr style="background-color:#EEEEEE">
+<td colspan="1" class="rowLine">
+<a style="font-size:x-small" href="site.xml">site.xml</a>
+ ::
+ <a style="font-size:x-small" href="artifacts.jar">artifacts.jar</a>
+ ::
+ <a style="font-size:x-small" href="content.jar">content.jar</a>
+</td>
+<td colspan="1" class="rowLine">
+ ::
+ <a style="font-size:x-small" href="plugins/">plugins</a>
+ ::
+ <a style="font-size:x-small" href="features/">features</a>
+</td>
+<td colspan="1" class="rowLine">
+ :: <a href="jbosstools-directory.xml" style="font-size:x-small">jbosstools-directory.xml</a>
+ :: <a href="site.properties" style="font-size:x-small">site.properties</a>
+ </td>
+</tr>
+</table><br xmlns="http://www.w3.org/1999/xhtml" xmlns:xalan="http://xml.apache.org/xalan"/>
+
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>
+ <table width="100%">
+ <tr class="header">
+ <td class="sub-header" width="100%"><span> Installation
+ Types</span></td>
+ </tr>
+ <tr class="light-row" style="height: 30px">
+ <td class="bodyText">
+ <p class="bodyText">Depending on how close to the bleeding edge
+ you like to be, there are several types of releases available.</p>
+ <br />
+
+ </td>
+ </tr>
+
+ <tr class="dark-row" style="height: 30px">
+ <td class="bodyText">
+ <h4>Stable Releases</h4>
+
+ <p><a href="https://www.jboss.org/tools/download/stable.html">Stable
+ releases</a> are - as indicated by their name - stable.</p><br/>
+
+ </td>
+ </tr>
+
+ <tr class="light-row" style="height: 30px">
+ <td class="bodyText">
+ <h4>Development Milestones</h4>
+
+ <p><a href="https://www.jboss.org/tools/download/dev.html">Development
+ builds</a>, released once per milestone and only a few times a year, are
+ fairly stable, but there may be some things which do not yet work.
+ If you would like to try one of these milestones, we'd greatly
+ appreciate the assistance in testing and <a
+ href="https://jira.jboss.org/jira/browse/JBIDE">reporting of
+ issues in our issue tracker</a>.</p><br/>
+
+ </td>
+ </tr>
+
+ <tr class="dark-row" style="height: 30px">
+ <td class="bodyText">
+ <h4>Nightly Builds</h4>
+
+ <p>The <a
+ href="https://www.jboss.org/tools/download/nightly.html">bleeding
+ edge</a> contains the latest and greatest new features, but nothing is
+ stable or guaranteed - yet. If you're using a Milestone and need a
+ fix, you can update to the latest Nightly, or wait for the next
+ Milestone.</p><br/>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+</center>
+</html>
Property changes on: trunk/build/aggregate/site/index.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/aggregate/site/jbosstools-directory.xml
===================================================================
--- trunk/build/aggregate/site/jbosstools-directory.xml (rev 0)
+++ trunk/build/aggregate/site/jbosstools-directory.xml 2012-08-24 13:15:06 UTC (rev 43220)
@@ -0,0 +1,4 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<directory xmlns="http://www.eclipse.org/mylyn/discovery/directory/">
+<entry url="plugins/org.jboss.tools.central.discovery_1.0.0.v20120501-1931-CR1.jar" permitCategories="true"/>
+</directory>
Property changes on: trunk/build/aggregate/site/jbosstools-directory.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/build/aggregate/site/pom.xml
===================================================================
--- trunk/build/aggregate/site/pom.xml 2012-08-24 12:56:23 UTC (rev 43219)
+++ trunk/build/aggregate/site/pom.xml 2012-08-24 13:15:06 UTC (rev 43220)
@@ -10,36 +10,10 @@
<groupId>org.jboss.tools</groupId>
<artifactId>org.jboss.tools.site.core</artifactId>
<name>JBoss Tools - Core Site</name>
- <packaging>eclipse-repository</packaging>
+ <packaging>eclipse-update-site</packaging>
<build>
<plugins>
<plugin>
- <groupId>org.jboss.tools.tycho-plugins</groupId>
- <artifactId>repository-utils</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <executions>
- <execution>
- <id>generate-facade</id>
- <phase>package</phase>
- <goals>
- <goal>generate-repository-facade</goal>
- </goals>
- <configuration>
- <symbols>
- <update.site.name>JBoss Tools - Core</update.site.name>
- <update.site.description>${update.site.description}</update.site.description>
- <update.site.version>${JBT_VERSION} ${buildQualifier}</update.site.version>
- <target.eclipse.version>${targetEclipseVersion}</target.eclipse.version>
- </symbols>
- <!-- TODO replace by a property from parent pom -->
- <associateSites>
- <param>http://download.jboss.org/jbosstools/updates/juno/SR0/</param>
- </associateSites>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
Added: trunk/build/aggregate/site/site.xml
===================================================================
--- trunk/build/aggregate/site/site.xml (rev 0)
+++ trunk/build/aggregate/site/site.xml 2012-08-24 13:15:06 UTC (rev 43220)
@@ -0,0 +1,457 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <description>JBoss Tools 3.4 (Juno) Updates - Core</description>
+
+ <!-- PLEASE NOTE!
+ When updating this file, please be sure that it parses as valid XML before committing it.
+ To test, just run `mvn clean install` in this folder.
+ -->
+
+ <!-- only in JBDS
+ <feature url="features/com.jboss.jbds.product.feature_0.0.0.jar" id="com.jboss.jbds.product.feature" version="0.0.0" patch="false">
+ <category name="AbridgedTools" />
+ </feature>
+ <feature url="features/com.jboss.jbds.central.discovery.feature_0.0.0.jar" id="com.jboss.jbds.central.discovery.feature" version="0.0.0">
+ </feature>
+ -->
+
+ <feature url="features/org.jboss.tools.central.feature_0.0.0.jar" id="org.jboss.tools.central.feature" version="0.0.0">
+ </feature>
+ <!-- only in JBT -->
+ <feature url="features/org.jboss.tools.community.central.feature_0.0.0.jar" id="org.jboss.tools.community.central.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="GeneralTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.central.discovery.feature_0.0.0.jar" id="org.jboss.tools.central.discovery.feature" version="0.0.0">
+ </feature>
+ <feature url="features/org.jboss.tools.richfaces.feature_0.0.0.jar" id="org.jboss.tools.richfaces.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.vpe.browsersim.feature_0.0.0.jar" id="org.jboss.tools.vpe.browsersim.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.jst.feature_0.0.0.jar" id="org.jboss.tools.jst.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.vpe.feature_0.0.0.jar" id="org.jboss.tools.vpe.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.jsf.feature_0.0.0.jar" id="org.jboss.tools.jsf.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+ <!-- include but do not categorize -->
+ <feature url="features/org.jboss.tools.xulrunner.feature_0.0.0.jar" id="org.jboss.tools.xulrunner.feature" version="0.0.0">
+ </feature>
+ <feature url="features/org.mozilla.xulrunner.feature_0.0.0.jar" id="org.mozilla.xulrunner.feature" version="0.0.0">
+ </feature>
+
+ <feature url="features/org.jboss.tools.seam.feature_0.0.0.jar" id="org.jboss.tools.seam.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.cdi.feature_0.0.0.jar" id="org.jboss.tools.cdi.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ <category name="GeneralTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.cdi.seam.feature_0.0.0.jar" id="org.jboss.tools.cdi.seam.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ <category name="GeneralTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.cdi.deltaspike.feature_0.0.0.jar" id="org.jboss.tools.cdi.deltaspike.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ <category name="GeneralTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.jmx.feature_0.0.0.jar" id="org.jboss.tools.jmx.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="GeneralTools" />
+ </feature>
+ <feature url="features/org.jboss.ide.eclipse.as.feature_0.0.0.jar" id="org.jboss.ide.eclipse.as.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.openshift.express.feature_0.0.0.jar" id="org.jboss.tools.openshift.express.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="CloudTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.openshift.egit.integration.feature_0.0.0.jar" id="org.jboss.tools.openshift.egit.integration.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="CloudTools" />
+ </feature>
+ <!-- only in JBDS
+ <feature url="features/org.eclipse.egit_0.0.0.jar" id="org.eclipse.egit" version="0.0.0">
+ </feature>
+ <feature url="features/org.eclipse.jgit_0.0.0.jar" id="org.eclipse.jgit" version="0.0.0">
+ </feature>
+ -->
+ <feature url="features/org.jboss.ide.eclipse.archives.feature_0.0.0.jar" id="org.jboss.ide.eclipse.archives.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="GeneralTools" />
+ </feature>
+ <feature url="features/org.hibernate.eclipse.feature_0.0.0.jar" id="org.hibernate.eclipse.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ <category name="DataTools" />
+ <category name="GeneralTools" />
+ </feature>
+ <feature url="features/org.jboss.ide.eclipse.freemarker.feature_0.0.0.jar" id="org.jboss.ide.eclipse.freemarker.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="GeneralTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.struts.feature_0.0.0.jar" id="org.jboss.tools.struts.feature" version="0.0.0">
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.ws.feature_0.0.0.jar" id="org.jboss.tools.ws.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.ws.jaxrs.feature_0.0.0.jar" id="org.jboss.tools.ws.jaxrs.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.portlet.feature_0.0.0.jar" id="org.jboss.tools.portlet.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.forge.feature_0.0.0.jar" id="org.jboss.tools.forge.feature" version="0.0.0">
+ <category name="AbridgedTools"/>
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.project.examples.feature_0.0.0.jar" id="org.jboss.tools.project.examples.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="GeneralTools" />
+ </feature>
+
+ <!-- only in JBT -->
+ <feature url="features/org.jboss.tools.community.project.examples.feature_0.0.0.jar" id="org.jboss.tools.community.project.examples.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="GeneralTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.birt.feature_0.0.0.jar" id="org.jboss.tools.birt.feature" version="0.0.0">
+ <category name="ReportTools" />
+ </feature>
+
+ <!-- only in JBDS
+ <feature url="features/com.jboss.jbds.m2e.feature_0.0.0.jar" id="com.jboss.jbds.m2e.feature" version="0.0.0">
+ <category name="AbridgedTools"/>
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.eclipse.m2e.feature_0.0.0.jar" id="org.eclipse.m2e.feature" version="0.0.0">
+ </feature>
+ <feature url="features/org.maven.ide.eclipse.wtp.feature_0.0.0.jar" id="org.maven.ide.eclipse.wtp.feature" version="0.0.0">
+ </feature>
+ <feature url="features/org.sonatype.m2e.mavenarchiver.feature_0.0.0.jar" id="org.sonatype.m2e.mavenarchiver.feature" version="0.0.0">
+ </feature>
+ -->
+ <feature url="features/org.jboss.tools.maven.feature_0.0.0.jar" id="org.jboss.tools.maven.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.cdi.feature_0.0.0.jar" id="org.jboss.tools.maven.cdi.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.hibernate.feature_0.0.0.jar" id="org.jboss.tools.maven.hibernate.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.jaxrs.feature_0.0.0.jar" id="org.jboss.tools.maven.jaxrs.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.jdt.feature_0.0.0.jar" id="org.jboss.tools.maven.jdt.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.jpa.feature_0.0.0.jar" id="org.jboss.tools.maven.jpa.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.jsf.feature_0.0.0.jar" id="org.jboss.tools.maven.jsf.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.portlet.feature_0.0.0.jar" id="org.jboss.tools.maven.portlet.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.profiles.feature_0.0.0.jar" id="org.jboss.tools.maven.profiles.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.project.examples.feature_0.0.0.jar" id="org.jboss.tools.maven.project.examples.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.seam.feature_0.0.0.jar" id="org.jboss.tools.maven.seam.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools"/>
+ </feature>
+ <feature url="features/org.jboss.tools.maven.sourcelookup.feature_0.0.0.jar" id="org.jboss.tools.maven.sourcelookup.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <!-- only in JBT and JBDS Extras -->
+ <feature url="features/org.jboss.tools.maven.jbosspackaging.feature_0.0.0.jar" id="org.jboss.tools.maven.jbosspackaging.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.gwt.feature_0.0.0.jar" id="org.jboss.tools.maven.gwt.feature" version="0.0.0">
+ <category name="MavenTools" />
+ </feature>
+ <!-- only in JBT -->
+ <feature url="features/org.jboss.tools.gwt.feature_0.0.0.jar" id="org.jboss.tools.gwt.feature" version="0.0.0">
+ <category name="GeneralTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.common.mylyn.feature_0.0.0.jar" id="org.jboss.tools.common.mylyn.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="GeneralTools"/>
+ </feature>
+
+ <feature url="features/org.jboss.tools.common.jdt.feature_0.0.0.jar" id="org.jboss.tools.common.jdt.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="GeneralTools"/>
+ </feature>
+
+ <!-- include but do not categorize -->
+ <feature url="features/org.jboss.tools.common.feature_0.0.0.jar" id="org.jboss.tools.common.feature" version="0.0.0">
+ </feature>
+ <feature url="features/org.jboss.tools.common.core.feature_0.0.0.jar" id="org.jboss.tools.common.core.feature" version="0.0.0">
+ </feature>
+ <feature url="features/org.jboss.tools.common.text.ext.feature_0.0.0.jar" id="org.jboss.tools.common.text.ext.feature" version="0.0.0">
+ </feature>
+ <feature url="features/org.jboss.tools.common.ui.feature_0.0.0.jar" id="org.jboss.tools.common.ui.feature" version="0.0.0">
+ </feature>
+ <feature url="features/org.jboss.tools.common.verification.feature_0.0.0.jar" id="org.jboss.tools.common.verification.feature" version="0.0.0">
+ </feature>
+
+ <feature url="features/org.jboss.tools.runtime.core.feature_0.0.0.jar" id="org.jboss.tools.runtime.core.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.runtime.as.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.as.detector.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+ <feature url="features/org.jboss.tools.runtime.seam.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.seam.detector.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ </feature>
+
+ <feature url="features/org.jboss.tools.usage.feature_0.0.0.jar" id="org.jboss.tools.usage.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="GeneralTools"/>
+ </feature>
+
+
+ <!-- ####### -->
+ <!-- SOURCES -->
+ <!-- ####### -->
+ <feature url="features/org.jboss.tools.central.feature.source_0.0.0.jar" id="org.jboss.tools.central.feature.source" version="0.0.0">
+ </feature>
+ <feature url="features/org.jboss.tools.community.central.feature.source_0.0.0.jar" id="org.jboss.tools.community.central.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.central.discovery.feature.source_0.0.0.jar" id="org.jboss.tools.central.discovery.feature.source" version="0.0.0">
+ </feature>
+ <feature url="features/org.jboss.tools.richfaces.feature.source_0.0.0.jar" id="org.jboss.tools.richfaces.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.vpe.browsersim.feature.source_0.0.0.jar" id="org.jboss.tools.vpe.browsersim.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.jst.feature.source_0.0.0.jar" id="org.jboss.tools.jst.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.vpe.feature.source_0.0.0.jar" id="org.jboss.tools.vpe.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.jsf.feature.source_0.0.0.jar" id="org.jboss.tools.jsf.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <!-- include but do not categorize -->
+ <feature url="features/org.jboss.tools.xulrunner.feature.source_0.0.0.jar" id="org.jboss.tools.xulrunner.feature.source" version="0.0.0">
+ </feature>
+ <feature url="features/org.mozilla.xulrunner.feature.source_0.0.0.jar" id="org.mozilla.xulrunner.feature.source" version="0.0.0">
+ </feature>
+
+ <feature url="features/org.jboss.tools.seam.feature.source_0.0.0.jar" id="org.jboss.tools.seam.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.cdi.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.cdi.seam.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.seam.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.cdi.deltaspike.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.deltaspike.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.jmx.feature.source_0.0.0.jar" id="org.jboss.tools.jmx.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.ide.eclipse.as.feature.source_0.0.0.jar" id="org.jboss.ide.eclipse.as.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.openshift.express.feature.source_0.0.0.jar" id="org.jboss.tools.openshift.express.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.openshift.egit.integration.feature.source_0.0.0.jar" id="org.jboss.tools.openshift.egit.integration.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.ide.eclipse.archives.feature.source_0.0.0.jar" id="org.jboss.ide.eclipse.archives.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.hibernate.eclipse.feature.source_0.0.0.jar" id="org.hibernate.eclipse.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.ide.eclipse.freemarker.feature.source_0.0.0.jar" id="org.jboss.ide.eclipse.freemarker.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.struts.feature.source_0.0.0.jar" id="org.jboss.tools.struts.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.ws.feature.source_0.0.0.jar" id="org.jboss.tools.ws.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.ws.jaxrs.feature.source_0.0.0.jar" id="org.jboss.tools.ws.jaxrs.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.portlet.feature.source_0.0.0.jar" id="org.jboss.tools.portlet.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.forge.feature.source_0.0.0.jar" id="org.jboss.tools.forge.feature.source" version="0.0.0">
+ <category name="AllSources"/>
+ </feature>
+ <feature url="features/org.jboss.tools.project.examples.feature.source_0.0.0.jar" id="org.jboss.tools.project.examples.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.community.project.examples.feature.source_0.0.0.jar" id="org.jboss.tools.community.project.examples.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.birt.feature.source_0.0.0.jar" id="org.jboss.tools.birt.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.feature.source_0.0.0.jar" id="org.jboss.tools.maven.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.cdi.feature.source_0.0.0.jar" id="org.jboss.tools.maven.cdi.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.hibernate.feature.source_0.0.0.jar" id="org.jboss.tools.maven.hibernate.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.jsf.feature.source_0.0.0.jar" id="org.jboss.tools.maven.jsf.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.portlet.feature.source_0.0.0.jar" id="org.jboss.tools.maven.portlet.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.seam.feature.source_0.0.0.jar" id="org.jboss.tools.maven.seam.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.project.examples.feature.source_0.0.0.jar" id="org.jboss.tools.maven.project.examples.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.jaxrs.feature.source_0.0.0.jar" id="org.jboss.tools.maven.jaxrs.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.jpa.feature.source_0.0.0.jar" id="org.jboss.tools.maven.jpa.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.jdt.feature.source_0.0.0.jar" id="org.jboss.tools.maven.jdt.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.profiles.feature.source_0.0.0.jar" id="org.jboss.tools.maven.profiles.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.sourcelookup.feature.source_0.0.0.jar" id="org.jboss.tools.maven.sourcelookup.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.runtime.core.featur.source_0.0.0.jar" id="org.jboss.tools.runtime.core.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.runtime.as.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.as.detector.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.runtime.seam.detector.feature.source_0.0.0.jar" id="org.jboss.tools.runtime.seam.detector.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.usage.feature.source_0.0.0.jar" id="org.jboss.tools.usage.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <!-- only in JBT and JBDS Extras -->
+ <feature url="features/org.jboss.tools.maven.jbosspackaging.feature.source_0.0.0.jar" id="org.jboss.tools.maven.jbosspackaging.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.maven.gwt.feature.source_0.0.0.jar" id="org.jboss.tools.maven.gwt.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <!-- only in JBT -->
+ <feature url="features/org.jboss.tools.gwt.feature.source_0.0.0.jar" id="org.jboss.tools.gwt.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.common.mylyn.feature.source_0.0.0.jar" id="org.jboss.tools.common.mylyn.feature.source" version="0.0.0">
+ <category name="AllSources"/>
+ </feature>
+ <feature url="features/org.jboss.tools.common.jdt.feature.source_0.0.0.jar" id="org.jboss.tools.common.jdt.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.common.feature.source_0.0.0.jar" id="org.jboss.tools.common.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <!-- Not categorize -->
+ <feature url="features/org.jboss.tools.common.core.feature.source_0.0.0.jar" id="org.jboss.tools.common.core.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.common.text.ext.feature.source_0.0.0.jar" id="org.jboss.tools.common.text.ext.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.common.ui.feature.source_0.0.0.jar" id="org.jboss.tools.common.ui.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+ <feature url="features/org.jboss.tools.common.verification.feature.source_0.0.0.jar" id="org.jboss.tools.common.verification.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
+
+ <!-- ########## -->
+ <!-- CATEGORIES -->
+ <!-- ########## -->
+ <category-def name="AbridgedTools" label="Abridged JBoss Tools 3.4">
+ <description>Contains most of the JBoss Tools features. Excluded are those related to integration with 3rd party plugins. Selecting this category will give you all tools needed for Web and Seam Development.</description>
+ </category-def>
+
+ <category-def name="WebTools" label="JBoss Web and Java EE Development">
+ <description>Tools to help create web and enterprise applications, using JSF, Facelets, Seam, Hibernate/JPA, CSS, Webservices and more.</description>
+ </category-def>
+
+ <category-def name="GeneralTools" label="JBoss Application Development">
+ <description>Tools for general application development.</description>
+ </category-def>
+
+ <category-def name="DataTools" label="JBoss Data Services">
+ <description>Tools related to data services such as persistence and transformation.</description>
+ </category-def>
+
+ <category-def name="MavenTools" label="JBoss Maven Support">
+ <description>Plugins related to Maven and m2eclipse support. Use these to enable use of Maven.</description>
+ </category-def>
+ <category-def name="CloudTools" label="JBoss Cloud Development Tools">
+ <description>Tools for Cloud Development.</description>
+ </category-def>
+ <!-- Only in JBT -->
+ <category-def name="ReportTools" label="JBoss Business Intelligence, Reporting and Charting">
+ <description>Business Intelligence, Reporting and Charting. Use these if you plan to integrate Hibernate or Seam with Eclipse BIRT.</description>
+ </category-def>
+
+ <category-def name="AllSources" label="Sources">
+ <description>Source code for JBoss Tools features.</description>
+ </category-def>
+
+</site>
Property changes on: trunk/build/aggregate/site/site.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 4 months