Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,61 @@
*/
public final class EjbJarVersion extends J2EEBaseVersion {

/** Represents ejbjar version 2.0
/**
* Represents ejbjar version 2.0
*/
public static final EjbJarVersion EJBJAR_2_0 = new EjbJarVersion(
"2.0", 2000, // NOI18N
"1.3", 1300 // NOI18N
);
"2.0", 2000, // NOI18N
"1.3", 1300 // NOI18N
);

/** Represents ejbjar version 2.1
/**
* Represents ejbjar version 2.1
*/
public static final EjbJarVersion EJBJAR_2_1 = new EjbJarVersion(
"2.1", 2101, // NOI18N
"1.4", 1400 // NOI18N
);
"2.1", 2101, // NOI18N
"1.4", 1400 // NOI18N
);

/** Represents ejbjar version 3.0
/**
* Represents ejbjar version 3.0
*/
public static final EjbJarVersion EJBJAR_3_0 = new EjbJarVersion(
"3.0", 3000, // NOI18N
"5.0", 5000 // NOI18N
);
"3.0", 3000, // NOI18N
"5.0", 5000 // NOI18N
);

/** Represents ejbjar version 3.0
/**
* Represents ejbjar version 3.1
*/
public static final EjbJarVersion EJBJAR_3_1 = new EjbJarVersion(
"3.1", 3100, // NOI18N
"6.0", 6000 // NOI18N
);
"3.1", 3100, // NOI18N
"6.0", 6000 // NOI18N
);

/**
* Represents ejbjar version 3.2
*/
public static final EjbJarVersion EJBJAR_3_2 = new EjbJarVersion(
"3.2", 3200, // NOI18N
"7.0", 7000 // NOI18N
);

/**
* Represents ejbjar version 3.2.6
*/
public static final EjbJarVersion EJBJAR_3_2_6 = new EjbJarVersion(
"3.2.6", 3260, // NOI18N
"8.0", 8000 // NOI18N
);

/**
* Represents ejbjar version 4.0
*/
public static final EjbJarVersion EJBJAR_4_0 = new EjbJarVersion(
"4.0", 4000, // NOI18N
"9.0", 9000 // NOI18N
);
/** -----------------------------------------------------------------------
* Implementation
*/
Expand All @@ -70,6 +98,7 @@ private EjbJarVersion(String moduleVersion, int nv, String specVersion, int nsv)
* than the version passed in as an argument.
* @throws ClassCastException if obj is not a EjbJarVersion object.
*/
@Override
public int compareTo(Object obj) {
EjbJarVersion target = (EjbJarVersion) obj;
return numericCompare(target);
Expand All @@ -86,6 +115,12 @@ public static EjbJarVersion getEjbJarVersion(String version) {
result = EJBJAR_3_0;
} else if(EJBJAR_3_1.toString().equals(version)) {
result = EJBJAR_3_1;
} else if(EJBJAR_3_2.toString().equals(version)) {
result = EJBJAR_3_2;
} else if(EJBJAR_3_2_6.toString().equals(version)) {
result = EJBJAR_3_2_6;
} else if(EJBJAR_4_0.toString().equals(version)) {
result = EJBJAR_4_0;
}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public interface EjbJar extends org.netbeans.modules.j2ee.dd.api.common.RootInte
* @since 1.29
*/
public static final String VERSION_3_2 = "3.2"; //NOI18N
public static final String VERSION_4_0 = "4.0"; //NOI18N
public static final int STATE_VALID=0;
public static final int STATE_INVALID_PARSABLE=1;
public static final int STATE_INVALID_UNPARSABLE=2;
Expand All @@ -52,7 +53,7 @@ public interface EjbJar extends org.netbeans.modules.j2ee.dd.api.common.RootInte
public static final String RELATIONSHIPS = "Relationships"; // NOI18N
public static final String ASSEMBLY_DESCRIPTOR = "AssemblyDescriptor"; // NOI18N
public static final String EJB_CLIENT_JAR = "EjbClientJar"; // NOI18N

/** Setter for version property.
* Warning : Only the upgrade from lower to higher version is supported.
* @param version ejb-jar version value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public interface WebApp extends org.netbeans.modules.j2ee.dd.api.common.RootInte
*/
static final String VERSION_3_1 = "3.1"; //NOI18N
static final String VERSION_4_0 = "4.0"; //NOI18N
static final String VERSION_5_0 = "5.0"; //NOI18N
static final int STATE_VALID = 0;
static final int STATE_INVALID_PARSABLE = 1;
static final int STATE_INVALID_UNPARSABLE = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
import java.awt.Container;
import java.io.IOException;
import java.util.ArrayList;
import static java.util.Arrays.asList;
import javax.swing.JComponent;
import java.util.Vector;
import java.util.Iterator;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
Expand Down Expand Up @@ -178,11 +178,11 @@ public static boolean isSupportedJavaEEVersion(Project project) {
return false;
}
if (JPAModuleInfo.ModuleType.EJB == moduleInfo.getType()
&& ("3.1".equals(moduleInfo.getVersion()) || "3.0".equals(moduleInfo.getVersion()) || "3.2".equals(moduleInfo.getVersion()))) {
&& asList("3.0", "3.1", "3.2", "3.2.6", "4.0").contains(moduleInfo.getVersion())) {
return true;
}
if (JPAModuleInfo.ModuleType.WEB == moduleInfo.getType()
&& ("3.1".equals(moduleInfo.getVersion()) || "3.0".equals(moduleInfo.getVersion()) || "2.5".equals(moduleInfo.getVersion()))) {
&& asList("2.5", "3.1", "3.0", "4.0", "5.0").contains(moduleInfo.getVersion())) {
return true;
}
return false;
Expand Down