diff --git a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java
index ab1b2f4f47f8..6b054f15b09a 100644
--- a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java
+++ b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java
@@ -38,26 +38,37 @@ public JpaSupportImpl(JBJ2eePlatformFactory.J2eePlatformImplImpl platformImpl) {
@Override
public JpaProvider getDefaultProvider() {
String defaultProvider = platformImpl.getDefaultJpaProvider();
- boolean jpa2 = platformImpl.isJpa2Available();
- return JpaProviderFactory.createJpaProvider(defaultProvider, true, true, jpa2, false, false, false, false, false);
+ final boolean isDefault = true, isJpa10 = true;
+ boolean isJpa20 = platformImpl.isJpa2Available();
+ final boolean isJpa21 = false, isJpa22 = false, isJpa30 = false, isJpa31 = false, isJpa32 = false, isJpa40 = false;
+ return JpaProviderFactory.createJpaProvider(defaultProvider, isDefault,
+ isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40);
}
@Override
public Set getProviders() {
String defaultProvider = platformImpl.getDefaultJpaProvider();
- boolean jpa2 = platformImpl.isJpa2Available();
- Set providers = new HashSet();
+ final boolean isJpa10 = true;
+ boolean isJpa20 = platformImpl.isJpa2Available();
+ final boolean isJpa21 = false, isJpa22 = false, isJpa30 = false, isJpa31 = false, isJpa32 = false, isJpa40 = false;
+ Set providers = new HashSet<>(8);
if (platformImpl.containsPersistenceProvider(JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER)) {
- providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER,
- JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER.equals(defaultProvider), true, jpa2, false, false, false, false, false));
+ providers.add(JpaProviderFactory.createJpaProvider(
+ JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER,
+ JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER.equals(defaultProvider),
+ isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40));
}
if (platformImpl.containsPersistenceProvider(JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER)) {
- providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER,
- JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false));
+ providers.add(JpaProviderFactory.createJpaProvider(
+ JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER,
+ JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER.equals(defaultProvider),
+ isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40));
}
if (platformImpl.containsPersistenceProvider(JBJ2eePlatformFactory.KODO_JPA_PROVIDER)) {
- providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.KODO_JPA_PROVIDER,
- JBJ2eePlatformFactory.KODO_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false));
+ providers.add(JpaProviderFactory.createJpaProvider(
+ JBJ2eePlatformFactory.KODO_JPA_PROVIDER,
+ JBJ2eePlatformFactory.KODO_JPA_PROVIDER.equals(defaultProvider),
+ isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40));
}
return providers;
}
diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java
index 0e31bae10c67..740458b917bf 100644
--- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java
+++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java
@@ -38,20 +38,30 @@ public JpaSupportImpl(WLJ2eePlatformFactory.J2eePlatformImplImpl platformImpl) {
@Override
public JpaProvider getDefaultProvider() {
String defaultProvider = platformImpl.getDefaultJpaProvider();
- return JpaProviderFactory.createJpaProvider(defaultProvider, true, true,
- platformImpl.isJpa2Available(), platformImpl.isJpa21Available(), false, false, false, false);
+ final boolean isDefault = true, isJpa10 = true;
+ final boolean isJpa20 = platformImpl.isJpa2Available();
+ final boolean isJpa21 = platformImpl.isJpa21Available();
+ final boolean isJpa22 = false, isJpa30 = false, isJpa31 = false, isJpa32 = false, isJpa40 = false;
+ return JpaProviderFactory.createJpaProvider(defaultProvider, isDefault,
+ isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40);
}
@Override
public Set getProviders() {
String defaultProvider = platformImpl.getDefaultJpaProvider();
- Set providers = new HashSet();
- providers.add(JpaProviderFactory.createJpaProvider(WLJ2eePlatformFactory.OPENJPA_JPA_PROVIDER,
- WLJ2eePlatformFactory.OPENJPA_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false));
+ final boolean isJpa10 = true;
+ final boolean isJpa20 = platformImpl.isJpa2Available();
+ final boolean isJpa21 = platformImpl.isJpa21Available();
+ final boolean isJpa22 = false, isJpa30 = false, isJpa31 = false, isJpa32 = false, isJpa40 = false;
+ Set providers = new HashSet<>(4);
+ providers.add(JpaProviderFactory.createJpaProvider(
+ WLJ2eePlatformFactory.OPENJPA_JPA_PROVIDER,
+ WLJ2eePlatformFactory.OPENJPA_JPA_PROVIDER.equals(defaultProvider),
+ isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40));
providers.add(JpaProviderFactory.createJpaProvider(
WLJ2eePlatformFactory.ECLIPSELINK_JPA_PROVIDER,
WLJ2eePlatformFactory.ECLIPSELINK_JPA_PROVIDER.equals(defaultProvider),
- true, platformImpl.isJpa2Available(), platformImpl.isJpa21Available(), false, false, false, false));
+ isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40));
return providers;
}
diff --git a/enterprise/glassfish.common/nbproject/project.properties b/enterprise/glassfish.common/nbproject/project.properties
index 1b5e7c63cc12..f1d59bed2e5d 100644
--- a/enterprise/glassfish.common/nbproject/project.properties
+++ b/enterprise/glassfish.common/nbproject/project.properties
@@ -16,7 +16,7 @@
# under the License.
javac.compilerargs=-Xlint -Xlint:-serial
-javac.release=11
+javac.release=17
test.config.stableBTD.includes=**/*Test.class
test.config.stableBTD.excludes=\
diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties
index a83f6d4bcdd6..629d699e898f 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties
@@ -194,6 +194,7 @@ STR_7024_SERVER_NAME=GlassFish Server 7.0.24
STR_7025_SERVER_NAME=GlassFish Server 7.0.25
STR_710_SERVER_NAME=GlassFish Server 7.1.0
STR_800_SERVER_NAME=GlassFish Server 8.0.0
+STR_900_SERVER_NAME=GlassFish Server 9.0.0
# CommonServerSupport.java
MSG_FLAKEY_NETWORK=Network communication problem Could not establish \
diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java
index 081be2bca9f8..208ade0070df 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java
@@ -70,6 +70,7 @@ public final class GlassfishInstanceProvider implements ServerInstanceProvider,
public static final String JAKARTAEE91_DEPLOYER_FRAGMENT = "deployer:gfv610ee9";
public static final String JAKARTAEE10_DEPLOYER_FRAGMENT = "deployer:gfv700ee10";
public static final String JAKARTAEE11_DEPLOYER_FRAGMENT = "deployer:gfv800ee11";
+ public static final String JAKARTAEE12_DEPLOYER_FRAGMENT = "deployer:gfv900ee12";
public static final String EE6WC_DEPLOYER_FRAGMENT = "deployer:gfv3ee6wc"; // NOI18N
public static final String PRELUDE_DEPLOYER_FRAGMENT = "deployer:gfv3"; // NOI18N
private static String EE6_INSTANCES_PATH = "/GlassFishEE6/Instances"; // NOI18N
@@ -80,6 +81,7 @@ public final class GlassfishInstanceProvider implements ServerInstanceProvider,
private static String JAKARTAEE91_INSTANCES_PATH = "/GlassFishJakartaEE91/Instances"; // NOI18N
private static String JAKARTAEE10_INSTANCES_PATH = "/GlassFishJakartaEE10/Instances"; // NOI18N
private static String JAKARTAEE11_INSTANCES_PATH = "/GlassFishJakartaEE11/Instances"; // NOI18N
+ private static String JAKARTAEE12_INSTANCES_PATH = "/GlassFishJakartaEE12/Instances"; // NOI18N
private static String EE6WC_INSTANCES_PATH = "/GlassFishEE6WC/Instances"; // NOI18N
public static String PRELUDE_DEFAULT_NAME = "GlassFish_v3_Prelude"; //NOI18N
@@ -105,12 +107,12 @@ public static GlassfishInstanceProvider getProvider() {
EE7_DEPLOYER_FRAGMENT, EE8_DEPLOYER_FRAGMENT,
JAKARTAEE8_DEPLOYER_FRAGMENT, JAKARTAEE9_DEPLOYER_FRAGMENT,
JAKARTAEE91_DEPLOYER_FRAGMENT, JAKARTAEE10_DEPLOYER_FRAGMENT,
- JAKARTAEE11_DEPLOYER_FRAGMENT},
+ JAKARTAEE11_DEPLOYER_FRAGMENT, JAKARTAEE12_DEPLOYER_FRAGMENT},
new String[]{EE6_INSTANCES_PATH, EE6WC_INSTANCES_PATH,
EE7_INSTANCES_PATH, EE8_INSTANCES_PATH,
JAKARTAEE8_INSTANCES_PATH, JAKARTAEE9_INSTANCES_PATH,
JAKARTAEE91_INSTANCES_PATH, JAKARTAEE10_INSTANCES_PATH,
- JAKARTAEE11_INSTANCES_PATH},
+ JAKARTAEE11_INSTANCES_PATH, JAKARTAEE12_INSTANCES_PATH},
null,
true,
new String[]{"--nopassword"}, // NOI18N
diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java
index d301c678532c..dea9323b8f9d 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java
@@ -587,6 +587,17 @@ public enum ServerDetails {
"https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/8.0.0/glassfish-8.0.0.zip", // NOI18N
"https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/8.0.0/glassfish-8.0.0.zip", // NOI18N
"http://www.eclipse.org/legal/epl-2.0" //NOI18N
+ ),
+
+ /**
+ * details for an instance of GlassFish Server 9.0.0
+ */
+ GLASSFISH_SERVER_9_0_0(NbBundle.getMessage(ServerDetails.class, "STR_900_SERVER_NAME", new Object[]{}), // NOI18N
+ GlassfishInstanceProvider.JAKARTAEE12_DEPLOYER_FRAGMENT,
+ GlassFishVersion.GF_9_0_0,
+ "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/9.0.0-M1/glassfish-9.0.0-M1.zip", // NOI18N
+ "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/9.0.0-M1/glassfish-9.0.0-M1.zip", // NOI18N
+ "http://www.eclipse.org/legal/epl-2.0" //NOI18N
);
/**
diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java
index 5c906f0f9a8e..ede06ac97d10 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java
@@ -84,7 +84,10 @@ private static int autoregisterGlassFishInstance(String clusterDirValue, String
String deployer = "deployer:gfv3ee6";
String defaultDisplayNamePrefix = "GlassFish Server ";
GlassFishVersion version = ServerUtils.getServerVersion(glassfishRoot);
- if (GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) {
+ if (GlassFishVersion.ge(version, GlassFishVersion.GF_9_0_0)) {
+ deployer = "deployer:gfv900ee12";
+ config = "GlassFishJakartaEE12/Instances";
+ } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) {
deployer = "deployer:gfv800ee11";
config = "GlassFishJakartaEE11/Instances";
} else if (GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) {
diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties
index a7f84f8b939e..475c10eae215 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties
@@ -198,6 +198,9 @@ STR_710_SERVER_NAME=GlassFish Server 7.1.0
STR_V8_FAMILY_NAME=GlassFish Server
STR_800_SERVER_NAME=GlassFish Server 8.0.0
+STR_V9_FAMILY_NAME=GlassFish Server
+STR_900_SERVER_NAME=GlassFish Server 9.0.0
+
LBL_SELECT_BITS=Select
LBL_ChooseOne=Choose server to download:
diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java
index e095842f864a..198b1327dacf 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java
@@ -85,6 +85,13 @@ public static GlassfishWizardProvider createJakartaEe11() {
"STR_V8_FAMILY_NAME", new Object[]{}) // NOI18N
);
}
+
+ public static GlassfishWizardProvider createJakartaEe12() {
+ return new GlassfishWizardProvider(
+ org.openide.util.NbBundle.getMessage(GlassfishWizardProvider.class,
+ "STR_V9_FAMILY_NAME", new Object[]{}) // NOI18N
+ );
+ }
private final String displayName;
diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java
index e81b108df9f2..47333a2ce44a 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java
@@ -118,6 +118,12 @@ public static ServerUtilities getJakartaEe11Utilities() {
return null == gip ? null : new ServerUtilities(gip,
GlassfishWizardProvider.createJakartaEe11());
}
+
+ public static ServerUtilities getJakartaEe12Utilities() {
+ GlassfishInstanceProvider gip = GlassfishInstanceProvider.getProvider();
+ return null == gip ? null : new ServerUtilities(gip,
+ GlassfishWizardProvider.createJakartaEe12());
+ }
// public static ServerUtilities getEe6WCUtilities() {
// GlassfishInstanceProvider gip = GlassfishInstanceProvider.getProvider();
diff --git a/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java b/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java
index 37e1a77d83ad..e13a43ddc0bc 100644
--- a/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java
+++ b/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java
@@ -28,6 +28,22 @@
*/
public class AutomaticRegistrationTest {
+ @Test
+ public void testRegistrationGF9() {
+ GlassFishVersion version = GlassFishVersion.GF_9_0_0;
+ if (GlassFishVersion.ge(version, GlassFishVersion.GF_9_0_0)) {
+ assertTrue("Success!", true);
+ } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_6)) {
+ fail("GF_6");
+ } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_5_1_0)) {
+ fail("GF_5_1_0");
+ } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_5)) {
+ fail("GF_5");
+ } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_3_1)) {
+ fail("GF_3_1");
+ }
+ }
+
@Test
public void testRegistrationGF8() {
GlassFishVersion version = GlassFishVersion.GF_8_0_0;
diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java
index 7f52b529793c..e374b6447908 100644
--- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java
+++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java
@@ -88,6 +88,13 @@ public final class AppClientVersion extends J2EEBaseVersion {
"11.0", 11000, // NOI18N
"11.0", 11000 // NOI18N
);
+
+ /** Represents application-client version 12.0
+ */
+ public static final AppClientVersion APP_CLIENT_12_0 = new AppClientVersion(
+ "12.0", 12000, // NOI18N
+ "12.0", 12000 // NOI18N
+ );
/** Creates a new instance of AppClientVersion
*/
@@ -102,6 +109,7 @@ private AppClientVersion(String version, int nv, String specVersion, int nsv) {
* than the version passed in as an argument.
* @throws ClassCastException if obj is not a AppClientVersion object.
*/
+ @Override
public int compareTo(Object obj) {
AppClientVersion target = (AppClientVersion) obj;
return numericCompare(target);
@@ -128,6 +136,8 @@ public static AppClientVersion getAppClientVersion(String version) {
result = APP_CLIENT_10_0;
} else if(APP_CLIENT_11_0.toString().equals(version)) {
result = APP_CLIENT_11_0;
+ } else if(APP_CLIENT_12_0.toString().equals(version)) {
+ result = APP_CLIENT_12_0;
}
return result;
diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java
index d39b320562c5..1dcc0af1403f 100644
--- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java
+++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java
@@ -88,6 +88,13 @@ public final class ApplicationVersion extends J2EEBaseVersion {
"11.0", 11000, // NOI18N
"11.0", 11000 // NOI18N
);
+
+ /** Represents application version 12.0
+ */
+ public static final ApplicationVersion APPLICATION_12_0 = new ApplicationVersion(
+ "12.0", 12000, // NOI18N
+ "12.0", 12000 // NOI18N
+ );
/** Creates a new instance of ApplicationVersion
*/
@@ -102,6 +109,7 @@ private ApplicationVersion(String version, int nv, String specVersion, int nsv)
* than the version passed in as an argument.
* @throws ClassCastException if obj is not a ApplicationVersion object.
*/
+ @Override
public int compareTo(Object obj) {
ApplicationVersion target = (ApplicationVersion) obj;
return numericCompare(target);
@@ -124,8 +132,12 @@ public static ApplicationVersion getApplicationVersion(String version) {
result = APPLICATION_8_0;
} else if(APPLICATION_9_0.toString().equals(version)) {
result = APPLICATION_9_0;
- }else if(APPLICATION_10_0.toString().equals(version)) {
+ } else if(APPLICATION_10_0.toString().equals(version)) {
result = APPLICATION_10_0;
+ } else if(APPLICATION_11_0.toString().equals(version)) {
+ result = APPLICATION_11_0;
+ } else if(APPLICATION_12_0.toString().equals(version)) {
+ result = APPLICATION_12_0;
}
return result;
diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java
index b8ca518b4f50..70fc060850dc 100644
--- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java
+++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java
@@ -89,6 +89,14 @@ public final class EjbJarVersion extends J2EEBaseVersion {
"4.0.1", 4010, // NOI18N
"10.0", 10000 // NOI18N
);
+
+ /**
+ * Represents ejbjar version 4.1
+ */
+ public static final EjbJarVersion EJBJAR_4_1 = new EjbJarVersion(
+ "4.1", 4100, // NOI18N
+ "12.0", 12000 // NOI18N
+ );
/** Creates a new instance of EjbJarVersion
*/
@@ -126,6 +134,10 @@ public static EjbJarVersion getEjbJarVersion(String version) {
result = EJBJAR_3_2_6;
} else if(EJBJAR_4_0.toString().equals(version)) {
result = EJBJAR_4_0;
+ } else if(EJBJAR_4_0_1.toString().equals(version)) {
+ result = EJBJAR_4_0_1;
+ } else if(EJBJAR_4_1.toString().equals(version)) {
+ result = EJBJAR_4_1;
}
return result;
diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java
index 3b85965f52ff..a5035f00446a 100644
--- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java
+++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java
@@ -70,7 +70,7 @@
import org.openide.util.RequestProcessor;
/**
- * Basic Java/Jakarta EE server configuration API support for V2-V8 plugins.
+ * Basic Java/Jakarta EE server configuration API support for V2-V9 plugins.
*
* @author Peter Williams, Tomas Kraus
*/
@@ -489,7 +489,8 @@ void internalSetAppServerVersion(ASDDVersion asVersion) {
"gfv6ee9",
"gfv610ee9",
"gfv700ee10",
- "gfv800ee11"
+ "gfv800ee11",
+ "gfv900ee12"
};
protected ASDDVersion getTargetAppServerVersion() {
@@ -542,7 +543,13 @@ static ASDDVersion getInstalledAppServerVersionFromDirectory(File asInstallFolde
boolean geGF6 = false;
boolean geGF7 = false;
boolean geGF8 = false;
- if(schemaFolder.exists()){
+ boolean geGF9 = false;
+ if(schemaFolder.exists()) {
+ if(new File(schemaFolder, "jakartaee12.xsd").exists() &&
+ new File(dtdFolder, "glassfish-web-app_3_0-1.dtd").exists()){
+ geGF9 = true;
+ return ASDDVersion.GLASSFISH_9;
+ }
if(new File(schemaFolder, "jakartaee11.xsd").exists() &&
new File(dtdFolder, "glassfish-web-app_3_0-1.dtd").exists()){
geGF8 = true;
@@ -564,7 +571,7 @@ static ASDDVersion getInstalledAppServerVersionFromDirectory(File asInstallFolde
return ASDDVersion.GLASSFISH_5_1;
}
}
- if (!geGF5 && !geGF6 && !geGF7 && !geGF8 && dtdFolder.exists()) {
+ if (!geGF5 && !geGF6 && !geGF7 && !geGF8 && !geGF9 && dtdFolder.exists()) {
if (new File(dtdFolder, "glassfish-web-app_3_0-1.dtd").exists()) {
return ASDDVersion.SUN_APPSERVER_10_1;
}
diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2EEVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2EEVersion.java
index 3ef27a3bdc62..100b6b75c49a 100644
--- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2EEVersion.java
+++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2EEVersion.java
@@ -97,6 +97,12 @@ public final class J2EEVersion extends J2EEBaseVersion {
public static final J2EEVersion JAKARTAEE_11_0 = new J2EEVersion(
"11.0.0", 110000, // NOI18N
"11.0.0", 110000); // NOI18N
+
+ /** Represents Jakarta EE version 12.0.0
+ */
+ public static final J2EEVersion JAKARTAEE_12_0 = new J2EEVersion(
+ "12.0.0", 120000, // NOI18N
+ "12.0.0", 120000); // NOI18N
/** Creates a new instance of J2EEVersion
*/
@@ -141,6 +147,8 @@ public static J2EEVersion getJ2EEVersion(String version) {
result = JAKARTAEE_10_0;
} else if(JAKARTAEE_11_0.toString().equals(version)) {
result = JAKARTAEE_11_0;
+ } else if(JAKARTAEE_12_0.toString().equals(version)) {
+ result = JAKARTAEE_12_0;
}
return result;
diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java
index dcd0dd32683b..6d7c45abd7aa 100644
--- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java
+++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java
@@ -55,13 +55,13 @@ public abstract class J2eeModuleHelper {
private static final Map
*/
- private static Map> javaEEMap = new LinkedHashMap<>();
+ private static Map> javaEEMap = new LinkedHashMap<>(32);
static {
- List javaEE5 = new ArrayList<>();
- List javaEE6Web = new ArrayList<>();
- List javaEE6Full = new ArrayList<>();
- List javaEE7Web = new ArrayList<>();
- List javaEE7Full = new ArrayList<>();
- List javaEE8Web = new ArrayList<>();
- List javaEE8Full = new ArrayList<>();
- List jakartaEE8Web = new ArrayList<>();
- List jakartaEE8Full = new ArrayList<>();
- List jakartaEE9Web = new ArrayList<>();
- List jakartaEE9Full = new ArrayList<>();
- List jakartaEE91Web = new ArrayList<>();
- List jakartaEE91Full = new ArrayList<>();
- List jakartaEE10Web = new ArrayList<>();
- List jakartaEE10Full = new ArrayList<>();
- List jakartaEE11Web = new ArrayList<>();
- List jakartaEE11Full = new ArrayList<>();
+ List javaEE5 = new ArrayList<>(16);
+ List javaEE6Web = new ArrayList<>(8);
+ List javaEE6Full = new ArrayList<>(8);
+ List javaEE7Web = new ArrayList<>(8);
+ List javaEE7Full = new ArrayList<>(8);
+ List javaEE8Web = new ArrayList<>(8);
+ List javaEE8Full = new ArrayList<>(8);
+ List jakartaEE8Web = new ArrayList<>(8);
+ List jakartaEE8Full = new ArrayList<>(8);
+ List jakartaEE9Web = new ArrayList<>(8);
+ List jakartaEE9Full = new ArrayList<>(8);
+ List jakartaEE91Web = new ArrayList<>(8);
+ List jakartaEE91Full = new ArrayList<>(8);
+ List jakartaEE10Web = new ArrayList<>(8);
+ List jakartaEE10Full = new ArrayList<>(8);
+ List jakartaEE11Web = new ArrayList<>(8);
+ List jakartaEE11Full = new ArrayList<>(8);
+ List jakartaEE12Web = new ArrayList<>(8);
+ List jakartaEE12Full = new ArrayList<>(8);
// Java EE specification
javaEE5.add(new DependencyDesc("javaee", "javaee-api", "5.0"));
@@ -258,16 +248,18 @@ private Profile getProfileFromDescriptor() {
javaEE7Web.add(new DependencyDesc("javax", "javaee-web-api", "7.0"));
javaEE8Full.add(new DependencyDesc("javax", "javaee-api", "8.0"));
javaEE8Web.add(new DependencyDesc("javax", "javaee-web-api", "8.0"));
- jakartaEE8Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","8.0.0"));
- jakartaEE8Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","8.0.0"));
- jakartaEE9Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","9.0.0"));
- jakartaEE9Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","9.0.0"));
- jakartaEE91Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","9.1.0"));
- jakartaEE91Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","9.1.0"));
- jakartaEE10Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","10.0.0"));
- jakartaEE10Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","10.0.0"));
- jakartaEE11Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","11.0.0-M1"));
- jakartaEE11Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","11.0.0-M1"));
+ jakartaEE8Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","8.0.0"));
+ jakartaEE8Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","8.0.0"));
+ jakartaEE9Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","9.0.0"));
+ jakartaEE9Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","9.0.0"));
+ jakartaEE91Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","9.1.0"));
+ jakartaEE91Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","9.1.0"));
+ jakartaEE10Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","10.0.0"));
+ jakartaEE10Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","10.0.0"));
+ jakartaEE11Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","11.0.0"));
+ jakartaEE11Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","11.0.0"));
+ jakartaEE12Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","12.0.0-M1"));
+ jakartaEE12Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","12.0.0-M1"));
// GlassFish implementations
javaEE5.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "2"));
@@ -288,8 +280,10 @@ private Profile getProfileFromDescriptor() {
jakartaEE91Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "6.2.5"));
jakartaEE10Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "7.0.11"));
jakartaEE10Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "7.0.11"));
- jakartaEE11Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "8.0.0-M1"));
- jakartaEE11Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "8.0.0-M1"));
+ jakartaEE11Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "8.0.0"));
+ jakartaEE11Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "8.0.0"));
+ jakartaEE12Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "9.0.0-M1"));
+ jakartaEE12Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "9.0.0-M1"));
// WebLogic implementations
@@ -312,6 +306,8 @@ private Profile getProfileFromDescriptor() {
jakartaEE8Full.add(new DependencyDesc("org.jboss.spec", "jboss-jakartaee-all-8.0", null));
jakartaEE8Web.add(new DependencyDesc("org.jboss.spec", "jboss-jakartaee-web-8.0", null));
+ javaEEMap.put(Profile.JAKARTA_EE_12_FULL, jakartaEE12Full);
+ javaEEMap.put(Profile.JAKARTA_EE_12_WEB, jakartaEE12Web);
javaEEMap.put(Profile.JAKARTA_EE_11_FULL, jakartaEE11Full);
javaEEMap.put(Profile.JAKARTA_EE_11_WEB, jakartaEE11Web);
javaEEMap.put(Profile.JAKARTA_EE_10_FULL, jakartaEE10Full);
diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java
index 8e0fb3a50170..298ae841284a 100644
--- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java
+++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java
@@ -96,7 +96,14 @@ public WebRecoPrivTemplates(Project project) {
"ejb-types_3_2", // NOI18N
"ejb-deployment-descriptor", // NOI18N
};
-
+
+ private static final String[] WEB_TYPES_EJB41_LITE = new String[] {
+ "ejb-types", // NOI18N
+ "ejb-types_3_0", // NOI18N
+ "ejb-types_3_1", // NOI18N
+ "ejb-types_3_2", // NOI18N
+ "ejb-deployment-descriptor", // NOI18N
+ };
private static final String[] WEB_PRIVILEGED_NAMES = new String[] {
"Templates/JSP_Servlet/JSP.jsp", // NOI18N
@@ -154,6 +161,8 @@ public String[] getRecommendedTypes() {
toRet.addAll(Arrays.asList(WEB_TYPES_EJB32_LITE));
} else if (cap.isEjb31LiteSupported()) {
toRet.addAll(Arrays.asList(WEB_TYPES_EJB_LITE));
+ } else if (cap.isEjb41LiteSupported()) {
+ toRet.addAll(Arrays.asList(WEB_TYPES_EJB41_LITE));
}
}
return toRet.toArray(new String[0]);
@@ -180,7 +189,7 @@ public String[] getPrivilegedTemplates() {
if (cap.isEjb31LiteSupported()) {
toRet.addAll(Arrays.asList(WEB_PRIVILEGED_NAMES_EE6_WEB));
}
- if (cap.isEjb32LiteSupported() || cap.isEjb40LiteSupported()) {
+ if (cap.isEjb32LiteSupported() || cap.isEjb40LiteSupported() || cap.isEjb41LiteSupported()) {
toRet.addAll(Arrays.asList(WEB_PRIVILEGED_NAMES_EE7_WEB));
}
}
@@ -191,13 +200,9 @@ public String[] getPrivilegedTemplates() {
}
private boolean isServerSupportingEJB31() {
- if (ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_6_FULL)
+ return ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_6_FULL)
|| ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_7_FULL)
|| ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_8_FULL)
- || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_8_FULL)) {
-
- return true;
- }
- return false;
+ || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_8_FULL);
}
}
diff --git a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java
index 6a786e9af48e..088ee1bb8bad 100644
--- a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java
+++ b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java
@@ -51,6 +51,8 @@ public void testJavaEEProjectSettingsInMavenProjects() throws Exception {
}
public void checkProjectForProfileChange(Project prj) {
+ JavaEEProjectSettings.setProfile(prj, Profile.JAKARTA_EE_12_FULL);
+ assertEquals(Profile.JAKARTA_EE_12_FULL, JavaEEProjectSettings.getProfile(prj));
JavaEEProjectSettings.setProfile(prj, Profile.JAKARTA_EE_11_FULL);
assertEquals(Profile.JAKARTA_EE_11_FULL, JavaEEProjectSettings.getProfile(prj));
JavaEEProjectSettings.setProfile(prj, Profile.JAKARTA_EE_10_FULL);
diff --git a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java
index e70edf752d5a..887ea62f1c91 100644
--- a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java
+++ b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java
@@ -151,11 +151,19 @@ public void testGetJ2eeProfile_jakartaEE10WebSpecification() throws IOException
}
public void testGetJ2eeProfile_warProject_jakartaEE11FullSpecification() throws IOException {
- checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "jakarta.platform", "jakarta.jakartaee-api", "11.0.0-M1"); //NOI18N
+ checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "jakarta.platform", "jakarta.jakartaee-api", "11.0.0"); //NOI18N
}
public void testGetJ2eeProfile_jakartaEE11WebSpecification() throws IOException {
- checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "jakarta.platform", "jakarta.jakartaee-web-api", "11.0.0-M1"); //NOI18N
+ checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "jakarta.platform", "jakarta.jakartaee-web-api", "11.0.0"); //NOI18N
+ }
+
+ public void testGetJ2eeProfile_warProject_jakartaEE12FullSpecification() throws IOException {
+ checkJ2eeProfile(Profile.JAKARTA_EE_12_WEB, "jakarta.platform", "jakarta.jakartaee-api", "12.0.0-M1"); //NOI18N
+ }
+
+ public void testGetJ2eeProfile_jakartaEE12WebSpecification() throws IOException {
+ checkJ2eeProfile(Profile.JAKARTA_EE_12_WEB, "jakarta.platform", "jakarta.jakartaee-web-api", "12.0.0-M1"); //NOI18N
}
public void testGetJ2eeProfile_javaEE5Full_glassfish() throws IOException {
@@ -223,11 +231,19 @@ public void testGetJ2eeProfile_jakartaEE10Web_glassfish() throws IOException {
}
public void testGetJ2eeProfile_warProject_jakartaEE11Full_glassfish() throws IOException {
- checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "org.glassfish.main.extras", "glassfish-embedded-all", "8.0.0-M1"); //NOI18N
+ checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "org.glassfish.main.extras", "glassfish-embedded-all", "8.0.0"); //NOI18N
}
public void testGetJ2eeProfile_jakartaEE11Web_glassfish() throws IOException {
- checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "org.glassfish.main.extras", "glassfish-embedded-web", "8.0.0-M1"); //NOI18N
+ checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "org.glassfish.main.extras", "glassfish-embedded-web", "8.0.0"); //NOI18N
+ }
+
+ public void testGetJ2eeProfile_warProject_jakartaEE12Full_glassfish() throws IOException {
+ checkJ2eeProfile(Profile.JAKARTA_EE_12_WEB, "org.glassfish.main.extras", "glassfish-embedded-all", "9.0.0-M1"); //NOI18N
+ }
+
+ public void testGetJ2eeProfile_jakartaEE12Web_glassfish() throws IOException {
+ checkJ2eeProfile(Profile.JAKARTA_EE_12_WEB, "org.glassfish.main.extras", "glassfish-embedded-web", "9.0.0-M1"); //NOI18N
}
public void testGetJ2eeProfile_javaEE5_weblogic() throws IOException {
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java
index cdb92e7f7cd4..aa419b1c6c68 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java
@@ -440,6 +440,16 @@ public boolean isEE9Supported() {
public boolean isEE10Supported() {
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ @Override
+ public boolean isEE11Supported() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isEE12Supported() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
@Override
public boolean equalsMajorMinor(PayaraPlatformVersionAPI version) {
diff --git a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/AppClientVersion.java b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/AppClientVersion.java
index 72bdfa929669..6dc3411a330c 100644
--- a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/AppClientVersion.java
+++ b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/AppClientVersion.java
@@ -88,6 +88,13 @@ public final class AppClientVersion extends J2EEBaseVersion {
"11.0", 11000, // NOI18N
"11.0", 11000 // NOI18N
);
+
+ /** Represents application-client version 12.0
+ */
+ public static final AppClientVersion APP_CLIENT_12_0 = new AppClientVersion(
+ "12.0", 12000, // NOI18N
+ "12.0", 12000 // NOI18N
+ );
/** Creates a new instance of AppClientVersion
*/
@@ -102,6 +109,7 @@ private AppClientVersion(String version, int nv, String specVersion, int nsv) {
* than the version passed in as an argument.
* @throws ClassCastException if obj is not a AppClientVersion object.
*/
+ @Override
public int compareTo(Object obj) {
AppClientVersion target = (AppClientVersion) obj;
return numericCompare(target);
@@ -128,6 +136,8 @@ public static AppClientVersion getAppClientVersion(String version) {
result = APP_CLIENT_10_0;
} else if(APP_CLIENT_11_0.toString().equals(version)) {
result = APP_CLIENT_11_0;
+ } else if(APP_CLIENT_12_0.toString().equals(version)) {
+ result = APP_CLIENT_12_0;
}
return result;
diff --git a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/ApplicationVersion.java b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/ApplicationVersion.java
index 07653cfc83ba..825334315d3b 100644
--- a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/ApplicationVersion.java
+++ b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/ApplicationVersion.java
@@ -88,6 +88,13 @@ public final class ApplicationVersion extends J2EEBaseVersion {
"11.0", 11000, // NOI18N
"11.0", 11000 // NOI18N
);
+
+ /** Represents application version 12.0
+ */
+ public static final ApplicationVersion APPLICATION_12_0 = new ApplicationVersion(
+ "12.0", 12000, // NOI18N
+ "12.0", 12000 // NOI18N
+ );
/** Creates a new instance of ApplicationVersion
*/
@@ -128,6 +135,8 @@ public static ApplicationVersion getApplicationVersion(String version) {
result = APPLICATION_10_0;
} else if (APPLICATION_11_0.toString().equals(version)) {
result = APPLICATION_11_0;
+ } else if (APPLICATION_12_0.toString().equals(version)) {
+ result = APPLICATION_12_0;
}
return result;
diff --git a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/J2EEVersion.java b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/J2EEVersion.java
index 1c27e64674fa..c8960937334a 100644
--- a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/J2EEVersion.java
+++ b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/J2EEVersion.java
@@ -103,6 +103,12 @@ public final class J2EEVersion extends J2EEBaseVersion {
public static final J2EEVersion JAKARTAEE_11_0 = new J2EEVersion(
"11.0.0", 110000, // NOI18N
"11.0.0", 110000); // NOI18N
+
+ /** Represents Jakarta EE version 12.0.0
+ */
+ public static final J2EEVersion JAKARTAEE_12_0 = new J2EEVersion(
+ "12.0.0", 120000, // NOI18N
+ "12.0.0", 120000); // NOI18N
/*
* Implementation
@@ -152,6 +158,8 @@ public static J2EEVersion getJ2EEVersion(String version) {
result = JAKARTAEE_10_0;
} else if (JAKARTAEE_11_0.toString().equals(version)) {
result = JAKARTAEE_11_0;
+ } else if (JAKARTAEE_12_0.toString().equals(version)) {
+ result = JAKARTAEE_12_0;
}
return result;
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java
index d502a8c5bc91..490d297342e6 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java
@@ -210,6 +210,10 @@ public static Profile[] nbJavaEEProfiles(
break;
case v11_0_0: profiles[index++] = Profile.JAKARTA_EE_11_FULL;
break;
+ case v12_0_0_web: profiles[index++] = Profile.JAKARTA_EE_12_WEB;
+ break;
+ case v12_0_0: profiles[index++] = Profile.JAKARTA_EE_12_FULL;
+ break;
}
} else {
profiles = new Profile[0];
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java
index 02c61a148f0c..266dfd2376ee 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java
@@ -53,10 +53,12 @@ private static class JpaSupportVector {
* @param jpa_3_0 JPA 3.0 supported.
* @param jpa_3_1 JPA 3.1 supported.
* @param jpa_3_2 JPA 3.2 supported.
+ * @param jpa_4_0 JPA 4.0 supported.
*/
JpaSupportVector(boolean jpa_1_0, boolean jpa_2_0,
boolean jpa_2_1, boolean jpa_2_2,
- boolean jpa_3_0, boolean jpa_3_1, boolean jpa_3_2) {
+ boolean jpa_3_0, boolean jpa_3_1,
+ boolean jpa_3_2, boolean jpa_4_0) {
_1_0 = jpa_1_0;
_2_0 = jpa_2_0;
_2_1 = jpa_2_1;
@@ -64,6 +66,7 @@ private static class JpaSupportVector {
_3_0 = jpa_3_0;
_3_1 = jpa_3_1;
_3_2 = jpa_3_2;
+ _4_0 = jpa_4_0;
}
/** JPA 1.0 supported. */
@@ -83,8 +86,12 @@ private static class JpaSupportVector {
/** JPA 3.1 supported. */
boolean _3_1;
+
/** JPA 3.2 supported. */
boolean _3_2;
+
+ /** JPA 4.0 supported. */
+ boolean _4_0;
}
// Class attributes //
@@ -104,7 +111,7 @@ private static class JpaSupportVector {
true, true,
version.isEE7Supported(), version.isEE8Supported(),
version.isEE9Supported(), version.isEE10Supported(),
- false
+ false, false
)
);
}
@@ -171,7 +178,8 @@ public JpaProvider getDefaultProvider() {
JPA_PROVIDER, true, instanceJpaSupport._1_0,
instanceJpaSupport._2_0, instanceJpaSupport._2_1,
instanceJpaSupport._2_2, instanceJpaSupport._3_0,
- instanceJpaSupport._3_1, instanceJpaSupport._3_2);
+ instanceJpaSupport._3_1, instanceJpaSupport._3_2,
+ instanceJpaSupport._4_0);
}
}
return defaultProvider;
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java
index 9348bad47517..4355b54a9d87 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java
@@ -140,6 +140,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead
"SCHEMA:http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" , "ejb-jar_3_1",
"SCHEMA:http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd" , "ejb-jar_3_2",
"SCHEMA:https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_0.xsd" , "ejb-jar_4_0",
+ "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_1.xsd" , "ejb-jar_4_1",
"SCHEMA:http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd" , "application-client_1_4",
"SCHEMA:http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" , "application_1_4",
"SCHEMA:http://java.sun.com/xml/ns/javaee/application-client_5.xsd" , "application-client_5",
@@ -156,12 +157,15 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead
"SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_10.xsd" , "application_10",
"SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application-client_11.xsd" , "application-client_11",
"SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_11.xsd" , "application_11",
+ "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application-client_12.xsd" , "application-client_12",
+ "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_12.xsd" , "application_12",
"SCHEMA:http://java.sun.com/xml/ns/j2ee/jax-rpc-ri-config.xsd" , "jax-rpc-ri-config",
"SCHEMA:http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" , "connector_1_5",
"SCHEMA:http://java.sun.com/xml/ns/javaee/connector_1_6.xsd" , "connector_1_6",
"SCHEMA:http://xmlns.jcp.org/xml/ns/javaee/connector_1_7.xsd" , "connector_1_7",
"SCHEMA:https://jakarta.ee/xml/ns/jakartaee/connector_2_0.xsd" , "connector_2_0",
"SCHEMA:https://jakarta.ee/xml/ns/jakartaee/connector_2_1.xsd" , "connector_2_1",
+ "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/connector_2_2.xsd" , "connector_2_2",
//"SCHEMA:http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd" , "jsp_2_0.xsd",
//"SCHEMA:http://java.sun.com/xml/ns/j2ee/datatypes.dtd" , "datatypes",
//"SCHEMA:http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" , "web-app_2_4",
@@ -185,12 +189,14 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead
"SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_0.xsd" , "orm_3_0",
"SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_1.xsd" , "orm_3_1",
"SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_2.xsd" , "orm_3_2",
+ "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_4_0.xsd" , "orm_4_0",
"SCHEMA:http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" , "persistence_1_0",
"SCHEMA:http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" , "persistence_2_0",
"SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" , "persistence_2_1",
"SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd" , "persistence_2_2",
"SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" , "persistence_3_0",
"SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_3_2.xsd" , "persistence_3_2",
+ "SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_4_0.xsd" , "persistence_4_0",
};
private static final String JavaEE6SchemaToURLMap[] = {
@@ -491,6 +497,10 @@ public String getShortDescription() {
private static final String EJBJAR_4_0_XSD="ejb-jar_4_0.xsd"; // NOI18N
private static final String EJBJAR_4_0 = JAKARTAEE_NS+"/"+EJBJAR_4_0_XSD; // NOI18N
public static final String EJBJAR_4_0_ID = "SCHEMA:"+EJBJAR_4_0; // NOI18N
+
+ private static final String EJBJAR_4_1_XSD="ejb-jar_4_1.xsd"; // NOI18N
+ private static final String EJBJAR_4_1 = JAKARTAEE_NS+"/"+EJBJAR_4_1_XSD; // NOI18N
+ public static final String EJBJAR_4_1_ID = "SCHEMA:"+EJBJAR_4_1; // NOI18N
private static final String APP_TAG="application"; //NOI18N
private static final String APP_1_4_XSD="application_1_4.xsd"; // NOI18N
@@ -524,6 +534,10 @@ public String getShortDescription() {
private static final String APP_11_XSD="application_11.xsd"; // NOI18N
private static final String APP_11= JAKARTAEE_NS+"/"+APP_11_XSD; // NOI18N
public static final String APP_11_ID = "SCHEMA:"+APP_11; // NOI18N
+
+ private static final String APP_12_XSD="application_12.xsd"; // NOI18N
+ private static final String APP_12= JAKARTAEE_NS+"/"+APP_12_XSD; // NOI18N
+ public static final String APP_12_ID = "SCHEMA:"+APP_12; // NOI18N
private static final String APPCLIENT_TAG="application-client"; //NOI18N
private static final String APPCLIENT_1_4_XSD="application-client_1_4.xsd"; // NOI18N
@@ -557,6 +571,10 @@ public String getShortDescription() {
private static final String APPCLIENT_11_XSD="application-client_11.xsd"; // NOI18N
private static final String APPCLIENT_11= JAKARTAEE_NS+"/"+APPCLIENT_11_XSD; // NOI18N
public static final String APPCLIENT_11_ID = "SCHEMA:"+APPCLIENT_11; // NOI18N
+
+ private static final String APPCLIENT_12_XSD="application-client_12.xsd"; // NOI18N
+ private static final String APPCLIENT_12= JAKARTAEE_NS+"/"+APPCLIENT_12_XSD; // NOI18N
+ public static final String APPCLIENT_12_ID = "SCHEMA:"+APPCLIENT_12; // NOI18N
private static final String WEBSERVICES_TAG="webservices"; //NOI18N
private static final String WEBSERVICES_1_1_XSD="j2ee_web_services_1_1.xsd"; // NOI18N
@@ -675,6 +693,18 @@ public String getShortDescription() {
private static final String WEBFRAGMENT_6_1_XSD="web-fragment_6_1.xsd"; // NOI18N
private static final String WEBFRAGMENT_6_1 = JAKARTAEE_NS+"/"+WEBFRAGMENT_6_1_XSD; // NOI18N
public static final String WEBFRAGMENT_6_1_ID = "SCHEMA:"+WEBFRAGMENT_6_1; // NOI18N
+
+ private static final String WEBAPP_6_2_XSD="web-app_6_2.xsd"; // NOI18N
+ private static final String WEBAPP_6_2 = JAKARTAEE_NS+"/"+WEBAPP_6_2_XSD; // NOI18N
+ public static final String WEBAPP_6_2_ID = "SCHEMA:"+WEBAPP_6_2; // NOI18N
+
+ private static final String WEBCOMMON_6_2_XSD="web-common_6_2.xsd"; // NOI18N
+ private static final String WEBCOMMON_6_2 = JAKARTAEE_NS+"/"+WEBCOMMON_6_2_XSD; // NOI18N
+ public static final String WEBCOMMON_6_2_ID = "SCHEMA:"+WEBCOMMON_6_2; // NOI18N
+
+ private static final String WEBFRAGMENT_6_2_XSD="web-fragment_6_2.xsd"; // NOI18N
+ private static final String WEBFRAGMENT_6_2 = JAKARTAEE_NS+"/"+WEBFRAGMENT_6_2_XSD; // NOI18N
+ public static final String WEBFRAGMENT_6_2_ID = "SCHEMA:"+WEBFRAGMENT_6_2; // NOI18N
public static final String PERSISTENCE_NS = "http://java.sun.com/xml/ns/persistence"; // NOI18N
public static final String NEW_PERSISTENCE_NS = "http://xmlns.jcp.org/xml/ns/persistence"; // NOI18N
@@ -708,6 +738,10 @@ public String getShortDescription() {
private static final String PERSISTENCE_3_2_XSD="persistence_3_2.xsd"; // NOI18N
private static final String PERSISTENCE_3_2 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_3_2_XSD; // NOI18N
public static final String PERSISTENCE_3_2_ID = "SCHEMA:"+PERSISTENCE_3_2; // NOI18N
+
+ private static final String PERSISTENCE_4_0_XSD="persistence_4_0.xsd"; // NOI18N
+ private static final String PERSISTENCE_4_0 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_4_0_XSD; // NOI18N
+ public static final String PERSISTENCE_4_0_ID = "SCHEMA:"+PERSISTENCE_4_0; // NOI18N
public static final String PERSISTENCEORM_NS = "http://java.sun.com/xml/ns/persistence/orm"; // NOI18N
public static final String NEW_PERSISTENCEORM_NS = "http://xmlns.jcp.org/xml/ns/persistence/orm"; // NOI18N
@@ -741,15 +775,21 @@ public String getShortDescription() {
private static final String PERSISTENCEORM_3_2_XSD="orm_3_2.xsd"; // NOI18N
private static final String PERSISTENCEORM_3_2 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_3_2_XSD; // NOI18N yes not ORM NS!!!
public static final String PERSISTENCEORM_3_2_ID = "SCHEMA:"+PERSISTENCEORM_3_2; // NOI18N
+
+ private static final String PERSISTENCEORM_4_0_XSD="orm_4_0.xsd"; // NOI18N
+ private static final String PERSISTENCEORM_4_0 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_4_0_XSD; // NOI18N yes not ORM NS!!!
+ public static final String PERSISTENCEORM_4_0_ID = "SCHEMA:"+PERSISTENCEORM_4_0; // NOI18N
private static final String[] SUPPORTED_SCHEMAS = new String[]{
// ejb
- EJBJAR_2_1_XSD, EJBJAR_3_0_XSD, EJBJAR_3_1_XSD, EJBJAR_3_2_XSD, EJBJAR_4_0_XSD,
+ EJBJAR_2_1_XSD, EJBJAR_3_0_XSD, EJBJAR_3_1_XSD, EJBJAR_3_2_XSD,
+ EJBJAR_4_0_XSD, EJBJAR_4_1_XSD,
// application & application-client
APP_1_4_XSD, APPCLIENT_1_4_XSD, APP_5_XSD, APPCLIENT_5_XSD,
APP_6_XSD, APPCLIENT_6_XSD, APP_7_XSD, APPCLIENT_7_XSD,
APP_8_XSD, APPCLIENT_8_XSD, APP_9_XSD, APPCLIENT_9_XSD,
APP_10_XSD, APPCLIENT_10_XSD, APP_11_XSD, APPCLIENT_11_XSD,
+ APP_12_XSD, APPCLIENT_12_XSD,
//web-app, web-common & web-fragment
WEBAPP_2_5_XSD,
WEBAPP_3_0_XSD, WEBFRAGMENT_3_0_XSD, WEBCOMMON_3_0_XSD,
@@ -758,6 +798,7 @@ public String getShortDescription() {
WEBAPP_5_0_XSD, WEBFRAGMENT_5_0_XSD, WEBCOMMON_5_0_XSD,
WEBAPP_6_0_XSD, WEBFRAGMENT_6_0_XSD, WEBCOMMON_6_0_XSD,
WEBAPP_6_1_XSD, WEBFRAGMENT_6_1_XSD, WEBCOMMON_6_1_XSD,
+ WEBAPP_6_2_XSD, WEBFRAGMENT_6_2_XSD, WEBCOMMON_6_2_XSD,
//persistence & orm
PERSISTENCE_XSD, PERSISTENCEORM_XSD,
PERSISTENCE_2_0_XSD, PERSISTENCEORM_2_0_XSD,
@@ -766,6 +807,7 @@ public String getShortDescription() {
PERSISTENCE_3_0_XSD, PERSISTENCEORM_3_0_XSD,
PERSISTENCE_3_1_XSD, PERSISTENCEORM_3_1_XSD,
PERSISTENCE_3_2_XSD, PERSISTENCEORM_3_2_XSD,
+ PERSISTENCE_4_0_XSD, PERSISTENCEORM_4_0_XSD,
//webservice & webservice-client
WEBSERVICES_1_1_XSD, WEBSERVICES_CLIENT_1_1_XSD,
WEBSERVICES_1_2_XSD, WEBSERVICES_CLIENT_1_2_XSD,
@@ -833,7 +875,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc
}
@Override
- public Enumeration enabled(GrammarEnvironment ctx) {
+ public Enumeration enabled(GrammarEnvironment ctx) {
if (ctx.getFileObject() == null) return null;
Enumeration en = ctx.getDocumentChildren();
while (en.hasMoreElements()) {
@@ -891,6 +933,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) {
return null;
}
switch (mimeType) {
+ case "text/x-dd-ejbjar4.1": // NOI18N
+ inputSource = resolver.resolveEntity(EJBJAR_4_1_ID, "");
+ break;
case "text/x-dd-ejbjar4.0": // NOI18N
inputSource = resolver.resolveEntity(EJBJAR_4_0_ID, "");
break;
@@ -906,6 +951,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) {
case "text/x-dd-ejbjar2.1": // NOI18N
inputSource = resolver.resolveEntity(EJBJAR_2_1_ID, "");
break;
+ case "text/x-dd-application12.0": // NOI18N
+ inputSource = resolver.resolveEntity(APP_12_ID, "");
+ break;
case "text/x-dd-application11.0": // NOI18N
inputSource = resolver.resolveEntity(APP_11_ID, "");
break;
@@ -930,6 +978,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) {
case "text/x-dd-application1.4": // NOI18N
inputSource = resolver.resolveEntity(APP_1_4_ID, "");
break;
+ case "text/x-dd-client12.0": // NOI18N
+ inputSource = resolver.resolveEntity(APPCLIENT_12_ID, "");
+ break;
case "text/x-dd-client11.0": // NOI18N
inputSource = resolver.resolveEntity(APPCLIENT_11_ID, "");
break;
@@ -954,6 +1005,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) {
case "text/x-dd-client1.4": // NOI18N
inputSource = resolver.resolveEntity(APPCLIENT_1_4_ID, "");
break;
+ case "text/x-dd-servlet6.2": // NOI18N
+ inputSource = resolver.resolveEntity(WEBAPP_6_2_ID, "");
+ break;
case "text/x-dd-servlet6.1": // NOI18N
inputSource = resolver.resolveEntity(WEBAPP_6_1_ID, "");
break;
@@ -975,6 +1029,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) {
case "text/x-dd-servlet2.5": // NOI18N
inputSource = resolver.resolveEntity(WEBAPP_2_5_ID, "");
break;
+ case "text/x-dd-servlet-fragment6.2": // NOI18N
+ inputSource = resolver.resolveEntity(WEBFRAGMENT_6_2_ID, "");
+ break;
case "text/x-dd-servlet-fragment6.1": // NOI18N
inputSource = resolver.resolveEntity(WEBFRAGMENT_6_1_ID, "");
break;
@@ -993,6 +1050,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) {
case "text/x-dd-servlet-fragment3.0": // NOI18N
inputSource = resolver.resolveEntity(WEBFRAGMENT_3_0_ID, "");
break;
+ case "text/x-persistence4.0": // NOI18N
+ inputSource = resolver.resolveEntity(PERSISTENCE_4_0_ID, "");
+ break;
case "text/x-persistence3.2": // NOI18N
inputSource = resolver.resolveEntity(PERSISTENCE_3_2_ID, "");
break;
@@ -1014,6 +1074,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) {
case "text/x-persistence1.0": // NOI18N
inputSource = resolver.resolveEntity(PERSISTENCE_ID, "");
break;
+ case "text/x-orm4.0": // NOI18N
+ inputSource = resolver.resolveEntity(PERSISTENCEORM_4_0_ID, "");
+ break;
case "text/x-orm3.2": // NOI18N
inputSource = resolver.resolveEntity(PERSISTENCEORM_3_2_ID, "");
break;
diff --git a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
index 08cc94f11239..59561e002e79 100644
--- a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
+++ b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
@@ -1331,6 +1331,8 @@ intf org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI
meth public boolean equals(org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI)
meth public boolean equalsMajorMinor(org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI)
meth public boolean isEE10Supported()
+meth public boolean isEE11Supported()
+meth public boolean isEE12Supported()
meth public boolean isEE7Supported()
meth public boolean isEE8Supported()
meth public boolean isEE9Supported()
@@ -1366,6 +1368,8 @@ fld public final static java.lang.String SEPARATOR_PATTERN = "\u005c."
meth public abstract boolean equals(org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI)
meth public abstract boolean equalsMajorMinor(org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI)
meth public abstract boolean isEE10Supported()
+meth public abstract boolean isEE11Supported()
+meth public abstract boolean isEE12Supported()
meth public abstract boolean isEE7Supported()
meth public abstract boolean isEE8Supported()
meth public abstract boolean isEE9Supported()
@@ -1517,6 +1521,8 @@ meth public boolean equals(org.netbeans.modules.payara.tooling.data.PayaraVersio
meth public boolean equalsMajorMinor(org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI)
meth public boolean equalsMajorMinor(org.netbeans.modules.payara.tooling.data.PayaraVersion)
meth public boolean isEE10Supported()
+meth public boolean isEE11Supported()
+meth public boolean isEE12Supported()
meth public boolean isEE7Supported()
meth public boolean isEE8Supported()
meth public boolean isEE9Supported()
@@ -1857,6 +1863,8 @@ fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEE
fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v10_0_0_web
fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v11_0_0
fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v11_0_0_web
+fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v12_0_0
+fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v12_0_0_web
fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v1_2
fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v1_3
fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v1_4
@@ -1898,6 +1906,7 @@ CLSS public final static !enum org.netbeans.modules.payara.tooling.server.config
outer org.netbeans.modules.payara.tooling.server.config.JavaEEProfile
fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v10_0_0
fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v11_0_0
+fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v12_0_0
fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v1_2
fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v1_3
fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v1_4
diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersion.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersion.java
index da9722700ef3..7d7599ef54a5 100644
--- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersion.java
+++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersion.java
@@ -348,6 +348,16 @@ public boolean isEE9Supported() {
public boolean isEE10Supported() {
return major >= 6;
}
+
+ @Override
+ public boolean isEE11Supported() {
+ return major >= 7;
+ }
+
+ @Override
+ public boolean isEE12Supported() {
+ return major >= 8;
+ }
// Methods //
/**
diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersionAPI.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersionAPI.java
index 7e234b357062..ef946ac2016d 100644
--- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersionAPI.java
+++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersionAPI.java
@@ -82,6 +82,10 @@ public interface PayaraPlatformVersionAPI {
public boolean isEE10Supported();
+ public boolean isEE11Supported();
+
+ public boolean isEE12Supported();
+
/**
* Compare major and minor parts of version number Strings.
*
diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraVersion.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraVersion.java
index d54cf5fe2a3c..88e809bd2308 100644
--- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraVersion.java
+++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraVersion.java
@@ -526,6 +526,16 @@ public boolean isEE9Supported() {
public boolean isEE10Supported() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
+
+ @Override
+ public boolean isEE11Supported() {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public boolean isEE12Supported() {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
@Override
public boolean equalsMajorMinor(PayaraPlatformVersionAPI version) {
diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java
index fbe35080d570..30361fcb6229 100644
--- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java
+++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java
@@ -87,7 +87,13 @@ public enum JavaEEProfile {
v11_0_0_web(Version.v11_0_0, Type.WEB, "11.0.0-web"),
/** JakartaEE 11 full profile. */
- v11_0_0(Version.v11_0_0, Type.FULL, "11.0.0");
+ v11_0_0(Version.v11_0_0, Type.FULL, "11.0.0"),
+
+ /** JakartaEE 12 web profile. */
+ v12_0_0_web(Version.v11_0_0, Type.WEB, "12.0.0-web"),
+
+ /** JakartaEE 12 full profile. */
+ v12_0_0(Version.v12_0_0, Type.FULL, "12.0.0");
// Inner enums //
/** JavaEE profile type. */
@@ -146,7 +152,9 @@ public enum Version {
/** JakartaEE 10.0 */
v10_0_0("10.0.0"),
/** JakartaEE 11.0 */
- v11_0_0("11.0.0");
+ v11_0_0("11.0.0"),
+ /** JakartaEE 12.0 */
+ v12_0_0("12.0.0");
/** JavaEE profile type name. */
private final String name;
diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml
index b003efb894ed..aab65c99de68 100644
--- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml
+++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml
@@ -84,7 +84,7 @@ under the License.
-
+
diff --git a/enterprise/servletjspapi/build.xml b/enterprise/servletjspapi/build.xml
index 644f176b6616..1b1a85691722 100755
--- a/enterprise/servletjspapi/build.xml
+++ b/enterprise/servletjspapi/build.xml
@@ -26,7 +26,7 @@
-
+
@@ -38,7 +38,7 @@
-
+
@@ -108,15 +108,15 @@
-
+
-
+
-
-
-
+
+
+
@@ -140,8 +140,10 @@
-
+
+
+
@@ -156,6 +158,8 @@
+
+
@@ -163,41 +167,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+ zipfile="./external/generated-servlet-jsp-api-6.2_4.1.jar" />
diff --git a/enterprise/servletjspapi/external/binaries-list b/enterprise/servletjspapi/external/binaries-list
index 2c9c767e6656..badab3c39348 100755
--- a/enterprise/servletjspapi/external/binaries-list
+++ b/enterprise/servletjspapi/external/binaries-list
@@ -15,10 +15,10 @@
# specific language governing permissions and limitations
# under the License.
-A8DE3741B91BA7427306104979AB2F084E831438 jakarta.servlet.jsp:jakarta.servlet.jsp-api:4.0.0
-1169A246913FE3823782AF7943E7A103634867C5 jakarta.servlet:jakarta.servlet-api:6.1.0
-C7C4A2EB1E40E0FF45AB5E2E52BD77D8C7A75176 jakarta.el:jakarta.el-api:6.0.1
+1C3755124F74EF13E668FD8BD5FB34B1F4E072A8 jakarta.servlet.jsp:jakarta.servlet.jsp-api:4.1.0-M1
+78775662980AF75BE87A543A86AE1D12C01B3401 jakarta.servlet:jakarta.servlet-api:6.2.0-M1
+F566CE11E236B36C0EF1C1ED1FACFA505863B3DF jakarta.el:jakarta.el-api:6.1.0-M1
EE48550ECE1AF1E0D8BD4877DBC6DA5C29C5496B jakarta.servlet.jsp:jakarta.servlet.jsp-api:2.3.6
B8A1142E04838FE54194049C6E7A18DAE8F9B960 jakarta.servlet:jakarta.servlet-api:4.0.4
F311AB94BB1D4380690A53D737226A6B879DD4F1 jakarta.el:jakarta.el-api:3.0.3
-1E77F50E244682173C27F661287629ADB83FE2D2 org.glassfish.main.appclient:gf-client-module:7.0.25
\ No newline at end of file
+EC9C390DB67BF79957E283027AB2B38018FF3AF3 org.glassfish.main.appclient:gf-client-module:9.0.0-M1
\ No newline at end of file
diff --git a/enterprise/servletjspapi/external/generated-servlet-jsp-api-6.1_3.0-license.txt b/enterprise/servletjspapi/external/generated-servlet-jsp-api-6.2_4.1-license.txt
similarity index 99%
rename from enterprise/servletjspapi/external/generated-servlet-jsp-api-6.1_3.0-license.txt
rename to enterprise/servletjspapi/external/generated-servlet-jsp-api-6.2_4.1-license.txt
index f0b1396074b8..852433aa508c 100644
--- a/enterprise/servletjspapi/external/generated-servlet-jsp-api-6.1_3.0-license.txt
+++ b/enterprise/servletjspapi/external/generated-servlet-jsp-api-6.2_4.1-license.txt
@@ -1,6 +1,6 @@
Name: Java API for Jakarta Servlets, Java API for Jakarta Server Pages
License: EPL-v20
-Version: 6.1_3.0
+Version: 6.2_4.1
Type: generated
Description: Java API for Jakarta Servlets, Java API for Jakarta Server Pages, Java API for Jakarta Expression Language
Origin: Eclipse Foundation (https://projects.eclipse.org/projects/ee4j)
diff --git a/enterprise/servletjspapi/external/servlet-jsp-api-6.1_3.0-license.txt b/enterprise/servletjspapi/external/servlet-jsp-api-6.2_4.1-license.txt
similarity index 98%
rename from enterprise/servletjspapi/external/servlet-jsp-api-6.1_3.0-license.txt
rename to enterprise/servletjspapi/external/servlet-jsp-api-6.2_4.1-license.txt
index fce22be444d5..1f966768785e 100644
--- a/enterprise/servletjspapi/external/servlet-jsp-api-6.1_3.0-license.txt
+++ b/enterprise/servletjspapi/external/servlet-jsp-api-6.2_4.1-license.txt
@@ -1,10 +1,10 @@
Name: Java API for Jakarta Servlets, Java API for Jakarta Server Pages
License: EPL-v20
-Version: 6.1_3.0
+Version: 6.2_4.1
Type: generated
Description: Java API for Jakarta Servlets, Java API for Jakarta Server Pages, Java API for Jakarta Expression Language
Origin: Eclipse Foundation (https://projects.eclipse.org/projects/ee4j)
-Files: gf-client-module-7.0.25.jar, jakarta.el-api-3.0.3.jar, jakarta.servlet-api-4.0.4.jar, jakarta.servlet.jsp-api-2.3.6.jar, jakarta.el-api-6.0.1.jar, jakarta.servlet-api-6.1.0.jar, jakarta.servlet.jsp-api-4.0.0.jar
+Files: gf-client-module-9.0.0-M1.jar, jakarta.el-api-3.0.3.jar, jakarta.servlet-api-4.0.4.jar, jakarta.servlet.jsp-api-2.3.6.jar, jakarta.el-api-6.1.0-M1.jar, jakarta.servlet-api-6.2.0-M1.jar, jakarta.servlet.jsp-api-4.1.0-M1.jar
Eclipse Public License - v 2.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
diff --git a/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig b/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig
index 420bc579095d..178aa9b43419 100644
--- a/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig
+++ b/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig
@@ -1,5 +1,5 @@
#Signature file v4.1
-#Version 1.62.0
+#Version 1.63.0
CLSS public jakarta.el.ArrayELResolver
cons public init()
@@ -139,6 +139,7 @@ hfds elManager,factory
CLSS public abstract jakarta.el.ELResolver
cons public init()
+innr public static StandaloneIdentifierMarker
meth public <%0 extends java.lang.Object> {%%0} convertToType(jakarta.el.ELContext,java.lang.Object,java.lang.Class<{%%0}>)
meth public abstract boolean isReadOnly(jakarta.el.ELContext,java.lang.Object,java.lang.Object)
meth public abstract java.lang.Class> getCommonPropertyType(jakarta.el.ELContext,java.lang.Object)
@@ -148,6 +149,10 @@ meth public abstract void setValue(jakarta.el.ELContext,java.lang.Object,java.la
meth public java.lang.Object invoke(jakarta.el.ELContext,java.lang.Object,java.lang.Object,java.lang.Class>[],java.lang.Object[])
supr java.lang.Object
+CLSS public static jakarta.el.ELResolver$StandaloneIdentifierMarker
+ outer jakarta.el.ELResolver
+supr java.lang.Object
+
CLSS public abstract jakarta.el.EvaluationListener
cons public init()
meth public void afterEvaluation(jakarta.el.ELContext,java.lang.String)
@@ -1223,6 +1228,7 @@ fld public final static int SC_BAD_REQUEST = 400
fld public final static int SC_CONFLICT = 409
fld public final static int SC_CONTINUE = 100
fld public final static int SC_CREATED = 201
+fld public final static int SC_EARLY_HINTS = 103
fld public final static int SC_EXPECTATION_FAILED = 417
fld public final static int SC_FORBIDDEN = 403
fld public final static int SC_FOUND = 302
@@ -1274,6 +1280,7 @@ meth public abstract void addCookie(jakarta.servlet.http.Cookie)
meth public abstract void addDateHeader(java.lang.String,long)
meth public abstract void addHeader(java.lang.String,java.lang.String)
meth public abstract void addIntHeader(java.lang.String,int)
+meth public abstract void sendEarlyHints()
meth public abstract void sendError(int) throws java.io.IOException
meth public abstract void sendError(int,java.lang.String) throws java.io.IOException
meth public abstract void sendRedirect(java.lang.String,int,boolean) throws java.io.IOException
@@ -1302,6 +1309,7 @@ meth public void addCookie(jakarta.servlet.http.Cookie)
meth public void addDateHeader(java.lang.String,long)
meth public void addHeader(java.lang.String,java.lang.String)
meth public void addIntHeader(java.lang.String,int)
+meth public void sendEarlyHints()
meth public void sendError(int) throws java.io.IOException
meth public void sendError(int,java.lang.String) throws java.io.IOException
meth public void sendRedirect(java.lang.String) throws java.io.IOException
@@ -1922,7 +1930,6 @@ meth public void mark(int)
meth public void reset() throws java.io.IOException
meth public void skipNBytes(long) throws java.io.IOException
supr java.lang.Object
-hfds DEFAULT_BUFFER_SIZE,MAX_BUFFER_SIZE,MAX_SKIP_BUFFER_SIZE
CLSS public abstract java.io.OutputStream
cons public init()
@@ -1957,7 +1964,6 @@ meth public void write(int) throws java.io.IOException
meth public void write(java.lang.String) throws java.io.IOException
meth public void write(java.lang.String,int,int) throws java.io.IOException
supr java.lang.Object
-hfds WRITE_BUFFER_SIZE,writeBuffer
CLSS public abstract interface java.lang.Appendable
meth public abstract java.lang.Appendable append(char) throws java.io.IOException
@@ -1998,7 +2004,6 @@ meth public final java.util.Optional
meth public java.lang.String toString()
meth public static <%0 extends java.lang.Enum<{%%0}>> {%%0} valueOf(java.lang.Class<{%%0}>,java.lang.String)
supr java.lang.Object
-hfds name,ordinal
CLSS public java.lang.Exception
cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean)
@@ -2007,7 +2012,6 @@ cons public init(java.lang.String)
cons public init(java.lang.String,java.lang.Throwable)
cons public init(java.lang.Throwable)
supr java.lang.Throwable
-hfds serialVersionUID
CLSS public java.lang.Object
cons public init()
@@ -2031,7 +2035,6 @@ cons public init(java.lang.String)
cons public init(java.lang.String,java.lang.Throwable)
cons public init(java.lang.Throwable)
supr java.lang.Exception
-hfds serialVersionUID
CLSS public java.lang.Throwable
cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean)
@@ -2054,8 +2057,6 @@ meth public void printStackTrace(java.io.PrintStream)
meth public void printStackTrace(java.io.PrintWriter)
meth public void setStackTrace(java.lang.StackTraceElement[])
supr java.lang.Object
-hfds CAUSE_CAPTION,EMPTY_THROWABLE_ARRAY,NULL_CAUSE_MESSAGE,SELF_SUPPRESSION_MESSAGE,SUPPRESSED_CAPTION,SUPPRESSED_SENTINEL,UNASSIGNED_STACK,backtrace,cause,depth,detailMessage,serialVersionUID,stackTrace,suppressedExceptions
-hcls PrintStreamOrWriter,SentinelHolder,WrappedPrintStream,WrappedPrintWriter
CLSS public abstract interface java.lang.annotation.Annotation
meth public abstract boolean equals(java.lang.Object)
@@ -2101,7 +2102,6 @@ intf java.io.Serializable
meth public java.lang.Object getSource()
meth public java.lang.String toString()
supr java.lang.Object
-hfds serialVersionUID
CLSS public javax.el.ArrayELResolver
cons public init()
diff --git a/enterprise/servletjspapi/nbproject/project.properties b/enterprise/servletjspapi/nbproject/project.properties
index 70ebd3332482..0f5660cd60e3 100644
--- a/enterprise/servletjspapi/nbproject/project.properties
+++ b/enterprise/servletjspapi/nbproject/project.properties
@@ -21,5 +21,5 @@ javac.release=17
spec.version.base=1.63.0
release.external/generated-servlet-jsp-api-4.0_2.3.jar=modules/ext/servlet4.0-jsp2.3-api.jar
-release.external/generated-servlet-jsp-api-6.1_3.0.jar=modules/ext/servlet-jsp-api-6.1_3.0.jar
-extra.module.files=modules/ext/servlet4.0-jsp2.3-api.jar,modules/ext/servlet-jsp-api-6.1_3.0.jar
+release.external/generated-servlet-jsp-api-6.2_4.1.jar=modules/ext/servlet-jsp-api-6.2_4.1.jar
+extra.module.files=modules/ext/servlet4.0-jsp2.3-api.jar,modules/ext/servlet-jsp-api-6.2_4.1.jar
diff --git a/enterprise/servletjspapi/nbproject/project.xml b/enterprise/servletjspapi/nbproject/project.xml
index 940a285c0adf..bb9dd5288103 100644
--- a/enterprise/servletjspapi/nbproject/project.xml
+++ b/enterprise/servletjspapi/nbproject/project.xml
@@ -48,8 +48,8 @@
external/generated-servlet-jsp-api-4.0_2.3.jar
- ext/servlet-jsp-api-6.1_3.0.jar
- external/generated-servlet-jsp-api-6.1_3.0.jar
+ ext/servlet-jsp-api-6.2_4.1.jar
+ external/generated-servlet-jsp-api-6.2_4.1.jar
diff --git a/enterprise/servletjspapi/src/org/netbeans/modules/servletjspapi/Bundle.properties b/enterprise/servletjspapi/src/org/netbeans/modules/servletjspapi/Bundle.properties
index fba8184c56f2..0732d4e2ec98 100644
--- a/enterprise/servletjspapi/src/org/netbeans/modules/servletjspapi/Bundle.properties
+++ b/enterprise/servletjspapi/src/org/netbeans/modules/servletjspapi/Bundle.properties
@@ -17,6 +17,6 @@
OpenIDE-Module-Name=Servlet/JSP API
OpenIDE-Module-Display-Category=Libraries
-OpenIDE-Module-Short-Description=Servlet 6.1/JSP 4.0 API Library
+OpenIDE-Module-Short-Description=Servlet 6.2/JSP 4.1 API Library
OpenIDE-Module-Long-Description=\
- Servlet 6.1/JSP 4.0 API Library
+ Servlet 6.2/JSP 4.1 API Library
diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java
index fed38bcb1714..b6dfe38b4b56 100644
--- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java
+++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java
@@ -526,6 +526,10 @@ public boolean isJpa31() {
public boolean isJpa32() {
return false;
}
+
+ public boolean isJpa40() {
+ return false;
+ }
public boolean isJpa22() {
return isTomEE8();
diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java
index 55898ab5a52b..d7f40ba519cd 100644
--- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java
+++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java
@@ -53,7 +53,8 @@ public JpaProvider getDefaultProvider() {
instance.isJpa22(),
instance.isJpa30(),
instance.isJpa31(),
- instance.isJpa32());
+ instance.isJpa32(),
+ instance.isJpa40());
}
@Override
@@ -68,7 +69,8 @@ public Set getProviders() {
instance.isJpa22(),
instance.isJpa30(),
instance.isJpa31(),
- instance.isJpa32()));
+ instance.isJpa32(),
+ instance.isJpa40()));
// TomEE PluME has Eclipselink and OpenJPA
if (instance.isTomEEplume()) {
providers.add(JpaProviderFactory.createJpaProvider(
@@ -80,7 +82,8 @@ public Set getProviders() {
instance.isJpa22(),
instance.isJpa30(),
instance.isJpa31(),
- instance.isJpa32()));
+ instance.isJpa32(),
+ instance.isJpa40()));
}
return providers;
}
diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java
index 90159b2a299c..8e04ba8d7b7e 100644
--- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java
+++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java
@@ -561,7 +561,7 @@ public Set getSupportedJavaPlatformVersions() {
if (manager.isTomEE()) {
switch (manager.getTomEEVersion()) {
case TOMEE_100:
- versions = versionRange(17, 26);
+ versions = versionRange(17, 27);
break;
case TOMEE_90:
versions = versionRange(11, 23);
@@ -584,20 +584,20 @@ public Set getSupportedJavaPlatformVersions() {
} else {
switch (manager.getTomcatVersion()) {
case TOMCAT_110:
- versions = versionRange(17, 26);
+ versions = versionRange(17, 27);
break;
case TOMCAT_101:
- versions = versionRange(11, 26);
+ versions = versionRange(11, 27);
break;
case TOMCAT_100:
case TOMCAT_90:
- versions = versionRange(8, 26);
+ versions = versionRange(8, 27);
break;
case TOMCAT_80:
- versions = versionRange(7, 26);
+ versions = versionRange(7, 27);
break;
case TOMCAT_70:
- versions = versionRange(6, 26);
+ versions = versionRange(6, 27);
break;
case TOMCAT_60:
versions = versionRange(5, 8);
diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java
index 7c47b14fd520..a55e0b0623b6 100644
--- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java
+++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java
@@ -20,9 +20,7 @@
package org.netbeans.modules.tomcat5.util;
import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
import java.io.File;
-import java.io.FilenameFilter;
import java.io.IOException;
import java.io.OutputStream;
import java.net.MalformedURLException;
@@ -419,7 +417,7 @@ public void setJavaOpts(String javaOpts) {
public boolean getSecManager() {
String val = ip.getProperty(PROP_SEC_MANAGER);
- return val != null ? Boolean.valueOf(val)
+ return val != null ? Boolean.parseBoolean(val)
: DEF_VALUE_SEC_MANAGER;
}
@@ -430,7 +428,7 @@ public void setSecManager(boolean enabled) {
public boolean getCustomScript() {
String val = ip.getProperty(PROP_CUSTOM_SCRIPT);
- return val != null ? Boolean.valueOf(val)
+ return val != null ? Boolean.parseBoolean(val)
: DEF_VALUE_CUSTOM_SCRIPT;
}
@@ -453,7 +451,7 @@ public boolean getForceStop() {
return false;
}
String val = ip.getProperty(PROP_FORCE_STOP);
- return val != null ? Boolean.valueOf(val)
+ return val != null ? Boolean.parseBoolean(val)
: DEF_VALUE_FORCE_STOP;
}
@@ -476,7 +474,7 @@ public void setDebugType(String type) {
public boolean getMonitor() {
String val = ip.getProperty(PROP_MONITOR);
- return val != null ? Boolean.valueOf(val)
+ return val != null ? Boolean.parseBoolean(val)
: DEF_VALUE_MONITOR;
}
@@ -486,7 +484,7 @@ public void setMonitor(boolean enabled) {
public boolean getProxyEnabled() {
String val = ip.getProperty(PROP_PROXY_ENABLED);
- return val != null ? Boolean.valueOf(val)
+ return val != null ? Boolean.parseBoolean(val)
: DEF_VALUE_PROXY_ENABLED;
}
@@ -647,7 +645,7 @@ public void setDriverDeployment(boolean enabled) {
ip.setProperty(PROP_DRIVER_DEPLOYMENT, Boolean.toString(enabled));
}
- public List/**/ getClasses() {
+ public List getClasses() {
String[] nbFilter = new String[] {
"httpmonitor",
"schema2beans",
diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java
index 6b9bcdabd3aa..0e1b180517dc 100644
--- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java
+++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java
@@ -77,7 +77,9 @@ public Set instantiate(TemplateWizard wizard) throws IOException {
Profile profile = null;
if (project != null) {
J2eeProjectCapabilities cap = J2eeProjectCapabilities.forProject(project);
- if (cap != null && cap.isCdi41Supported()) {
+ if (cap != null && cap.isCdi50Supported()) {
+ profile = Profile.JAKARTA_EE_12_FULL;
+ } else if (cap != null && cap.isCdi41Supported()) {
profile = Profile.JAKARTA_EE_11_FULL;
} else if (cap != null && cap.isCdi40Supported()) {
profile = Profile.JAKARTA_EE_10_FULL;
@@ -89,7 +91,7 @@ public Set instantiate(TemplateWizard wizard) throws IOException {
profile = Profile.JAVA_EE_7_FULL;
}
}
- FileObject fo = DDHelper.createBeansXml(profile != null ? profile : Profile.JAVA_EE_6_FULL, targetDir, targetName);
+ FileObject fo = DDHelper.createBeansXml(profile != null ? profile : Profile.JAKARTA_EE_8_FULL, targetDir, targetName);
if (fo != null) {
if ( project != null ){
CdiUtil logger = project.getLookup().lookup( CdiUtil.class );
diff --git a/enterprise/web.core.syntax/nbproject/project.properties b/enterprise/web.core.syntax/nbproject/project.properties
index 1375cbd67f94..52324fe12342 100644
--- a/enterprise/web.core.syntax/nbproject/project.properties
+++ b/enterprise/web.core.syntax/nbproject/project.properties
@@ -74,7 +74,7 @@ test-unit-sys-prop.jsp.parser.jars-jakarta=\
${o.apache.tools.ant.module.dir}/ant/lib/ant.jar:\
${web.jspparser.dir}/modules/ext/glassfish-jspparser-7.0.25.jar:\
${servletjspapi.dir}/modules/ext/jsp-parser-ext-jakarta.jar:\
- ${servletjspapi.dir}/modules/ext/servlet-jsp-api-6.1_3.0.jar:\
+ ${servletjspapi.dir}/modules/ext/servlet-jsp-api-6.2_4.1.jar:\
${o.apache.tools.ant.module.dir}/ant/lib/ant-launcher.jar
test-unit-sys-prop.web.project.jars=\
diff --git a/enterprise/web.core/licenseinfo.xml b/enterprise/web.core/licenseinfo.xml
index c4ea4d098b44..184bd31ed4c2 100644
--- a/enterprise/web.core/licenseinfo.xml
+++ b/enterprise/web.core/licenseinfo.xml
@@ -107,6 +107,8 @@
src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_1.mddsrc/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.xsdsrc/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.mdd
+ src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.xsd
+ src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.mdd
Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
diff --git a/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.mdd b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.mdd
new file mode 100644
index 000000000000..ad9a3ae3eb4d
--- /dev/null
+++ b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.mdd
@@ -0,0 +1,745 @@
+
+
+
+
+ taglib
+ https://jakarta.ee/xml/ns/jakartaee
+ Taglib
+
+ Description
+
+
+ DisplayName
+
+
+ Icon
+
+
+ TlibVersion
+
+
+ ShortName
+
+
+ Uri
+
+
+ Validator
+
+
+ Listener
+
+
+ Tag
+
+
+ TagFile
+
+
+ Function
+
+
+ TaglibExtension
+
+
+
+ dewey-versionType
+ https://jakarta.ee/xml/ns/jakartaee
+ DeweyVersionType
+ java.math.BigDecimal
+
+
+ tld-canonical-nameType
+ https://jakarta.ee/xml/ns/jakartaee
+ TldCanonicalNameType
+ java.lang.String
+
+
+ xsdAnyURIType
+ https://jakarta.ee/xml/ns/jakartaee
+ XsdAnyURIType
+ java.lang.String
+
+
+ validatorType
+ https://jakarta.ee/xml/ns/jakartaee
+ ValidatorType
+
+ Description
+
+
+ ValidatorClass
+
+
+ InitParam
+
+
+
+ listenerType
+ https://jakarta.ee/xml/ns/jakartaee
+ ListenerType
+
+ Description
+
+
+ DisplayName
+
+
+ Icon
+
+
+ ListenerClass
+
+
+
+ tagType
+ https://jakarta.ee/xml/ns/jakartaee
+ TagType
+
+ Description
+
+
+ DisplayName
+
+
+ Icon
+
+
+ Name
+
+
+ TagClass
+
+
+ TeiClass
+
+
+ BodyContent
+
+
+ Variable
+
+
+ Attribute
+
+
+ DynamicAttributes
+
+
+ Example
+
+
+ TagExtension
+
+
+
+ tagFileType
+ https://jakarta.ee/xml/ns/jakartaee
+ TagFileType
+
+ Description
+
+
+ DisplayName
+
+
+ Icon
+
+
+ Name
+
+
+ Path
+
+
+ Example
+
+
+ TagExtension
+
+
+
+ functionType
+ https://jakarta.ee/xml/ns/jakartaee
+ FunctionType
+
+ Description
+
+
+ DisplayName
+
+
+ Icon
+
+
+ Name
+
+
+ FunctionClass
+
+
+ FunctionSignature
+
+
+ Example
+
+
+ FunctionExtension
+
+
+
+ tld-extensionType
+ https://jakarta.ee/xml/ns/jakartaee
+ TldExtensionType
+
+ ExtensionElement
+
+
+
+ extensibleType
+ https://jakarta.ee/xml/ns/jakartaee
+ ExtensibleType
+
+
+ fully-qualified-classType
+ https://jakarta.ee/xml/ns/jakartaee
+ FullyQualifiedClassType
+ java.lang.String
+
+
+ string
+ https://jakarta.ee/xml/ns/jakartaee
+ String
+ java.lang.String
+
+
+ xsdStringType
+ https://jakarta.ee/xml/ns/jakartaee
+ XsdStringType
+ java.lang.String
+
+
+ descriptionType
+ https://jakarta.ee/xml/ns/jakartaee
+ DescriptionType
+ java.lang.String
+
+
+ display-nameType
+ https://jakarta.ee/xml/ns/jakartaee
+ DisplayNameType
+ java.lang.String
+
+
+ iconType
+ https://jakarta.ee/xml/ns/jakartaee
+ IconType
+
+ SmallIcon
+
+
+ LargeIcon
+
+
+
+ pathType
+ https://jakarta.ee/xml/ns/jakartaee
+ PathType
+ java.lang.String
+
+
+ body-contentType
+ https://jakarta.ee/xml/ns/jakartaee
+ BodyContentType
+ java.lang.String
+
+
+ variableType
+ https://jakarta.ee/xml/ns/jakartaee
+ VariableType
+
+ Description
+
+
+ NameGiven
+
+
+ NameFromAttribute
+
+
+ VariableClass
+
+
+ Declare
+
+
+ Scope
+
+
+
+ tld-attributeType
+ https://jakarta.ee/xml/ns/jakartaee
+ TldAttributeType
+
+ Description
+
+
+ Name
+
+
+ Required
+
+
+ Rtexprvalue
+
+
+ Type
+
+
+ Fragment
+
+
+
+ generic-booleanType
+ https://jakarta.ee/xml/ns/jakartaee
+ GenericBooleanType
+ java.lang.String
+
+
+ java-identifierType
+ https://jakarta.ee/xml/ns/jakartaee
+ JavaIdentifierType
+ java.lang.String
+
+
+ variable-scopeType
+ https://jakarta.ee/xml/ns/jakartaee
+ VariableScopeType
+ java.lang.String
+
+
+ param-valueType
+ https://jakarta.ee/xml/ns/jakartaee
+ ParamValueType
+
+ Description
+
+
+ ParamName
+
+
+ ParamValue
+
+
+
+ emptyType
+ https://jakarta.ee/xml/ns/jakartaee
+ EmptyType
+
+
+ ejb-refType
+ https://jakarta.ee/xml/ns/jakartaee
+ EjbRefType
+
+ Description
+
+
+ EjbRefName
+
+
+ EjbRefType
+
+
+ Home
+
+
+ Remote
+
+
+ EjbLink
+
+
+
+ remoteType
+ https://jakarta.ee/xml/ns/jakartaee
+ RemoteType
+ java.lang.String
+
+
+ res-sharing-scopeType
+ https://jakarta.ee/xml/ns/jakartaee
+ ResSharingScopeType
+ java.lang.String
+
+
+ xsdIntegerType
+ https://jakarta.ee/xml/ns/jakartaee
+ XsdIntegerType
+ java.math.BigInteger
+
+
+ resource-env-refType
+ https://jakarta.ee/xml/ns/jakartaee
+ ResourceEnvRefType
+
+ Description
+
+
+ ResourceEnvRefName
+
+
+ ResourceEnvRefType
+
+
+
+ message-destinationType
+ https://jakarta.ee/xml/ns/jakartaee
+ MessageDestinationType
+
+ Description
+
+
+ DisplayName
+
+
+ Icon
+
+
+ MessageDestinationName
+
+
+
+ xsdBooleanType
+ https://jakarta.ee/xml/ns/jakartaee
+ XsdBooleanType
+ boolean
+
+
+ run-asType
+ https://jakarta.ee/xml/ns/jakartaee
+ RunAsType
+
+ Description
+
+
+ RoleName
+
+
+
+ localType
+ https://jakarta.ee/xml/ns/jakartaee
+ LocalType
+ java.lang.String
+
+
+ port-component-refType
+ https://jakarta.ee/xml/ns/jakartaee
+ PortComponentRefType
+
+ ServiceEndpointInterface
+
+
+ PortComponentLink
+
+
+
+ message-destination-refType
+ https://jakarta.ee/xml/ns/jakartaee
+ MessageDestinationRefType
+
+ Description
+
+
+ MessageDestinationRefName
+
+
+ MessageDestinationType
+
+
+ MessageDestinationUsage
+
+
+ MessageDestinationLink
+
+
+
+ ejb-ref-nameType
+ https://jakarta.ee/xml/ns/jakartaee
+ EjbRefNameType
+ java.lang.String
+
+
+ local-homeType
+ https://jakarta.ee/xml/ns/jakartaee
+ LocalHomeType
+ java.lang.String
+
+
+ resource-refType
+ https://jakarta.ee/xml/ns/jakartaee
+ ResourceRefType
+
+ Description
+
+
+ ResRefName
+
+
+ ResType
+
+
+ ResAuth
+
+
+ ResSharingScope
+
+
+
+ xsdNMTOKENType
+ https://jakarta.ee/xml/ns/jakartaee
+ XsdNMTOKENType
+ java.lang.String
+
+
+ ejb-local-refType
+ https://jakarta.ee/xml/ns/jakartaee
+ EjbLocalRefType
+
+ Description
+
+
+ EjbRefName
+
+
+ EjbRefType
+
+
+ LocalHome
+
+
+ Local
+
+
+ EjbLink
+
+
+
+ ejb-ref-typeType
+ https://jakarta.ee/xml/ns/jakartaee
+ EjbRefTypeType
+ java.lang.String
+
+
+ message-destination-typeType
+ https://jakarta.ee/xml/ns/jakartaee
+ MessageDestinationTypeType
+ java.lang.String
+
+
+ xsdPositiveIntegerType
+ https://jakarta.ee/xml/ns/jakartaee
+ XsdPositiveIntegerType
+ long
+
+
+ xsdNonNegativeIntegerType
+ https://jakarta.ee/xml/ns/jakartaee
+ XsdNonNegativeIntegerType
+ java.math.BigInteger
+
+
+ xsdQNameType
+ https://jakarta.ee/xml/ns/jakartaee
+ XsdQNameType
+ java.lang.String
+
+
+ res-authType
+ https://jakarta.ee/xml/ns/jakartaee
+ ResAuthType
+ java.lang.String
+
+
+ jndi-nameType
+ https://jakarta.ee/xml/ns/jakartaee
+ JndiNameType
+ java.lang.String
+
+
+ url-patternType
+ https://jakarta.ee/xml/ns/jakartaee
+ UrlPatternType
+ java.lang.String
+
+
+ security-roleType
+ https://jakarta.ee/xml/ns/jakartaee
+ SecurityRoleType
+
+ Description
+
+
+ RoleName
+
+
+
+ env-entry-type-valuesType
+ https://jakarta.ee/xml/ns/jakartaee
+ EnvEntryTypeValuesType
+ java.lang.String
+
+
+ ejb-linkType
+ https://jakarta.ee/xml/ns/jakartaee
+ EjbLinkType
+ java.lang.String
+
+
+ service-refType
+ https://jakarta.ee/xml/ns/jakartaee
+ ServiceRefType
+
+ Description
+
+
+ DisplayName
+
+
+ Icon
+
+
+ ServiceRefName
+
+
+ ServiceInterface
+
+
+ WsdlFile
+
+
+ JaxrpcMappingFile
+
+
+ ServiceQname
+
+
+ PortComponentRef
+
+
+ Handler
+
+
+
+ java-typeType
+ https://jakarta.ee/xml/ns/jakartaee
+ JavaTypeType
+ java.lang.String
+
+
+ security-role-refType
+ https://jakarta.ee/xml/ns/jakartaee
+ SecurityRoleRefType
+
+ Description
+
+
+ RoleName
+
+
+ RoleLink
+
+
+
+ env-entryType
+ https://jakarta.ee/xml/ns/jakartaee
+ EnvEntryType
+
+ Description
+
+
+ EnvEntryName
+
+
+ EnvEntryType
+
+
+ EnvEntryValue
+
+
+
+ true-falseType
+ https://jakarta.ee/xml/ns/jakartaee
+ TrueFalseType
+ boolean
+
+
+ message-destination-linkType
+ https://jakarta.ee/xml/ns/jakartaee
+ MessageDestinationLinkType
+ java.lang.String
+
+
+ service-ref_handlerType
+ https://jakarta.ee/xml/ns/jakartaee
+ ServiceRefHandlerType
+
+ Description
+
+
+ DisplayName
+
+
+ Icon
+
+
+ HandlerName
+
+
+ HandlerClass
+
+
+ InitParam
+
+
+ SoapHeader
+
+
+ SoapRole
+
+
+ PortName
+
+
+
+ role-nameType
+ https://jakarta.ee/xml/ns/jakartaee
+ RoleNameType
+ java.lang.String
+
+
+ message-destination-usageType
+ https://jakarta.ee/xml/ns/jakartaee
+ MessageDestinationUsageType
+ java.lang.String
+
+
+ homeType
+ https://jakarta.ee/xml/ns/jakartaee
+ HomeType
+ java.lang.String
+
+
diff --git a/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.xsd b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.xsd
new file mode 100644
index 000000000000..db350a5c48c9
--- /dev/null
+++ b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.xsd
@@ -0,0 +1,1109 @@
+
+
+
+
+
+ Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v. 2.0, which is available at
+ http://www.eclipse.org/legal/epl-2.0.
+
+ This Source Code may also be made available under the following Secondary
+ Licenses when the conditions for such availability set forth in the
+ Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ version 2 with the GNU Classpath Exception, which is available at
+ https://www.gnu.org/software/classpath/license.html.
+
+ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+
+
+
+
+
+
+ ...
+
+
+ The instance documents may indicate the published
+ version of the schema using xsi:schemaLocation attribute
+ for Jakarta EE namespace with the following location:
+
+ https://jakarta.ee/xml/ns/jakartaee/web-jsptaglibrary_4_1.xsd
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ The taglib tag is the document root.
+ The definition of taglib is provided
+ by the tldTaglibType.
+
+
+
+
+
+
+
+ The taglib element contains, among other things, tag and
+ tag-file elements.
+ The name subelements of these elements must each be unique.
+
+
+
+
+
+
+
+
+
+
+ The taglib element contains function elements.
+ The name subelements of these elements must each be unique.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies the type of body that is valid for a tag.
+ This value is used by the JSP container to validate
+ that a tag invocation has the correct body syntax and
+ by page composition tools to assist the page author
+ in providing a valid tag body.
+
+ There are currently four values specified:
+
+ tagdependent The body of the tag is interpreted by the tag
+ implementation itself, and is most likely
+ in a different "language", e.g embedded SQL
+ statements.
+
+ JSP The body of the tag contains nested JSP
+ syntax.
+
+ empty The body must be empty
+
+ scriptless The body accepts only template text, EL
+ Expressions, and JSP action elements. No
+ scripting elements are allowed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines the canonical name of a tag or attribute being
+ defined.
+
+ The name must conform to the lexical rules for an NMTOKEN.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A validator that can be used to validate
+ the conformance of a JSP page to using this tag library is
+ defined by a validatorType.
+
+
+
+
+
+
+
+
+
+ Defines the TagLibraryValidator class that can be used
+ to validate the conformance of a JSP page to using this
+ tag library.
+
+
+
+
+
+
+
+
+ The init-param element contains a name/value pair as an
+ initialization param.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The tag defines a unique tag in this tag library. It has one
+ attribute, id.
+
+ The tag element may have several subelements defining:
+
+ description Optional tag-specific information
+
+ display-name A short name that is intended to be
+ displayed by tools
+
+ icon Optional icon element that can be used
+ by tools
+
+ name The unique action name
+
+ tag-class The tag handler class implementing
+ jakarta.servlet.jsp.tagext.JspTag
+
+ tei-class An optional subclass of
+ jakarta.servlet.jsp.tagext.TagExtraInfo
+
+ body-content The body content type
+
+ variable Optional scripting variable information
+
+ attribute All attributes of this action that are
+ evaluated prior to invocation.
+
+ dynamic-attributes Whether this tag supports additional
+ attributes with dynamic names. If
+ true, the tag-class must implement the
+ jakarta.servlet.jsp.tagext.DynamicAttributes
+ interface. Defaults to false.
+
+ example Optional informal description of an
+ example of a use of this tag
+
+ tag-extension Zero or more extensions that provide extra
+ information about this tag, for tool
+ consumption
+
+
+
+
+
+
+
+
+
+
+ Defines the subclass of jakarta.servlet.jsp.tagext.JspTag
+ that implements the request time semantics for
+ this tag. (required)
+
+
+
+
+
+
+
+
+ Defines the subclass of jakarta.servlet.jsp.tagext.TagExtraInfo
+ for this tag. (optional)
+
+ If this is not given, the class is not consulted at
+ translation time.
+
+
+
+
+
+
+
+
+ Specifies the format for the body of this tag.
+ The default in JSP 1.2 was "JSP" but because this
+ is an invalid setting for simple tag handlers, there
+ is no longer a default in JSP 2.0. A reasonable
+ default for simple tag handlers is "scriptless" if
+ the tag can have a body.
+
+
+
+
+
+
+
+
+
+
+
+ The example element contains an informal description
+ of an example of the use of a tag.
+
+
+
+
+
+
+
+
+ Tag extensions are for tool use only and must not affect
+ the behavior of a container.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines an action in this tag library that is implemented
+ as a .tag file.
+
+ The tag-file element has two required subelements:
+
+ description Optional tag-specific information
+
+ display-name A short name that is intended to be
+ displayed by tools
+
+ icon Optional icon element that can be used
+ by tools
+
+ name The unique action name
+
+ path Where to find the .tag file implementing this
+ action, relative to the root of the web
+ application or the root of the JAR file for a
+ tag library packaged in a JAR. This must
+ begin with /WEB-INF/tags if the .tag file
+ resides in the WAR, or /META-INF/tags if the
+ .tag file resides in a JAR.
+
+ example Optional informal description of an
+ example of a use of this tag
+
+ tag-extension Zero or more extensions that provide extra
+ information about this tag, for tool
+ consumption
+
+
+
+
+
+
+
+
+
+
+
+ The example element contains an informal description
+ of an example of the use of a tag.
+
+
+
+
+
+
+
+
+ Tag extensions are for tool use only and must not affect
+ the behavior of a container.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The function element is used to provide information on each
+ function in the tag library that is to be exposed to the EL.
+
+ The function element may have several subelements defining:
+
+ description Optional tag-specific information
+
+ display-name A short name that is intended to be
+ displayed by tools
+
+ icon Optional icon element that can be used
+ by tools
+
+ name A unique name for this function
+
+ function-class Provides the name of the Java class that
+ implements the function
+
+ function-signature Provides the signature, as in the Java
+ Language Specification, of the Java
+ method that is to be used to implement
+ the function.
+
+ example Optional informal description of an
+ example of a use of this function
+
+ function-extension Zero or more extensions that provide extra
+ information about this function, for tool
+ consumption
+
+
+
+
+
+
+
+
+
+ A unique name for this function.
+
+
+
+
+
+
+
+
+ Provides the fully-qualified class name of the Java
+ class containing the static method that implements
+ the function.
+
+
+
+
+
+
+
+
+ Provides the signature, of the static Java method that is
+ to be used to implement the function. The syntax of the
+ function-signature element is as follows:
+
+ FunctionSignature ::= ReturnType S MethodName S?
+ '(' S? Parameters? S? ')'
+
+ ReturnType ::= Type
+
+ MethodName ::= Identifier
+
+ Parameters ::= Parameter
+ | ( Parameter S? ',' S? Parameters )
+
+ Parameter ::= Type
+
+ Where:
+
+ * Type is a basic type or a fully qualified
+ Java class name (including package name),
+ as per the 'Type' production in the Java
+ Language Specification, Second Edition,
+ Chapter 18.
+
+ * Identifier is a Java identifier, as per
+ the 'Identifier' production in the Java
+ Language Specification, Second
+ Edition, Chapter 18.
+
+ Example:
+
+ java.lang.String nickName( java.lang.String, int )
+
+
+
+
+
+
+
+
+ The example element contains an informal description
+ of an example of the use of this function.
+
+
+
+
+
+
+
+
+ Function extensions are for tool use only and must not
+ affect the behavior of a container.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The taglib tag is the document root, it defines:
+
+ description a simple string describing the "use" of this
+ taglib, should be user discernable
+
+ display-name the display-name element contains a
+ short name that is intended to be displayed
+ by tools
+
+ icon optional icon that can be used by tools
+
+ tlib-version the version of the tag library implementation
+
+ short-name a simple default short name that could be
+ used by a JSP authoring tool to create
+ names with a mnemonic value; for example,
+ the it may be used as the prefered prefix
+ value in taglib directives
+
+ uri a uri uniquely identifying this taglib
+
+ validator optional TagLibraryValidator information
+
+ listener optional event listener specification
+
+ tag tags in this tag library
+
+ tag-file tag files in this tag library
+
+ function zero or more EL functions defined in this
+ tag library
+
+ taglib-extension zero or more extensions that provide extra
+ information about this taglib, for tool
+ consumption
+
+
+
+
+
+
+
+
+
+ Describes this version (number) of the taglibrary.
+ It is described as a dewey decimal.
+
+
+
+
+
+
+
+
+ Defines a simple default name that could be used by
+ a JSP authoring tool to create names with a
+ mnemonicvalue; for example, it may be used as the
+ preferred prefix value in taglib directives. Do
+ not use white space, and do not start with digits
+ or underscore.
+
+
+
+
+
+
+
+
+ Defines a public URI that uniquely identifies this
+ version of the taglibrary. Leave it empty if it
+ does not apply.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Taglib extensions are for tool use only and must not
+ affect the behavior of a container.
+
+
+
+
+
+
+
+
+
+ Describes the JSP version (number) this taglibrary
+ requires in order to function (dewey decimal)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The variableType provides information on the scripting
+ variables defined by using this tag. It is a (translation
+ time) error for a tag that has one or more variable
+ subelements to have a TagExtraInfo class that returns a
+ non-null value from a call to getVariableInfo().
+
+ The subelements of variableType are of the form:
+
+ description Optional description of this
+ variable
+
+ name-given The variable name as a constant
+
+ name-from-attribute The name of an attribute whose
+ (translation time) value will
+ give the name of the
+ variable. One of name-given or
+ name-from-attribute is required.
+
+ variable-class Name of the class of the variable.
+ java.lang.String is default.
+
+ declare Whether the variable is declared
+ or not. True is the default.
+
+ scope The scope of the scripting varaible
+ defined. NESTED is default.
+
+
+
+
+
+
+
+
+
+
+ The name for the scripting variable.
+
+
+
+
+
+
+
+
+ The name of an attribute whose
+ (translation-time) value will give the name of
+ the variable.
+
+
+
+
+
+
+
+
+
+ The optional name of the class for the scripting
+ variable. The default is java.lang.String.
+
+
+
+
+
+
+
+
+ Whether the scripting variable is to be defined
+ or not. See TagExtraInfo for details. This
+ element is optional and "true" is the default.
+
+
+
+
+
+
+
+
+ The element is optional and "NESTED" is the default.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This type defines scope of the scripting variable. See
+ TagExtraInfo for details. The allowed values are,
+ "NESTED", "AT_BEGIN" and "AT_END".
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The attribute element defines an attribute for the nesting
+ tag. The attribute element may have several subelements
+ defining:
+
+ description a description of the attribute
+
+ name the name of the attribute
+
+ required whether the attribute is required or
+ optional
+
+ rtexprvalue whether the attribute is a runtime attribute
+
+ type the type of the attributes
+
+ fragment whether this attribute is a fragment
+
+ deferred-value present if this attribute is to be parsed as a
+ jakarta.el.ValueExpression
+
+ deferred-method present if this attribute is to be parsed as a
+ jakarta.el.MethodExpression
+
+
+
+
+
+
+
+
+
+
+ Defines if the nesting attribute is required or
+ optional.
+
+ If not present then the default is "false", i.e
+ the attribute is optional.
+
+
+
+
+
+
+
+
+
+
+
+ Defines if the nesting attribute can have scriptlet
+ expressions as a value, i.e the value of the
+ attribute may be dynamically calculated at request
+ time, as opposed to a static value determined at
+ translation time.
+ If not present then the default is "false", i.e the
+ attribute has a static value
+
+
+
+
+
+
+
+
+ Defines the Java type of the attributes value.
+ If this element is omitted, the expected type is
+ assumed to be "java.lang.Object".
+
+
+
+
+
+
+
+
+
+
+ Present if the value for this attribute is to be
+ passed to the tag handler as a
+ jakarta.el.ValueExpression. This allows for deferred
+ evaluation of EL expressions. An optional subelement
+ will contain the expected type that the value will
+ be coerced to after evaluation of the expression.
+ The type defaults to Object if one is not provided.
+
+
+
+
+
+
+
+
+ Present if the value for this attribute is to be
+ passed to the tag handler as a
+ jakarta.el.MethodExpression. This allows for deferred
+ evaluation of an EL expression that identifies a
+ method to be invoked on an Object. An optional
+ subelement will contain the expected method
+ signature. The signature defaults to "void method()"
+ if one is not provided.
+
+
+
+
+
+
+
+
+
+
+ "true" if this attribute is of type
+ jakarta.servlet.jsp.tagext.JspFragment, representing dynamic
+ content that can be re-evaluated as many times
+ as needed by the tag handler. If omitted or "false",
+ the default is still type="java.lang.String"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines information about how to provide the value for a
+ tag handler attribute that accepts a jakarta.el.ValueExpression.
+
+ The deferred-value element has one optional subelement:
+
+ type the expected type of the attribute
+
+
+
+
+
+
+
+
+ The fully-qualified name of the Java type that is the
+ expected type for this deferred expression. If this
+ element is omitted, the expected type is assumed to be
+ "java.lang.Object".
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines information about how to provide the value for a
+ tag handler attribute that accepts a jakarta.el.MethodExpression.
+
+ The deferred-method element has one optional subelement:
+
+ method-signature Provides the signature, as in the Java
+ Language Specifies, that is expected for
+ the method being identified by the
+ expression.
+
+
+
+
+
+
+
+
+ Provides the expected signature of the method identified
+ by the jakarta.el.MethodExpression.
+
+ This disambiguates overloaded methods and ensures that
+ the return value is of the expected type.
+
+ The syntax of the method-signature element is identical
+ to that of the function-signature element. See the
+ documentation for function-signature for more details.
+
+ The name of the method is for documentation purposes only
+ and is ignored by the JSP container.
+
+ Example:
+
+ boolean validate(java.lang.String)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The tld-extensionType is used to indicate
+ extensions to a specific TLD element.
+
+ It is used by elements to designate an extension block
+ that is targeted to a specific extension designated by
+ a set of extension elements that are declared by a
+ namespace. The namespace identifies the extension to
+ the tool that processes the extension.
+
+ The type of the extension-element is abstract. Therefore,
+ a concrete type must be specified by the TLD using
+ xsi:type attribute for each extension-element.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The extensibleType is an abstract base type that is used to
+ define the type of extension-elements. Instance documents
+ must substitute a known type to define the extension by
+ using xsi:type attribute to define the actual type of
+ extension-elements.
+
+
+
+
+
+
+
diff --git a/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java b/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java
index d6f6ba78d5de..b912a518e2e3 100644
--- a/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java
+++ b/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java
@@ -207,6 +207,11 @@ private static boolean isJSF41(WebModule wm) {
ClassPath classpath = ClassPath.getClassPath(wm.getDocumentBase(), ClassPath.COMPILE);
return classpath != null && classpath.findResource("jakarta/faces/convert/UUIDConverter.class") != null; //NOI18N
}
+
+ private static boolean isJSF50(WebModule wm) {
+ ClassPath classpath = ClassPath.getClassPath(wm.getDocumentBase(), ClassPath.COMPILE);
+ return classpath != null && classpath.findResource("jakarta/faces/CurrentThreadToServletContext.class") != null; //NOI18N
+ }
public Set instantiate(TemplateWizard wiz) throws IOException {
// Here is the default plain behavior. Simply takes the selected
@@ -241,7 +246,9 @@ public Set instantiate(TemplateWizard wiz) throws IOException {
template = templateParent.getFileObject("JSP", "xhtml"); //NOI18N
WebModule wm = WebModule.getWebModule(df.getPrimaryFile());
if (wm != null) {
- if (isJSF41(wm)) {
+ if (isJSF50(wm)) {
+ wizardProps.put("isJSF50", Boolean.TRUE);
+ } else if (isJSF41(wm)) {
wizardProps.put("isJSF41", Boolean.TRUE);
} else if (isJSF40(wm)) {
wizardProps.put("isJSF40", Boolean.TRUE);
diff --git a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java
index f8b0b7c9561b..52bb12bbc7eb 100644
--- a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java
+++ b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java
@@ -125,7 +125,6 @@
import org.netbeans.api.xml.services.UserCatalog;
import org.netbeans.modules.web.jsf.editor.facelets.DefaultFaceletLibraries;
import org.netbeans.modules.web.jsfapi.api.JsfNamespaces;
-import org.openide.util.Exceptions;
import org.w3c.dom.*;
import org.w3c.dom.ls.LSInput;
import org.w3c.dom.ls.LSResourceResolver;
@@ -258,7 +257,7 @@ public class ConfigManager {
// initialize the resource providers for faces-config documents
List facesConfigProviders =
- new ArrayList(3);
+ new ArrayList(8);
facesConfigProviders.add(new MojarraFacesConfigResourceProvider());
facesConfigProviders.add(new MetaInfFacesConfigResourceProvider());
facesConfigProviders.add(new WebAppFlowConfigResourceProvider());
@@ -267,7 +266,7 @@ public class ConfigManager {
// initialize the resource providers for facelet-taglib documents
List faceletTaglibProviders =
- new ArrayList(3);
+ new ArrayList(4);
faceletTaglibProviders.add(new MetaInfFaceletTaglibraryConfigProvider());
faceletTaglibProviders.add(new WebFaceletTaglibResourceProvider());
FACELET_TAGLIBRARY_RESOURCE_PROVIDERS = Collections.unmodifiableList(faceletTaglibProviders);
@@ -972,7 +971,8 @@ private static class ParseTask implements Callable {
private static final Map VERSION_FACES_SCHEMA_FACES_MAPPING;
static {
- Map map = new HashMap<>();
+ Map map = new HashMap<>(16);
+ map.put("5.0", "com/sun/faces/web-facesconfig_5_0.xsd");
map.put("4.1", "com/sun/faces/web-facesconfig_4_1.xsd");
map.put("4.0", "com/sun/faces/web-facesconfig_4_0.xsd");
map.put("3.0", "com/sun/faces/web-facesconfig_3_0.xsd");
@@ -986,7 +986,8 @@ private static class ParseTask implements Callable {
private static final Map VERSION_FACES_SCHEMA_FACELET_TAGLIB_MAPPING;
static {
- Map map = new HashMap<>();
+ Map map = new HashMap<>(16);
+ map.put("5.0", "com/sun/faces/web-facelettaglibrary_5_0.xsd");
map.put("4.1", "com/sun/faces/web-facelettaglibrary_4_1.xsd");
map.put("4.0", "com/sun/faces/web-facelettaglibrary_4_0.xsd");
map.put("3.0", "com/sun/faces/web-facelettaglibrary_3_0.xsd");
diff --git a/enterprise/web.jsf/licenseinfo.xml b/enterprise/web.jsf/licenseinfo.xml
index 54a3274a6561..14ca4bc50fbb 100644
--- a/enterprise/web.jsf/licenseinfo.xml
+++ b/enterprise/web.jsf/licenseinfo.xml
@@ -106,6 +106,8 @@
src/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_0.xsdsrc/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_4_1.xsdsrc/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_1.xsd
+ src/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_5_0.xsd
+ src/org/netbeans/modules/web/jsf/resources/web-facesconfig_5_0.xsd
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java
index 20e04c815aa4..056a5c41d4a6 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java
@@ -20,6 +20,7 @@
package org.netbeans.modules.web.jsf;
+import java.io.IOException;
import java.util.List;
import java.util.ArrayList;
@@ -28,6 +29,8 @@
import org.openide.util.NbBundle;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
/**
*
@@ -40,18 +43,20 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa
private static final String URL_JSF_1_0 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_1_0.dtd"; // NOI18N
private static final String URL_JSF_1_1 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_1_1.dtd"; // NOI18N
- private static final String URL_JSF_1_2="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_1_2.xsd"; // NOI18N
- private static final String URL_JSF_2_0="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_0.xsd"; // NOI18N
- private static final String URL_JSF_2_1="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_1.xsd"; // NOI18N
- private static final String URL_JSF_2_2="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_2.xsd"; // NOI18N
- private static final String URL_JSF_2_3="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_3.xsd"; // NOI18N
- private static final String URL_JSF_3_0="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_3_0.xsd"; // NOI18N
- private static final String URL_JSF_4_0="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_0.xsd"; // NOI18N
- private static final String URL_JSF_4_1="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_1.xsd"; // NOI18N
+ private static final String URL_JSF_1_2 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_1_2.xsd"; // NOI18N
+ private static final String URL_JSF_2_0 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_0.xsd"; // NOI18N
+ private static final String URL_JSF_2_1 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_1.xsd"; // NOI18N
+ private static final String URL_JSF_2_2 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_2.xsd"; // NOI18N
+ private static final String URL_JSF_2_3 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_3.xsd"; // NOI18N
+ private static final String URL_JSF_3_0 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_3_0.xsd"; // NOI18N
+ private static final String URL_JSF_4_0 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_0.xsd"; // NOI18N
+ private static final String URL_JSF_4_1 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_1.xsd"; // NOI18N
+ private static final String URL_JSF_5_0 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_5_0.xsd"; // NOI18N
public static final String JAVAEE_NS = "http://java.sun.com/xml/ns/javaee"; // NOI18N
public static final String NEW_JAVAEE_NS = "http://xmlns.jcp.org/xml/ns/javaee"; //NOI18N
public static final String JAKARTAEE_NS = "https://jakarta.ee/xml/ns/jakartaee"; //NOI18N
+
private static final String JSF_1_2_XSD="web-facesconfig_1_2.xsd"; // NOI18N
private static final String JSF_2_0_XSD="web-facesconfig_2_0.xsd"; // NOI18N
private static final String JSF_2_1_XSD="web-facesconfig_2_1.xsd"; // NOI18N
@@ -60,14 +65,18 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa
private static final String JSF_3_0_XSD="web-facesconfig_3_0.xsd"; // NOI18N
private static final String JSF_4_0_XSD="web-facesconfig_4_0.xsd"; // NOI18N
private static final String JSF_4_1_XSD="web-facesconfig_4_1.xsd"; // NOI18N
- private static final String JSF_1_2=JAVAEE_NS+"/"+JSF_1_2_XSD; // NOI18N
- private static final String JSF_2_0=JAVAEE_NS+"/"+JSF_2_0_XSD; // NOI18N
- private static final String JSF_2_1=JAVAEE_NS+"/"+JSF_2_1_XSD; // NOI18N
- private static final String JSF_2_2=NEW_JAVAEE_NS+"/"+JSF_2_2_XSD; // NOI18N
- private static final String JSF_2_3=NEW_JAVAEE_NS+"/"+JSF_2_3_XSD; // NOI18N
- private static final String JSF_3_0=JAKARTAEE_NS+"/"+JSF_3_0_XSD; // NOI18N
- private static final String JSF_4_0=JAKARTAEE_NS+"/"+JSF_4_0_XSD; // NOI18N
- private static final String JSF_4_1=JAKARTAEE_NS+"/"+JSF_4_1_XSD; // NOI18N
+ private static final String JSF_5_0_XSD="web-facesconfig_5_0.xsd"; // NOI18N
+
+ public static final String JSF_1_2=JAVAEE_NS+"/"+JSF_1_2_XSD; // NOI18N
+ public static final String JSF_2_0=JAVAEE_NS+"/"+JSF_2_0_XSD; // NOI18N
+ public static final String JSF_2_1=JAVAEE_NS+"/"+JSF_2_1_XSD; // NOI18N
+ public static final String JSF_2_2=NEW_JAVAEE_NS+"/"+JSF_2_2_XSD; // NOI18N
+ public static final String JSF_2_3=NEW_JAVAEE_NS+"/"+JSF_2_3_XSD; // NOI18N
+ public static final String JSF_3_0=JAKARTAEE_NS+"/"+JSF_3_0_XSD; // NOI18N
+ public static final String JSF_4_0=JAKARTAEE_NS+"/"+JSF_4_0_XSD; // NOI18N
+ public static final String JSF_4_1=JAKARTAEE_NS+"/"+JSF_4_1_XSD; // NOI18N
+ public static final String JSF_5_0=JAKARTAEE_NS+"/"+JSF_5_0_XSD; // NOI18N
+
public static final String JSF_ID_1_2="SCHEMA:"+JSF_1_2; // NOI18N
public static final String JSF_ID_2_0="SCHEMA:"+JSF_2_0; // NOI18N
public static final String JSF_ID_2_1="SCHEMA:"+JSF_2_1; // NOI18N
@@ -76,6 +85,7 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa
public static final String JSF_ID_3_0="SCHEMA:"+JSF_3_0; // NOI18N
public static final String JSF_ID_4_0="SCHEMA:"+JSF_4_0; // NOI18N
public static final String JSF_ID_4_1="SCHEMA:"+JSF_4_1; // NOI18N
+ public static final String JSF_ID_5_0="SCHEMA:"+JSF_5_0; // NOI18N
// faces-config resources
@@ -88,8 +98,10 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa
public static final String RES_FACES_CONFIG_3_0 = "faces-config_3_0.xml";
public static final String RES_FACES_CONFIG_4_0 = "faces-config_4_0.xml";
public static final String RES_FACES_CONFIG_4_1 = "faces-config_4_1.xml";
+ public static final String RES_FACES_CONFIG_5_0 = "faces-config_5_0.xml";
//facelets
+ private static final String FILE_FACELETS_TAGLIB_SCHEMA_50="web-facelettaglibrary_5_0.xsd"; //NOI18N
private static final String FILE_FACELETS_TAGLIB_SCHEMA_41="web-facelettaglibrary_4_1.xsd"; //NOI18N
private static final String FILE_FACELETS_TAGLIB_SCHEMA_40="web-facelettaglibrary_4_0.xsd"; //NOI18N
private static final String FILE_FACELETS_TAGLIB_SCHEMA_30="web-facelettaglibrary_3_0.xsd"; //NOI18N
@@ -98,6 +110,8 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa
private static final String FILE_FACELETS_TAGLIB_SCHEMA_20="web-facelettaglibrary_2_0.xsd"; //NOI18N
private static final String FILE_FACELETS_TAGLIB_DTD_10="facelet-taglib_1_0.dtd"; //NOI18N
+ private static final String URL_FACELETS_TAGLIB_SCHEMA_50 = JAKARTAEE_NS + "/" + FILE_FACELETS_TAGLIB_SCHEMA_50; // NOI18N
+ private static final String ID_FACELETS_TAGLIB_SCHEMA_50 ="SCHEMA:" + URL_FACELETS_TAGLIB_SCHEMA_50;
private static final String URL_FACELETS_TAGLIB_SCHEMA_41 = JAKARTAEE_NS + "/" + FILE_FACELETS_TAGLIB_SCHEMA_41; // NOI18N
private static final String ID_FACELETS_TAGLIB_SCHEMA_41 ="SCHEMA:" + URL_FACELETS_TAGLIB_SCHEMA_41;
private static final String URL_FACELETS_TAGLIB_SCHEMA_40 = JAKARTAEE_NS + "/" + FILE_FACELETS_TAGLIB_SCHEMA_40; // NOI18N
@@ -112,6 +126,7 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa
private static final String ID_FACELETS_TAGLIB_SCHEMA_20 ="SCHEMA:" + URL_FACELETS_TAGLIB_SCHEMA_20;
private static final String ID_FACELETS_TAGLIB_DTD_10 = "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"; //NOI18N
+ private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_50 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_50; // NOI18N
private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_41; // NOI18N
private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_40; // NOI18N
private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_30; // NOI18N
@@ -140,6 +155,7 @@ public java.util.Iterator getPublicIDs() {
list.add(JSF_ID_3_0);
list.add(JSF_ID_4_0);
list.add(JSF_ID_4_1);
+ list.add(JSF_ID_5_0);
list.add(ID_FACELETS_TAGLIB_DTD_10);
list.add(ID_FACELETS_TAGLIB_SCHEMA_20);
list.add(ID_FACELETS_TAGLIB_SCHEMA_22);
@@ -147,6 +163,7 @@ public java.util.Iterator getPublicIDs() {
list.add(ID_FACELETS_TAGLIB_SCHEMA_30);
list.add(ID_FACELETS_TAGLIB_SCHEMA_40);
list.add(ID_FACELETS_TAGLIB_SCHEMA_41);
+ list.add(ID_FACELETS_TAGLIB_SCHEMA_50);
return list.listIterator();
}
@@ -179,6 +196,8 @@ public String getSystemID(String publicId) {
return URL_JSF_4_0;
case JSF_ID_4_1:
return URL_JSF_4_1;
+ case JSF_ID_5_0:
+ return URL_JSF_5_0;
case ID_FACELETS_TAGLIB_DTD_10:
return RESOURCE_URL_FACELETS_TAGLIB_DTD_10;
case ID_FACELETS_TAGLIB_SCHEMA_20:
@@ -193,6 +212,8 @@ public String getSystemID(String publicId) {
return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40;
case ID_FACELETS_TAGLIB_SCHEMA_41:
return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41;
+ case ID_FACELETS_TAGLIB_SCHEMA_50:
+ return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_50;
default:
return null;
}
@@ -250,77 +271,90 @@ public String getShortDescription() {
}
/**
- * Resolves schema definition file for taglib descriptor (spec.1_1, 1_2, 2_0, 2_1, 2_2, 2_3, 3_0, 4_0, 4_1)
+ * Resolves schema definition file for taglib descriptor (spec.1_1, 1_2, 2_0, 2_1, 2_2, 2_3, 3_0, 4_0, 4_1, 5_0)
* @param publicId publicId for resolved entity (null in our case)
* @param systemId systemId for resolved entity
- * @return InputSource for publisId,
+ * @return InputSource for publicId,
*/
- public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) throws org.xml.sax.SAXException, java.io.IOException {
- if (JSF_ID_1_0.equals(publicId)) {
- return new org.xml.sax.InputSource(URL_JSF_1_0);
- } else if (JSF_ID_1_1.equals(publicId)) {
- return new org.xml.sax.InputSource(URL_JSF_1_1);
- } else if(ID_FACELETS_TAGLIB_DTD_10.equals(publicId)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_DTD_10);
- } else if (JSF_1_2.equals(systemId)) {
- return new org.xml.sax.InputSource(URL_JSF_1_2);
- } else if (JSF_2_0.equals(systemId)) {
- return new org.xml.sax.InputSource(URL_JSF_2_0);
- } else if (JSF_2_1.equals(systemId)) {
- return new org.xml.sax.InputSource(URL_JSF_2_1);
- } else if (JSF_2_2.equals(systemId)) {
- return new org.xml.sax.InputSource(URL_JSF_2_2);
- } else if (JSF_2_3.equals(systemId)) {
- return new org.xml.sax.InputSource(URL_JSF_2_3);
- } else if (JSF_3_0.equals(systemId)) {
- return new org.xml.sax.InputSource(URL_JSF_3_0);
- } else if (JSF_4_0.equals(systemId)) {
- return new org.xml.sax.InputSource(URL_JSF_4_0);
- } else if (JSF_4_1.equals(systemId)) {
- return new org.xml.sax.InputSource(URL_JSF_4_1);
- } else if (URL_FACELETS_TAGLIB_SCHEMA_20.equals(systemId)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20);
- } else if (URL_FACELETS_TAGLIB_SCHEMA_22.equals(systemId)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_22);
- } else if (URL_FACELETS_TAGLIB_SCHEMA_23.equals(systemId)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_23);
- } else if (URL_FACELETS_TAGLIB_SCHEMA_30.equals(systemId)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30);
- } else if (URL_FACELETS_TAGLIB_SCHEMA_40.equals(systemId)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40);
- } else if (URL_FACELETS_TAGLIB_SCHEMA_41.equals(systemId)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41);
- } else if (systemId!=null && systemId.endsWith(JSF_1_2_XSD)) {
- return new org.xml.sax.InputSource(URL_JSF_1_2);
- } else if (systemId!=null && systemId.endsWith(JSF_2_0_XSD)) {
- return new org.xml.sax.InputSource(URL_JSF_2_0);
- } else if (systemId!=null && systemId.endsWith(JSF_2_1_XSD)) {
- return new org.xml.sax.InputSource(URL_JSF_2_1);
- } else if (systemId!=null && systemId.endsWith(JSF_2_2_XSD)) {
- return new org.xml.sax.InputSource(URL_JSF_2_2);
- } else if (systemId!=null && systemId.endsWith(JSF_2_3_XSD)) {
- return new org.xml.sax.InputSource(URL_JSF_2_3);
- } else if (systemId!=null && systemId.endsWith(JSF_3_0_XSD)) {
- return new org.xml.sax.InputSource(URL_JSF_3_0);
- } else if (systemId!=null && systemId.endsWith(JSF_4_0_XSD)) {
- return new org.xml.sax.InputSource(URL_JSF_4_0);
- } else if (systemId!=null && systemId.endsWith(JSF_4_1_XSD)) {
- return new org.xml.sax.InputSource(URL_JSF_4_1);
- } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_20)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20);
- } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_22)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_22);
- } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_23)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_23);
- } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_30)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30);
- } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_40)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40);
- } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_41)) {
- return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41);
- } else {
- return null;
+ @Override
+ public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
+
+ InputSource schema = null;
+
+ // Match by publicId
+ if (null != publicId) {
+ switch (publicId) {
+ case JSF_ID_1_0 -> schema = new InputSource(URL_JSF_1_0);
+ case JSF_ID_1_1 -> schema = new InputSource(URL_JSF_1_1);
+ case ID_FACELETS_TAGLIB_DTD_10 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_DTD_10);
+ default -> {}
+ }
+ }
+
+ if (null != schema || null == systemId) {
+ return schema;
+ }
+
+ // Match by systemId
+ switch (systemId) {
+ case JSF_1_2 -> schema = new InputSource(URL_JSF_1_2);
+ case JSF_2_0 -> schema = new InputSource(URL_JSF_2_0);
+ case JSF_2_1 -> schema = new InputSource(URL_JSF_2_1);
+ case JSF_2_2 -> schema = new InputSource(URL_JSF_2_2);
+ case JSF_2_3 -> schema = new InputSource(URL_JSF_2_3);
+ case JSF_3_0 -> schema = new InputSource(URL_JSF_3_0);
+ case JSF_4_0 -> schema = new InputSource(URL_JSF_4_0);
+ case JSF_4_1 -> schema = new InputSource(URL_JSF_4_1);
+ case JSF_5_0 -> schema = new InputSource(URL_JSF_5_0);
+ case URL_FACELETS_TAGLIB_SCHEMA_20 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20);
+ case URL_FACELETS_TAGLIB_SCHEMA_22 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_22);
+ case URL_FACELETS_TAGLIB_SCHEMA_23 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_23);
+ case URL_FACELETS_TAGLIB_SCHEMA_30 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30);
+ case URL_FACELETS_TAGLIB_SCHEMA_40 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40);
+ case URL_FACELETS_TAGLIB_SCHEMA_41 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41);
+ case URL_FACELETS_TAGLIB_SCHEMA_50 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_50);
+ default -> {}
+ }
+
+ if (null != schema) {
+ return schema;
+ }
+
+ if (systemId.endsWith(JSF_1_2_XSD)) {
+ schema = new InputSource(URL_JSF_1_2);
+ } else if (systemId.endsWith(JSF_2_0_XSD)) {
+ schema = new InputSource(URL_JSF_2_0);
+ } else if (systemId.endsWith(JSF_2_1_XSD)) {
+ schema = new InputSource(URL_JSF_2_1);
+ } else if (systemId.endsWith(JSF_2_2_XSD)) {
+ schema = new InputSource(URL_JSF_2_2);
+ } else if (systemId.endsWith(JSF_2_3_XSD)) {
+ schema = new InputSource(URL_JSF_2_3);
+ } else if (systemId.endsWith(JSF_3_0_XSD)) {
+ schema = new InputSource(URL_JSF_3_0);
+ } else if (systemId.endsWith(JSF_4_0_XSD)) {
+ schema = new InputSource(URL_JSF_4_0);
+ } else if (systemId.endsWith(JSF_4_1_XSD)) {
+ schema = new InputSource(URL_JSF_4_1);
+ } else if (systemId.endsWith(JSF_5_0_XSD)) {
+ schema = new InputSource(URL_JSF_5_0);
+ } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_20)) {
+ schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20);
+ } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_22)) {
+ schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_22);
+ } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_23)) {
+ schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_23);
+ } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_30)) {
+ schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30);
+ } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_40)) {
+ schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40);
+ } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_41)) {
+ schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41);
+ } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_50)) {
+ schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_50);
}
+
+ return schema;
}
/**
@@ -341,42 +375,23 @@ public String resolvePublic(String publicId) {
public static JsfVersion extractVersion(Document document) {
// first check the doc type to see if there is one
DocumentType dt = document.getDoctype();
- JsfVersion value = JsfVersion.JSF_1_0;
// This is the default version
+ JsfVersion value = JsfVersion.JSF_2_3;
if (dt != null) {
switch (dt.getPublicId()) {
- case JSF_ID_1_0:
- value = JsfVersion.JSF_1_0;
- break;
- case JSF_ID_1_1:
- value = JsfVersion.JSF_1_1;
- break;
- case JSF_ID_1_2:
- value = JsfVersion.JSF_1_2;
- break;
- case JSF_ID_2_0:
- value = JsfVersion.JSF_2_0;
- break;
- case JSF_ID_2_1:
- value = JsfVersion.JSF_2_1;
- break;
- case JSF_ID_2_2:
- value = JsfVersion.JSF_2_2;
- break;
- case JSF_ID_2_3:
- value = JsfVersion.JSF_2_3;
- break;
- case JSF_ID_3_0:
- value = JsfVersion.JSF_3_0;
- break;
- case JSF_ID_4_0:
- value = JsfVersion.JSF_4_0;
- break;
- case JSF_ID_4_1:
- value = JsfVersion.JSF_4_1;
- break;
- default:
- break;
+ case JSF_ID_1_0 -> value = JsfVersion.JSF_1_0;
+ case JSF_ID_1_1 -> value = JsfVersion.JSF_1_1;
+ case JSF_ID_1_2 -> value = JsfVersion.JSF_1_2;
+ case JSF_ID_2_0 -> value = JsfVersion.JSF_2_0;
+ case JSF_ID_2_1 -> value = JsfVersion.JSF_2_1;
+ case JSF_ID_2_2 -> value = JsfVersion.JSF_2_2;
+ case JSF_ID_2_3 -> value = JsfVersion.JSF_2_3;
+ case JSF_ID_3_0 -> value = JsfVersion.JSF_3_0;
+ case JSF_ID_4_0 -> value = JsfVersion.JSF_4_0;
+ case JSF_ID_4_1 -> value = JsfVersion.JSF_4_1;
+ case JSF_ID_5_0 -> value = JsfVersion.JSF_5_0;
+ default -> {
+ }
}
}
return value;
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java
index 79e56e14b95e..e83f4bd2b565 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java
@@ -577,7 +577,9 @@ public void run() {
if (ddRoot != null) {
Profile profile = webModule.getJ2eeProfile();
if (profile != null && profile.isAtLeast(Profile.JAVA_EE_5) && jsfVersion != null) {
- if (jsfVersion.isAtLeast(JsfVersion.JSF_4_1)) {
+ if (jsfVersion.isAtLeast(JsfVersion.JSF_5_0)) {
+ facesConfigTemplate = JSFCatalog.RES_FACES_CONFIG_5_0;
+ } else if (jsfVersion.isAtLeast(JsfVersion.JSF_4_1)) {
facesConfigTemplate = JSFCatalog.RES_FACES_CONFIG_4_1;
} else if (jsfVersion.isAtLeast(JsfVersion.JSF_4_0)) {
facesConfigTemplate = JSFCatalog.RES_FACES_CONFIG_4_0;
@@ -700,7 +702,9 @@ public void run() {
FileObject template = FileUtil.getConfigRoot().getFileObject(WELCOME_XHTML_TEMPLATE);
HashMap params = new HashMap<>();
if (jsfVersion != null) {
- if (jsfVersion.isAtLeast(JsfVersion.JSF_4_1)) {
+ if (jsfVersion.isAtLeast(JsfVersion.JSF_5_0)) {
+ params.put("isJSF50", Boolean.TRUE); //NOI18N
+ } else if (jsfVersion.isAtLeast(JsfVersion.JSF_4_1)) {
params.put("isJSF41", Boolean.TRUE); //NOI18N
} if (jsfVersion.isAtLeast(JsfVersion.JSF_4_0)) {
params.put("isJSF40", Boolean.TRUE); //NOI18N
@@ -755,7 +759,8 @@ private boolean isGlassFishv3(String serverInstanceID) {
String shortName;
try {
shortName = Deployment.getDefault().getServerInstance(serverInstanceID).getServerID();
- if ("gfv800ee11".equals(shortName) || "gfv700ee10".equals(shortName)
+ if ("gfv900ee12".equals(shortName)
+ || "gfv800ee11".equals(shortName) || "gfv700ee10".equals(shortName)
|| "gfv610ee9".equals(shortName) || "gfv6ee9".equals(shortName)
|| "gfv510ee8".equals(shortName) || "gfv5ee8".equals(shortName)
|| "gfv5".equals(shortName) || "gfv4ee7".equals(shortName)
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java
index e137a0b891cc..7891f968b7a1 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java
@@ -71,6 +71,7 @@ public class JSFUtils {
public static final String DEFAULT_JSF_3_0_NAME = "jsf30"; //NOI18N
public static final String DEFAULT_JSF_4_0_NAME = "jsf40"; //NOI18N
public static final String DEFAULT_JSF_4_1_NAME = "jsf41"; //NOI18N
+ public static final String DEFAULT_JSF_5_0_NAME = "jsf50"; //NOI18N
// the name of jstl library
public static final String DEFAULT_JSTL_1_1_NAME = "jstl11"; //NOI18N
@@ -88,6 +89,7 @@ public class JSFUtils {
public static final String JSF_3_0__API_SPECIFIC_CLASS = "jakarta.faces.push.PushContext"; //NOI18N
public static final String JSF_4_0__API_SPECIFIC_CLASS = "jakarta.faces.lifecycle.ClientWindowScoped"; //NOI18N
public static final String JSF_4_1__API_SPECIFIC_CLASS = "jakarta.faces.convert.UUIDConverter"; //NOI18N
+ public static final String JSF_5_0__API_SPECIFIC_CLASS = "jakarta.faces.CurrentThreadToServletContext"; //NOI18N
public static final String MYFACES_SPECIFIC_CLASS = "org.apache.myfaces.webapp.StartupServletContextListener"; //NOI18N
//constants for web.xml (Java EE)
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/ConfigurationUtils.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/ConfigurationUtils.java
index 2fc70b674022..c973da408808 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/ConfigurationUtils.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/ConfigurationUtils.java
@@ -103,8 +103,8 @@ public static Servlet getFacesServlet(WebModule webModule) {
WebApp webApp = DDProvider.getDefault().getDDRoot(deploymentDescriptor);
// Try to find according the servlet class name. The javax.faces.webapp.FacesServlet is final, so
// it can not be extended.
- if (WebApp.VERSION_6_1.equals(webApp.getVersion()) || WebApp.VERSION_6_0.equals(webApp.getVersion()) ||
- WebApp.VERSION_5_0.equals(webApp.getVersion())) {
+ if (WebApp.VERSION_6_2.equals(webApp.getVersion()) || WebApp.VERSION_6_1.equals(webApp.getVersion())
+ || WebApp.VERSION_6_0.equals(webApp.getVersion()) || WebApp.VERSION_5_0.equals(webApp.getVersion())) {
return (Servlet) webApp
.findBeanByName("Servlet", "ServletClass", "jakarta.faces.webapp.FacesServlet"); //NOI18N;
} else {
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/facesmodel/JsfVersionUtils.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/facesmodel/JsfVersionUtils.java
index 45b6fb5abfd5..52796e7814b5 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/facesmodel/JsfVersionUtils.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/facesmodel/JsfVersionUtils.java
@@ -52,7 +52,6 @@
import org.openide.filesystems.FileUtil;
import org.openide.util.Exceptions;
import org.openide.util.Parameters;
-import org.openide.util.RequestProcessor;
import org.openide.util.WeakListeners;
/**
@@ -61,9 +60,10 @@
*/
public final class JsfVersionUtils {
- private static final LinkedHashMap SPECIFIC_CLASS_NAMES = new LinkedHashMap<>();
+ private static final LinkedHashMap SPECIFIC_CLASS_NAMES = new LinkedHashMap<>(16);
static {
+ SPECIFIC_CLASS_NAMES.put(JsfVersion.JSF_5_0, JSFUtils.JSF_5_0__API_SPECIFIC_CLASS);
SPECIFIC_CLASS_NAMES.put(JsfVersion.JSF_4_1, JSFUtils.JSF_4_1__API_SPECIFIC_CLASS);
SPECIFIC_CLASS_NAMES.put(JsfVersion.JSF_4_0, JSFUtils.JSF_4_0__API_SPECIFIC_CLASS);
SPECIFIC_CLASS_NAMES.put(JsfVersion.JSF_3_0, JSFUtils.JSF_3_0__API_SPECIFIC_CLASS);
@@ -198,7 +198,9 @@ public static JsfVersion forClasspath(@NonNull List classpath) {
public static JsfVersion forServerLibrary(@NonNull ServerLibrary lib) {
Parameters.notNull("serverLibrary", lib); //NOI18N
if ("JavaServer Faces".equals(lib.getSpecificationTitle())) { // NOI18N
- if (Version.fromJsr277NotationWithFallback("4.1").equals(lib.getSpecificationVersion())) { //NOI18N
+ if (Version.fromJsr277NotationWithFallback("5.0").equals(lib.getSpecificationVersion())) { //NOI18N
+ return JsfVersion.JSF_5_0;
+ } else if (Version.fromJsr277NotationWithFallback("4.1").equals(lib.getSpecificationVersion())) { //NOI18N
return JsfVersion.JSF_4_1;
} else if (Version.fromJsr277NotationWithFallback("4.0").equals(lib.getSpecificationVersion())) { //NOI18N
return JsfVersion.JSF_4_0;
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/facelets/resources/templates/simpleFacelets.template b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/facelets/resources/templates/simpleFacelets.template
index 6c7ded997d50..f87846ff1057 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/facelets/resources/templates/simpleFacelets.template
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/facelets/resources/templates/simpleFacelets.template
@@ -1,6 +1,6 @@
-<#if isJSF40?? || isJSF41??>
+<#if isJSF40?? || isJSF41?? || isJSF50??>
<#elseif isJSF22?? || isJSF30??>
@@ -12,7 +12,7 @@
<#else>
#if>
-<#if isJSF20?? || isJSF22?? || isJSF30?? || isJSF40?? || isJSF41??>
+<#if isJSF20?? || isJSF22?? || isJSF30?? || isJSF40?? || isJSF41?? || isJSF50??>
Facelet Title
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigModelImpl.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigModelImpl.java
index 9c017f5e1a5d..b63ff981e769 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigModelImpl.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigModelImpl.java
@@ -24,11 +24,11 @@
import java.util.logging.Logger;
import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
+import org.netbeans.modules.web.jsf.JSFCatalog;
import org.netbeans.modules.web.jsf.api.facesmodel.FacesConfig;
import org.netbeans.modules.web.jsf.api.facesmodel.JSFConfigComponent;
import org.netbeans.modules.web.jsf.api.facesmodel.JSFConfigComponentFactory;
import org.netbeans.modules.web.jsf.api.facesmodel.JSFConfigModel;
-import org.netbeans.modules.web.jsf.api.facesmodel.JsfVersionUtils;
import org.netbeans.modules.web.jsf.api.metamodel.JsfModel;
import org.netbeans.modules.web.jsfapi.api.JsfVersion;
import org.netbeans.modules.xml.xam.ComponentUpdater;
@@ -88,57 +88,41 @@ public JSFConfigComponentFactory getFactory() {
return componentFactory;
}
+ @Override
public JsfVersion getVersion() {
String namespaceURI = getRootComponent().getPeer().getNamespaceURI();
- JsfVersion version = JsfVersion.JSF_1_1;
- if (JSFConfigQNames.JSF_4_1_NS.equals(namespaceURI)
- && (getRootComponent().getVersion().equals("4.1") //NOI18N
- || checkSchemaLocation(
- getRootComponent().getPeer(),
- "https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_4_1.xsd"))) { //NOI18N
- version = JsfVersion.JSF_4_1;
- } else if (JSFConfigQNames.JSF_4_0_NS.equals(namespaceURI)
- && (getRootComponent().getVersion().equals("4.0") //NOI18N
- || checkSchemaLocation(
- getRootComponent().getPeer(),
- "https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_4_0.xsd"))) { //NOI18N
- version = JsfVersion.JSF_4_0;
- } else if (JSFConfigQNames.JSF_3_0_NS.equals(namespaceURI)
- && (getRootComponent().getVersion().equals("3.0") //NOI18N
- || checkSchemaLocation(
- getRootComponent().getPeer(),
- "https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_3_0.xsd"))) { //NOI18N
- version = JsfVersion.JSF_3_0;
- } else if (JSFConfigQNames.JSF_2_3_NS.equals(namespaceURI)
- && (getRootComponent().getVersion().equals("2.3") //NOI18N
- || checkSchemaLocation(
- getRootComponent().getPeer(),
- "http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"))) { //NOI18N
- version = JsfVersion.JSF_2_3;
- } else if (JSFConfigQNames.JSF_2_2_NS.equals(namespaceURI)
- && (getRootComponent().getVersion().equals("2.2") //NOI18N
- || checkSchemaLocation(
- getRootComponent().getPeer(),
- "http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"))) { //NOI18N
- version = JsfVersion.JSF_2_2;
- } else if (JSFConfigQNames.JSF_2_1_NS.equals(namespaceURI)
- && (getRootComponent().getVersion().equals("2.1") //NOI18N
- || checkSchemaLocation(
- getRootComponent().getPeer(),
- "http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd"))) { //NOI18N
- version = JsfVersion.JSF_2_1;
- } else if (JSFConfigQNames.JSF_2_0_NS.equals(namespaceURI)
- && (getRootComponent().getVersion().equals("2.0") //NOI18N
- || checkSchemaLocation(
- getRootComponent().getPeer(),
- "http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"))) { //NOI18N
- version = JsfVersion.JSF_2_0;
- } else if (JSFConfigQNames.JSF_1_2_NS.equals(namespaceURI)) {
- version = JsfVersion.JSF_1_2;
+ Element element = getRootComponent().getPeer();
+ String componentVersion = getRootComponent().getVersion();
+ JsfVersion jsfVersion = JsfVersion.JSF_1_1;
+ if (JSFConfigQNames.JSF_JAKARTA_NS.equals(namespaceURI)) {
+ if (JsfVersion.JSF_5_0.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_5_0)) {
+ jsfVersion = JsfVersion.JSF_5_0;
+ } else if (JsfVersion.JSF_4_1.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_4_1)) {
+ jsfVersion = JsfVersion.JSF_4_1;
+ } else if (JsfVersion.JSF_4_0.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_4_0)) {
+ jsfVersion = JsfVersion.JSF_4_0;
+ } else if (JsfVersion.JSF_3_0.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_3_0)) {
+ jsfVersion = JsfVersion.JSF_3_0;
+ }
+ } else if (JSFConfigQNames.JSF_ORACLE_NS.equals(namespaceURI)) {
+ if (JsfVersion.JSF_2_3.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_2_3)) {
+ jsfVersion = JsfVersion.JSF_2_3;
+ } else if (JsfVersion.JSF_2_2.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_2_2)) {
+ jsfVersion = JsfVersion.JSF_2_2;
+ }
+ } else if (JSFConfigQNames.JSF_SUN_NS.equals(namespaceURI)) {
+ if (JsfVersion.JSF_2_1.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_2_1)) {
+ jsfVersion = JsfVersion.JSF_2_1;
+ } else if (JsfVersion.JSF_2_0.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_2_0)) {
+ jsfVersion = JsfVersion.JSF_2_0;
+ } else if (JsfVersion.JSF_1_2.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_1_2)) {
+ jsfVersion = JsfVersion.JSF_1_2;
+ }
}
- return version;
+ return jsfVersion;
}
+ @Override
public Set getQNames() {
return JSFConfigQNames.getMappedQNames(getVersion());
}
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigQNames.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigQNames.java
index 42319595ef2f..deb6800a50b3 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigQNames.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigQNames.java
@@ -25,7 +25,6 @@
import javax.xml.namespace.QName;
-import org.netbeans.modules.web.jsf.api.facesmodel.JsfVersionUtils;
import org.netbeans.modules.web.jsfapi.api.JsfVersion;
import org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent;
import org.w3c.dom.Element;
@@ -198,59 +197,51 @@ public enum JSFConfigQNames {
// protected views
PROTECTED_VIEWS("protected-views"); //NOI18N
- private QName qname_1_1;
- private QName qname_1_2;
- private QName qname_2_0;
- private QName qname_2_1;
- private QName qname_2_2;
- private QName qname_2_3;
- private QName qname_3_0;
- private QName qname_4_0;
- private QName qname_4_1;
+ private final QName qname_1_1;
+ private final QName qname_1_2;
+ private final QName qname_2_0;
+ private final QName qname_2_1;
+ private final QName qname_2_2;
+ private final QName qname_2_3;
+ private final QName qname_3_0;
+ private final QName qname_4_0;
+ private final QName qname_4_1;
+ private final QName qname_5_0;
+
+ public static final String JSF_SUN_NS = "http://java.sun.com/xml/ns/javaee"; //NOI18N
+ public static final String JSF_ORACLE_NS = "http://xmlns.jcp.org/xml/ns/javaee"; //NOI18N
+ public static final String JSF_JAKARTA_NS = "https://jakarta.ee/xml/ns/jakartaee"; //NOI18N
-
- public static final String JSF_1_2_NS = "http://java.sun.com/xml/ns/javaee"; //NOI18N
- public static final String JSF_2_0_NS = "http://java.sun.com/xml/ns/javaee"; //NOI18N
- public static final String JSF_2_1_NS = "http://java.sun.com/xml/ns/javaee"; //NOI18N
- public static final String JSF_2_2_NS = "http://xmlns.jcp.org/xml/ns/javaee"; //NOI18N
- public static final String JSF_2_3_NS = "http://xmlns.jcp.org/xml/ns/javaee"; //NOI18N
- public static final String JSF_3_0_NS = "https://jakarta.ee/xml/ns/jakartaee"; //NOI18N
- public static final String JSF_4_0_NS = "https://jakarta.ee/xml/ns/jakartaee"; //NOI18N
- public static final String JSF_4_1_NS = "https://jakarta.ee/xml/ns/jakartaee"; //NOI18N
public static final String JSF_1_1_NS = javax.xml.XMLConstants.NULL_NS_URI;
public static final String JSFCONFIG_PREFIX = javax.xml.XMLConstants.DEFAULT_NS_PREFIX;
JSFConfigQNames(String localName) {
qname_1_1 = new QName(JSF_1_1_NS, localName, JSFCONFIG_PREFIX);
- qname_1_2 = new QName(JSF_1_2_NS, localName, JSFCONFIG_PREFIX);
- qname_2_0 = new QName(JSF_2_0_NS, localName, JSFCONFIG_PREFIX);
- qname_2_1 = new QName(JSF_2_1_NS, localName, JSFCONFIG_PREFIX);
- qname_2_2 = new QName(JSF_2_2_NS, localName, JSFCONFIG_PREFIX);
- qname_2_3 = new QName(JSF_2_3_NS, localName, JSFCONFIG_PREFIX);
- qname_3_0 = new QName(JSF_3_0_NS, localName, JSFCONFIG_PREFIX);
- qname_4_0 = new QName(JSF_4_0_NS, localName, JSFCONFIG_PREFIX);
- qname_4_1 = new QName(JSF_4_1_NS, localName, JSFCONFIG_PREFIX);
+ qname_1_2 = new QName(JSF_SUN_NS, localName, JSFCONFIG_PREFIX);
+ qname_2_0 = new QName(JSF_SUN_NS, localName, JSFCONFIG_PREFIX);
+ qname_2_1 = new QName(JSF_SUN_NS, localName, JSFCONFIG_PREFIX);
+ qname_2_2 = new QName(JSF_ORACLE_NS, localName, JSFCONFIG_PREFIX);
+ qname_2_3 = new QName(JSF_ORACLE_NS, localName, JSFCONFIG_PREFIX);
+ qname_3_0 = new QName(JSF_JAKARTA_NS, localName, JSFCONFIG_PREFIX);
+ qname_4_0 = new QName(JSF_JAKARTA_NS, localName, JSFCONFIG_PREFIX);
+ qname_4_1 = new QName(JSF_JAKARTA_NS, localName, JSFCONFIG_PREFIX);
+ qname_5_0 = new QName(JSF_JAKARTA_NS, localName, JSFCONFIG_PREFIX);
}
public QName getQName(JsfVersion version) {
QName value = qname_1_1;
- if (version.equals(JsfVersion.JSF_1_2)) {
- value = qname_1_2;
- } else if (version.equals(JsfVersion.JSF_2_0)) {
- value = qname_2_0;
- } else if (version.equals(JsfVersion.JSF_2_1)) {
- value = qname_2_1;
- } else if (version.equals(JsfVersion.JSF_2_2)) {
- value = qname_2_2;
- } else if (version.equals(JsfVersion.JSF_2_3)) {
- value = qname_2_3;
- } else if (version.equals(JsfVersion.JSF_3_0)) {
- value = qname_3_0;
- } else if (version.equals(JsfVersion.JSF_4_0)) {
- value = qname_4_0;
- } else if (version.equals(JsfVersion.JSF_4_1)) {
- value = qname_4_1;
+ switch (version) {
+ case JSF_1_2 -> value = qname_1_2;
+ case JSF_2_0 -> value = qname_2_0;
+ case JSF_2_1 -> value = qname_2_1;
+ case JSF_2_2 -> value = qname_2_2;
+ case JSF_2_3 -> value = qname_2_3;
+ case JSF_3_0 -> value = qname_3_0;
+ case JSF_4_0 -> value = qname_4_0;
+ case JSF_4_1 -> value = qname_4_1;
+ case JSF_5_0 -> value = qname_5_0;
+ default -> {}
}
return value;
}
@@ -273,35 +264,51 @@ public String getQualifiedName(JsfVersion version) {
public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) {
QName qname = AbstractDocumentComponent.getQName(element);
- if (JSFConfigQNames.JSF_1_2_NS.equals(element.getNamespaceURI())) {
- return jsfqname.getQName(JsfVersion.JSF_1_2).equals(qname);
- } else if (JSFConfigQNames.JSF_2_0_NS.equals(element.getNamespaceURI())) {
- return jsfqname.getQName(JsfVersion.JSF_2_0).equals(qname);
- } else if (JSFConfigQNames.JSF_2_1_NS.equals(element.getNamespaceURI())) {
- return jsfqname.getQName(JsfVersion.JSF_2_1).equals(qname);
- } else if (JSFConfigQNames.JSF_2_2_NS.equals(element.getNamespaceURI())) {
- return jsfqname.getQName(JsfVersion.JSF_2_2).equals(qname);
- } else if (JSFConfigQNames.JSF_2_3_NS.equals(element.getNamespaceURI())) {
- return jsfqname.getQName(JsfVersion.JSF_2_3).equals(qname);
- } else if (JSFConfigQNames.JSF_3_0_NS.equals(element.getNamespaceURI())) {
- return jsfqname.getQName(JsfVersion.JSF_3_0).equals(qname);
- } else if (JSFConfigQNames.JSF_4_0_NS.equals(element.getNamespaceURI())) {
- return jsfqname.getQName(JsfVersion.JSF_4_0).equals(qname);
- } else if (JSFConfigQNames.JSF_4_1_NS.equals(element.getNamespaceURI())) {
- return jsfqname.getQName(JsfVersion.JSF_4_1).equals(qname);
+ final String NS_URI = element.getNamespaceURI();
+ if (null != NS_URI) switch (NS_URI) {
+ case JSFConfigQNames.JSF_JAKARTA_NS -> {
+ if (jsfqname.getQName(JsfVersion.JSF_5_0).equals(qname)) {
+ return true;
+ } else if (jsfqname.getQName(JsfVersion.JSF_4_1).equals(qname)) {
+ return true;
+ } else if (jsfqname.getQName(JsfVersion.JSF_4_0).equals(qname)) {
+ return true;
+ } else if (jsfqname.getQName(JsfVersion.JSF_3_0).equals(qname)) {
+ return true;
+ }
+ }
+ case JSFConfigQNames.JSF_ORACLE_NS -> {
+ if (jsfqname.getQName(JsfVersion.JSF_2_3).equals(qname)) {
+ return true;
+ } else if (jsfqname.getQName(JsfVersion.JSF_2_2).equals(qname)) {
+ return true;
+ }
+ }
+ case JSFConfigQNames.JSF_SUN_NS -> {
+ if (jsfqname.getQName(JsfVersion.JSF_2_1).equals(qname)) {
+ return true;
+ } else if (jsfqname.getQName(JsfVersion.JSF_2_0).equals(qname)) {
+ return true;
+ } else if (jsfqname.getQName(JsfVersion.JSF_1_2).equals(qname)) {
+ return true;
+ }
+ }
+ default -> {
+ }
}
return jsfqname.getLocalName().equals(qname.getLocalPart());
}
- private static final Set mappedQNames_1_1 = new HashSet();
- private static final Set mappedQNames_1_2 = new HashSet();
- private static final Set mappedQNames_2_0 = new HashSet();
- private static final Set mappedQNames_2_1 = new HashSet();
- private static final Set mappedQNames_2_2 = new HashSet();
- private static final Set mappedQNames_2_3 = new HashSet();
- private static final Set mappedQNames_3_0 = new HashSet();
- private static final Set mappedQNames_4_0 = new HashSet();
- private static final Set mappedQNames_4_1 = new HashSet();
+ private static final Set mappedQNames_1_1 = new HashSet<>();
+ private static final Set mappedQNames_1_2 = new HashSet<>();
+ private static final Set mappedQNames_2_0 = new HashSet<>();
+ private static final Set mappedQNames_2_1 = new HashSet<>();
+ private static final Set mappedQNames_2_2 = new HashSet<>();
+ private static final Set mappedQNames_2_3 = new HashSet<>();
+ private static final Set mappedQNames_3_0 = new HashSet<>();
+ private static final Set mappedQNames_4_0 = new HashSet<>();
+ private static final Set mappedQNames_4_1 = new HashSet<>();
+ private static final Set mappedQNames_5_0 = new HashSet<>();
static {
mappedQNames_1_1.add(FACES_CONFIG.getQName(JsfVersion.JSF_1_1));
@@ -315,6 +322,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) {
mappedQNames_1_1.add(APPLICATION.getQName(JsfVersion.JSF_1_1));
mappedQNames_1_1.add(VIEW_HANDLER.getQName(JsfVersion.JSF_1_1));
mappedQNames_1_1.add(RESOURCE_BUNDLE.getQName(JsfVersion.JSF_1_1));
+
mappedQNames_1_2.add(FACES_CONFIG.getQName(JsfVersion.JSF_1_2));
mappedQNames_1_2.add(MANAGED_BEAN.getQName(JsfVersion.JSF_1_2));
mappedQNames_1_2.add(CONVERTER.getQName(JsfVersion.JSF_1_2));
@@ -367,6 +375,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) {
mappedQNames_1_2.add(VALIDATOR_EXTENSION.getQName(JsfVersion.JSF_1_2));
mappedQNames_1_2.add(FACES_CONFIG_EXTENSION.getQName(JsfVersion.JSF_1_2));
mappedQNames_1_2.add(RENDERER.getQName(JsfVersion.JSF_1_2));
+
mappedQNames_2_0.add(FACES_CONFIG.getQName(JsfVersion.JSF_2_0));
mappedQNames_2_0.add(MANAGED_BEAN.getQName(JsfVersion.JSF_2_0));
mappedQNames_2_0.add(CONVERTER.getQName(JsfVersion.JSF_2_0));
@@ -441,6 +450,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) {
mappedQNames_2_0.add(CLIENT_BEHAVIOR_RENDERER.getQName(JsfVersion.JSF_2_0));
mappedQNames_2_0.add(BEHAVIOR.getQName(JsfVersion.JSF_2_0));
mappedQNames_2_0.add(BEHAVIOR_EXTENSION.getQName(JsfVersion.JSF_2_0));
+
mappedQNames_2_1.add(FACES_CONFIG.getQName(JsfVersion.JSF_2_1));
mappedQNames_2_1.add(MANAGED_BEAN.getQName(JsfVersion.JSF_2_1));
mappedQNames_2_1.add(CONVERTER.getQName(JsfVersion.JSF_2_1));
@@ -516,6 +526,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) {
mappedQNames_2_1.add(CLIENT_BEHAVIOR_RENDERER.getQName(JsfVersion.JSF_2_1));
mappedQNames_2_1.add(BEHAVIOR.getQName(JsfVersion.JSF_2_1));
mappedQNames_2_1.add(BEHAVIOR_EXTENSION.getQName(JsfVersion.JSF_2_1));
+
mappedQNames_2_2.add(FACES_CONFIG.getQName(JsfVersion.JSF_2_2));
mappedQNames_2_2.add(MANAGED_BEAN.getQName(JsfVersion.JSF_2_2));
mappedQNames_2_2.add(CONVERTER.getQName(JsfVersion.JSF_2_2));
@@ -614,6 +625,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) {
mappedQNames_2_2.add(METHOD.getQName(JsfVersion.JSF_2_2));
mappedQNames_2_2.add(FLOW_DEFINITION.getQName(JsfVersion.JSF_2_2));
mappedQNames_2_2.add(PROTECTED_VIEWS.getQName(JsfVersion.JSF_2_2));
+
mappedQNames_2_3.add(FACES_CONFIG.getQName(JsfVersion.JSF_2_3));
mappedQNames_2_3.add(MANAGED_BEAN.getQName(JsfVersion.JSF_2_3));
mappedQNames_2_3.add(CONVERTER.getQName(JsfVersion.JSF_2_3));
@@ -712,6 +724,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) {
mappedQNames_2_3.add(METHOD.getQName(JsfVersion.JSF_2_3));
mappedQNames_2_3.add(FLOW_DEFINITION.getQName(JsfVersion.JSF_2_3));
mappedQNames_2_3.add(PROTECTED_VIEWS.getQName(JsfVersion.JSF_2_3));
+
mappedQNames_3_0.add(FACES_CONFIG.getQName(JsfVersion.JSF_3_0));
mappedQNames_3_0.add(MANAGED_BEAN.getQName(JsfVersion.JSF_3_0));
mappedQNames_3_0.add(CONVERTER.getQName(JsfVersion.JSF_3_0));
@@ -1009,26 +1022,120 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) {
mappedQNames_4_1.add(FLOW_DEFINITION.getQName(JsfVersion.JSF_4_1));
mappedQNames_4_1.add(PROTECTED_VIEWS.getQName(JsfVersion.JSF_4_1));
+ mappedQNames_5_0.add(FACES_CONFIG.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(MANAGED_BEAN.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(CONVERTER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(NAVIGATION_RULE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(NAVIGATION_CASE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(DESCRIPTION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(DISPLAY_NAME.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(ICON.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(APPLICATION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(VIEW_HANDLER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(RESOURCE_BUNDLE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(COMPONENT.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(REFERENCED_BEAN.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(RENDER_KIT.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(LIFECYCLE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(VALIDATOR.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FACES_CONFIG_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(RESOURCE_BUNDLE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(ACTION_LISTENER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(DEFAULT_RENDER_KIT_ID.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(MESSAGE_BUNDLE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(NAVIGATION_HANDLER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(STATE_MANAGER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(EL_RESOLVER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(PROPERTY_RESOLVER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(VARIABLE_RESOLVER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(LOCALE_CONFIG.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(APPLICATION_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(DEFAULT_LOCALE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(SUPPORTED_LOCALE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(APPLICATION_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FACES_CONTEXT_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FACELET_CACHE_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(LIFECYCLE_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(RENDER_KIT_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FACTORY_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FACET.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(ATTRIBUTE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(PROPERTY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(COMPONENT_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(CONVERTER_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(MANAGED_PROPERTY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(MAP_ENTRIES.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(LIST_ENTRIES.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(MANAGED_BEAN_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(NAVIGATION_RULE_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(RENDER_KIT_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(PHASE_LISTENER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(LIFECYCLE_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(VALIDATOR_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FACES_CONFIG_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(IF.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(REDIRECT.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(VIEW_PARAM.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(PARTIAL_TRAVERSAL.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(SYSTEM_EVENT_LISTENER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(RESOURCE_HANDLER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(DEFAULT_VALIDATORS.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(ORDERING.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(AFTER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(BEFORE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(ABSOLUTE_ORDERING.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(OTHERS.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(EXCEPTION_HANDLER_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(EXTERNAL_CONTEXT_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(PARTIAL_VIEW_CONTEXT_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(VIEW_DECLARATION_LANGUAGE_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(TAG_HANDLER_DELEGATE_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(VISIT_CONTEXT_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(NAME.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(RENDERER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(CLIENT_BEHAVIOR_RENDERER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(BEHAVIOR.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(BEHAVIOR_EXTENSION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(RESOURCE_LIBRARY_CONTRACTS.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(RESOURCE_BUNDLE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(RESOURCE_HANDLER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(URL_PATTERN.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FLOW_HANDLER_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FLASH_FACTORY.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(START_NODE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(VIEW.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(VDL_DOCUMENT.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(DEFAULT_OUTCOME.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(SWITCH.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(METHOD_CALL.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FLOW_RETURN.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(INITIALIZER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FINALIZER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FLOW_CALL.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(INBOUND_PARAMETER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(OUTBOUND_PARAMETER.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FLOW_REFERENCE.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FLOW_ID.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(METHOD.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(FLOW_DEFINITION.getQName(JsfVersion.JSF_5_0));
+ mappedQNames_5_0.add(PROTECTED_VIEWS.getQName(JsfVersion.JSF_5_0));
}
public static Set getMappedQNames(JsfVersion version) {
Set mappedQNames = mappedQNames_1_1;
- if (version.equals(JsfVersion.JSF_1_2)) {
- mappedQNames = mappedQNames_1_2;
- } else if (version.equals(JsfVersion.JSF_2_0)) {
- mappedQNames = mappedQNames_2_0;
- } else if (version.equals(JsfVersion.JSF_2_1)) {
- mappedQNames = mappedQNames_2_1;
- } else if (version.equals(JsfVersion.JSF_2_2)) {
- mappedQNames = mappedQNames_2_2;
- } else if (version.equals(JsfVersion.JSF_2_3)) {
- mappedQNames = mappedQNames_2_3;
- } else if (version.equals(JsfVersion.JSF_3_0)) {
- mappedQNames = mappedQNames_3_0;
- } else if (version.equals(JsfVersion.JSF_4_0)) {
- mappedQNames = mappedQNames_4_0;
- } else if (version.equals(JsfVersion.JSF_4_1)) {
- mappedQNames = mappedQNames_4_1;
+ switch (version) {
+ case JSF_1_2 -> mappedQNames = mappedQNames_1_2;
+ case JSF_2_0 -> mappedQNames = mappedQNames_2_0;
+ case JSF_2_1 -> mappedQNames = mappedQNames_2_1;
+ case JSF_2_2 -> mappedQNames = mappedQNames_2_2;
+ case JSF_2_3 -> mappedQNames = mappedQNames_2_3;
+ case JSF_3_0 -> mappedQNames = mappedQNames_3_0;
+ case JSF_4_0 -> mappedQNames = mappedQNames_4_0;
+ case JSF_4_1 -> mappedQNames = mappedQNames_4_1;
+ case JSF_5_0 -> mappedQNames = mappedQNames_5_0;
+ default -> {
+ }
}
return Collections.unmodifiableSet(mappedQNames);
}
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/faces-config_5_0.xml b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/faces-config_5_0.xml
new file mode 100644
index 000000000000..bc04058efdf7
--- /dev/null
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/faces-config_5_0.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/compositeComponent.template b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/compositeComponent.template
index 651c9be3849c..aa67a43fbac5 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/compositeComponent.template
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/compositeComponent.template
@@ -1,7 +1,7 @@
+<#if isJSF40?? || isJSF41?? || isJSF50??>
xmlns:cc="jakarta.faces.composite">
<#elseif isJSF22?? || isJSF30??>
xmlns:cc="http://xmlns.jcp.org/jsf/composite">
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_5_0.xsd b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_5_0.xsd
new file mode 100644
index 000000000000..b52401e59237
--- /dev/null
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_5_0.xsd
@@ -0,0 +1,751 @@
+
+
+
+
+
+
+
+ Copyright (c) 2009, 2023 Oracle and/or its affiliates. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v. 2.0, which is available at
+ http://www.eclipse.org/legal/epl-2.0.
+
+ This Source Code may also be made available under the following Secondary
+ Licenses when the conditions for such availability set forth in the
+ Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ version 2 with the GNU Classpath Exception, which is available at
+ https://www.gnu.org/software/classpath/license.html.
+
+ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+
+
+
+
+
+ The XML Schema for the Tag Libraries in the Jakarta Faces
+ Standard Facelets View Declaration Language (Facelets VDL)
+ (Version 5.0).
+
+
Jakarta Faces 5.0 Facelet Tag Libraries that wish to conform to
+ this schema must declare it in the following manner.
The instance documents may indicate the published
+ version of the schema using xsi:schemaLocation attribute
+ for jakartaee namespace with the following location:
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ tag-names must be unique within a document.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ Behavior IDs must be unique within a document.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ Converter IDs must be unique within a document.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ Validator IDs must be unique within a document.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The top level XML element in a facelet tag library XML file.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ An advisory short name for usages of tags from this tag library.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for facelet-taglib. It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If the tag library XML
+ file contains individual tag declarations rather than pointing
+ to a library-class or a declaring a composite-library name, the
+ individual tags are enclosed in tag elements.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The attribute element defines an attribute for the nesting
+ tag. The attribute element may have several subelements
+ defining:
+
+
+
+
description
a description of the attribute
+
+
+
name
the name of the attribute
+
+
+
required
whether the attribute is required or
+ optional
+
+
+
type
the type of the attribute
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+ Defines if the nesting attribute is required or
+ optional.
+
+
If not present then the default is "false", i.e
+ the attribute is optional.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+ Defines the Java type of the attributes
+ value. If this element is omitted, the
+ expected type is assumed to be
+ "java.lang.Object".
+
+ ]]>
+
+
+
+
+
+
+
+
+ Defines the method signature for a MethodExpression-
+ enabled attribute. The syntax of the method-signature
+ element is as follows (taken from the function-signature
+ EBNF in web-jsptaglibrary_2_1.xsd):
+
+
+
+
Type is a basic type or a fully qualified
+ Java class name (including package name), as per the 'Type'
+ production in the Java Language Specification, Second Edition,
+ Chapter 18.
+
+
Identifier is a Java identifier, as per the
+ 'Identifier' production in the Java Language Specification,
+ Second Edition, Chapter 18.
+
+
+
+
Example:
+
+
java.lang.String nickName( java.lang.String, int )
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for tag It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If the tag library XML file contains individual function
+ declarations rather than pointing to a library-class or a
+ declaring a composite-library name, the individual functions are
+ enclosed in function elements.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Within a tag element, the behavior element encapsulates
+ information specific to a Faces Behavior.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for behavior. It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Within a tag element, the component
+ element encapsulates information specific to a Faces UIComponent.
+
+
+
+
As of 3.0 of the specification, this requirement is no longer
+ present: This element must have exactly one of
+ <component-type>, <resource-id>,
+ or <handler-class> among its child elements.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ A valid resource identifier
+ as specified in the Jakarta Faces Specification Document section 2.6.1.3 "Resource Identifiers".
+ For example:
+
+
<resource-id>myCC/ccName.xhtml</resource-id>
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for component It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Within a tag element, the converter element encapsulates
+ information specific to a Faces Converter.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for converter It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Within a tag element, the validator element encapsulates
+ information specific to a Faces Validator.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for validator It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This type contains the recognized versions of
+ facelet-taglib supported.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Defines the canonical name of a tag or attribute being
+ defined.
+
+
The name must conform to the lexical rules for an NCName
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-faces-mime-resolver.xml b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-faces-mime-resolver.xml
index 3d712f867e04..7952c3a1db65 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-faces-mime-resolver.xml
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-faces-mime-resolver.xml
@@ -122,4 +122,14 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facesconfig_5_0.xsd b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facesconfig_5_0.xsd
new file mode 100644
index 000000000000..309dfc8e7938
--- /dev/null
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facesconfig_5_0.xsd
@@ -0,0 +1,3447 @@
+
+
+
+
+
+
+
+ Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v. 2.0, which is available at
+ http://www.eclipse.org/legal/epl-2.0.
+
+ This Source Code may also be made available under the following Secondary
+ Licenses when the conditions for such availability set forth in the
+ Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ version 2 with the GNU Classpath Exception, which is available at
+ https://www.gnu.org/software/classpath/license.html.
+
+ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+
+
+
+
+
+ The XML Schema for the Jakarta Faces Application
+ Configuration File (Version 5.0).
+
+
All Jakarta Faces configuration files must indicate
+ the Jakarta Faces schema by indicating the
+ Jakarta Faces namespace:
+
+
https://jakarta.ee/xml/ns/jakartaee
+
+
and by indicating the version of the schema by
+ using the version element as shown below:
The instance documents may indicate the published
+ version of the schema using xsi:schemaLocation attribute
+ for jakartaee namespace with the following location:
+
+ ]]>
+
+
+
+
+
+
+
+
+
+ The "faces-config" element is the root of the configuration
+ information hierarchy, and contains nested elements for all
+ of the other configuration settings.
+
+ ]]>
+
+
+
+
+
+ Behavior IDs must be unique within a document.
+
+ ]]>
+
+
+
+
+
+
+
+
+ Converter IDs must be unique within a document.
+
+ ]]>
+
+
+
+
+
+
+
+
+ 'converter-for-class' element values must be unique
+ within a document.
+
+ ]]>
+
+
+
+
+
+
+
+
+ Validator IDs must be unique within a document.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "faces-config" element is the root of the configuration
+ information hierarchy, and contains nested elements for all
+ of the other configuration settings.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "name" element
+ within the top level "faces-config"
+ element declares the name of this application
+ configuration resource. Such names are used
+ in the document ordering scheme specified in section
+ 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document.
+
+
This value is taken to be the
+ defining document id of any <flow-definition> elements
+ defined in this Application Configuration Resource file. If this
+ element is not specified, the runtime must take the empty string
+ as its value.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The metadata-complete attribute defines whether this
+ Faces application is complete, or whether
+ the class files available to this module and packaged with
+ this application should be examined for annotations
+ that specify configuration information.
+
+ This attribute is only inspected on the application
+ configuration resource file located at "WEB-INF/faces-config.xml".
+ The presence of this attribute on any application configuration
+ resource other than the one located at "WEB-INF/faces-config.xml",
+ including any files named using the jakarta.faces.CONFIG_FILES
+ attribute, must be ignored.
+
+ If metadata-complete is set to "true", the Faces
+ runtime must ignore any annotations that specify configuration
+ information, which might be present in the class files
+ of the application.
+
+ If metadata-complete is not specified or is set to
+ "false", the Faces runtime must examine the class
+ files of the application for annotations, as specified by
+ the specification.
+
+ If "WEB-INF/faces-config.xml" is not present, the
+ Faces runtime will assume metadata-complete to be "false".
+
+ The value of this attribute will have no impact on
+ runtime annotations such as @ResourceDependency or
+ @ListenerFor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for faces-config. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Please see section
+ 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document
+ for the specification of this element.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This element contains a sequence of "id" elements, each of which
+ refers to an application configuration resource by the "id"
+ declared on its faces-config element. This element can also contain
+ a single "others" element which specifies that this document comes
+ before or after other documents within the application.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This element indicates that the ordering sub-element in which
+ it was placed should take special action regarding the ordering
+ of this application resource relative to other
+ application configuration resources.
+ See section 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document
+ for the complete specification.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Only relevant if this is placed within the /WEB-INF/faces-config.xml.
+ Please see
+ section 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document
+ for the specification for details.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "application" element provides a mechanism to define the
+ various per-application-singleton implementation artifacts for
+ a particular web application that is utilizing
+ Jakarta Faces. For nested elements that are not specified,
+ the Jakarta Faces implementation must provide a suitable
+ default.
+
+ ]]>
+
+
+
+
+
+
+ The "action-listener" element contains the fully
+ qualified class name of the concrete
+ ActionListener implementation class that will be
+ called during the Invoke Application phase of the
+ request processing lifecycle.
+
+ ]]>
+
+
+
+
+
+
+ The "default-render-kit-id" element allows the
+ application to define a renderkit to be used other
+ than the standard one.
+
+ ]]>
+
+
+
+
+
+
+ The base name of a resource bundle representing
+ the message resources for this application. See
+ the JavaDocs for the "java.util.ResourceBundle"
+ class for more information on the syntax of
+ resource bundle names.
+
+ ]]>
+
+
+
+
+
+
+ The "navigation-handler" element contains the
+ fully qualified class name of the concrete
+ NavigationHandler implementation class that will
+ be called during the Invoke Application phase
+ of the request processing lifecycle, if the
+ default ActionListener (provided by the Jakarta Faces
+ implementation) is used.
+
+ ]]>
+
+
+
+
+
+
+ The "view-handler" element contains the fully
+ qualified class name of the concrete ViewHandler
+ implementation class that will be called during
+ the Restore View and Render Response phases of the
+ request processing lifecycle. The faces
+ implementation must provide a default
+ implementation of this class.
+
+ ]]>
+
+
+
+
+
+
+ The "state-manager" element contains the fully
+ qualified class name of the concrete StateManager
+ implementation class that will be called during
+ the Restore View and Render Response phases of the
+ request processing lifecycle. The faces
+ implementation must provide a default
+ implementation of this class.
+
+ ]]>
+
+
+
+
+
+
+ The "el-resolver" element contains the fully
+ qualified class name of the concrete
+ jakarta.el.ELResolver implementation class
+ that will be used during the processing of
+ EL expressions.
+
+ ]]>
+
+
+
+
+
+
+ The "resource-handler" element contains the
+ fully qualified class name of the concrete
+ ResourceHandler implementation class that
+ will be used during rendering and decoding
+ of resource requests The standard
+ constructor based decorator pattern used for
+ other application singletons will be
+ honored.
+
+ ]]>
+
+
+
+
+
+
+ The "resource-library-contracts" element
+ specifies the mappings between views in the application and resource
+ library contracts that, if present in the application, must be made
+ available for use as templates of the specified views.
+
+
+ ]]>
+
+
+
+
+
+
+ The "search-expression-handler"
+ element contains the fully qualified class name of the
+ concrete jakarta.faces.component.search.SearchExpressionHandler
+ implementation class that will be used for processing of a
+ search expression.
+
+ ]]>
+
+
+
+
+
+
+ The "search-keyword-resolver"
+ element contains the fully qualified class name of the
+ concrete jakarta.faces.component.search.SearchKeywordResolver
+ implementation class that will be used during the processing
+ of a search expression keyword.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The resource-bundle element inside the application element
+ references a java.util.ResourceBundle instance by name
+ using the var element. ResourceBundles referenced in this
+ manner may be returned by a call to
+ Application.getResourceBundle() passing the current
+ FacesContext for this request and the value of the var
+ element below.
+
+ ]]>
+
+
+
+
+
+
+
+ The fully qualified class name of the
+ java.util.ResourceBundle instance.
+
+ ]]>
+
+
+
+
+
+
+ The name by which this ResourceBundle instance
+ is retrieved by a call to
+ Application.getResourceBundle().
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "resource-library-contracts" element
+ specifies the mappings between views in the application and resource
+ library contracts that, if present in the application, must be made
+ available for use as templates of the specified views.
+
+
+ ]]>
+
+
+
+
+
+
+
+ Declare a mapping between a collection
+ of views in the application and the list of contracts (if present in the application)
+ that may be used as a source for templates and resources for those views.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "contract-mapping" element
+ specifies the mappings between a collection of views in the application and resource
+ library contracts that, if present in the application, must be made
+ available for use as templates of the specified views.
+
+
+ ]]>
+
+
+
+
+
+
+
+ The "url-pattern" element
+ specifies the collection of views in this application that
+ are allowed to use the corresponding contracts.
+
+
+ ]]>
+
+
+
+
+
+
+ The "contracts" element
+ is a comma separated list of resource library contracts that,
+ if available to the application, may be used by the views
+ matched by the corresponding "url-pattern"
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for application. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "factory" element provides a mechanism to define the
+ various Factories that comprise parts of the implementation
+ of Jakarta Faces. For nested elements that are not
+ specified, the Jakarta Faces implementation must provide a
+ suitable default.
+
+ ]]>
+
+
+
+
+
+
+ The "application-factory" element contains the
+ fully qualified class name of the concrete
+ ApplicationFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(APPLICATION_FACTORY) is
+ called.
+
+ ]]>
+
+
+
+
+
+
+ The "exception-handler-factory" element contains the
+ fully qualified class name of the concrete
+ ExceptionHandlerFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(EXCEPTION_HANDLER_FACTORY)
+ is called.
+
+ ]]>
+
+
+
+
+
+
+ The "external-context-factory" element contains the
+ fully qualified class name of the concrete
+ ExternalContextFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(EXTERNAL_CONTEXT_FACTORY)
+ is called.
+
+ ]]>
+
+
+
+
+
+
+ The "faces-context-factory" element contains the
+ fully qualified class name of the concrete
+ FacesContextFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(FACES_CONTEXT_FACTORY)
+ is called.
+
+ ]]>
+
+
+
+
+
+
+ The "facelet-cache-factory" element contains the
+ fully qualified class name of the concrete
+ FaceletCacheFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(FACELET_CACHE_FACTORY)
+ is called.
+
+ ]]>
+
+
+
+
+
+
+ The "partial-view-context-factory" element contains the
+ fully qualified class name of the concrete
+ PartialViewContextFactory implementation class that will
+ be called when FactoryFinder.getFactory
+ (FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY) is called.
+
+ ]]>
+
+
+
+
+
+
+ The "lifecycle-factory" element contains the fully
+ qualified class name of the concrete LifecycleFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(LIFECYCLE_FACTORY) is called.
+
+ ]]>
+
+
+
+
+
+
+ The "view-declaration-language-factory" element contains
+ the fully qualified class name of the concrete
+ ViewDeclarationLanguageFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(VIEW_DECLARATION_FACTORY) is called.
+
+ ]]>
+
+
+
+
+
+
+ The "tag-handler-delegate-factory" element contains
+ the fully qualified class name of the concrete
+ ViewDeclarationLanguageFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(TAG_HANDLER_DELEGATE_FACTORY) is called.
+
+ ]]>
+
+
+
+
+
+
+ The "render-kit-factory" element contains the fully
+ qualified class name of the concrete RenderKitFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(RENDER_KIT_FACTORY) is
+ called.
+
+ ]]>
+
+
+
+
+
+
+ The "visit-context-factory" element contains the fully
+ qualified class name of the concrete VisitContextFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(VISIT_CONTEXT_FACTORY) is
+ called.
+
+ ]]>
+
+
+
+
+
+
+ The "flash-factory" element contains the
+ fully qualified class name of the concrete
+ FaceletFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(FLASH_FACTORY) is
+ called.
+
+ ]]>
+
+
+
+
+
+
+ The "flow-handler-factory" element contains the
+ fully qualified class name of the concrete
+ FlowHandlerFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(FLOW_HANDLER_FACTORY) is
+ called.
+
+ ]]>
+
+
+
+
+
+
+ The "client-window-factory" element contains the fully
+ qualified class name of the concrete ClientWindowFactory implementation class that
+ will be called when FactoryFinder.getFactory(CLIENT_WINDOW_FACTORY) is called.
+
+ ]]>
+
+
+
+
+
+
+ The
+ "search-expression-context-factory" element contains the
+ fully qualified class name of the concrete
+ SearchExpressionContextFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(SEARCH_EXPRESSION_CONTEXT_FACTORY)
+ is called.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for factory. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "attribute" element represents a named, typed, value
+ associated with the parent UIComponent via the generic
+ attributes mechanism.
+
+
Attribute names must be unique within the scope of the parent
+ (or related) component.
+
+ ]]>
+
+
+
+
+
+
+
+ The "attribute-name" element represents the name under
+ which the corresponding value will be stored, in the
+ generic attributes of the UIComponent we are related
+ to.
+
+ ]]>
+
+
+
+
+
+
+ The "attribute-class" element represents the Java type
+ of the value associated with this attribute name.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for attribute. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "component" element represents a concrete UIComponent
+ implementation class that should be registered under the
+ specified type identifier, along with its associated
+ properties and attributes. Component types must be unique
+ within the entire web application.
+
+
Nested "attribute" elements identify generic attributes that
+ are recognized by the implementation logic of this component.
+ Nested "property" elements identify JavaBeans properties of
+ the component class that may be exposed for manipulation
+ via tools.
+
+ ]]>
+
+
+
+
+
+
+
+ The "component-type" element represents the name under
+ which the corresponding UIComponent class should be
+ registered.
+
+ ]]>
+
+
+
+
+
+
+ The "component-class" element represents the fully
+ qualified class name of a concrete UIComponent
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for component. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "default-locale" element declares the default locale
+ for this application instance.
+
+
+ To facilitate BCP 47 this element first needs to be parsed by the
+ Locale.forLanguageTag method. If it does not return a Locale with
+ a language the old specification below needs to take effect.
+
+
+
It must be specified as :language:[_:country:[_:variant:]]
+ without the colons, for example "ja_JP_SJIS". The
+ separators between the segments may be '-' or '_'.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "default-value" contains the value for the property or
+ attribute in which this element resides. This value differs
+ from the "suggested-value" in that the property or attribute
+ must take the value, whereas in "suggested-value" taking the
+ value is optional.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ EL expressions present within a faces config file
+ must start with the character sequence of '#{' and
+ end with '}'.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Define the name and other design-time information for a facet
+ that is associated with a renderer or a component.
+
+ ]]>
+
+
+
+
+
+
+
+ The "facet-name" element represents the facet name
+ under which a UIComponent will be added to its parent.
+ It must be of type "Identifier".
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for facet. It may contain implementation
+ specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The
+ value of from-view-id must contain one of the following
+ values:
+
+
+
+
The exact match for a view identifier that is recognized
+ by the the ViewHandler implementation being used (such as
+ "/index.jsp" if you are using the default ViewHandler).
+
+
The exact match of a flow node id
+ in the current flow, or a flow id of another flow.
+
+
A proper prefix of a view identifier, plus a trailing
+ "*" character. This pattern indicates that all view
+ identifiers that match the portion of the pattern up to the
+ asterisk will match the surrounding rule. When more than one
+ match exists, the match with the longest pattern is selected.
+
+
+
An "*" character, which means that this pattern applies
+ to all view identifiers.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "from-action" element contains an action reference
+ expression that must have been executed (by the default
+ ActionListener for handling application level events)
+ in order to select the navigation rule. If not specified,
+ this rule will be relevant no matter which action reference
+ was executed (or if no action reference was executed).
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "if" element defines a condition that must resolve
+ to true in order for the navigation case on which it is
+ defined to be matched, with the existing match criteria
+ (action method and outcome) as a prerequiste, if present.
+ The condition is defined declaratively using a value
+ expression in the body of this element. The expression is
+ evaluated at the time the navigation case is being matched.
+ If the "from-outcome" is omitted and this element is
+ present, the navigation handler will match a null outcome
+ and use the condition return value to determine if the
+ case should be considered a match.
+
+
+
+
When used in a <switch> within a flow, if the
+ expresion returns true, the
+ <from-outcome> sibling element's outcome is used as
+ the id of the node in the flow graph to which control must be
+ passed.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "converter" element represents a concrete Converter
+ implementation class that should be registered under the
+ specified converter identifier. Converter identifiers must
+ be unique within the entire web application.
+
+
Nested "attribute" elements identify generic attributes that
+ may be configured on the corresponding UIComponent in order
+ to affect the operation of the Converter. Nested "property"
+ elements identify JavaBeans properties of the Converter
+ implementation class that may be configured to affect the
+ operation of the Converter. "attribute" and "property"
+ elements are intended to allow component developers to
+ more completely describe their components to tools and users.
+ These elements have no required runtime semantics.
+
+ ]]>
+
+
+
+
+
+
+
+
+ The "converter-id" element represents the
+ identifier under which the corresponding
+ Converter class should be registered.
+
+ ]]>
+
+
+
+
+
+
+ The "converter-for-class" element represents the
+ fully qualified class name for which a Converter
+ class will be registered.
+
+ ]]>
+
+
+
+
+
+
+
+ The "converter-class" element represents the fully
+ qualified class name of a concrete Converter
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+ Nested "attribute" elements identify generic
+ attributes that may be configured on the
+ corresponding UIComponent in order to affect the
+ operation of the Converter. This attribute is
+ primarily for design-time tools and is not
+ specified to have any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+ Nested "property" elements identify JavaBeans
+ properties of the Converter implementation class
+ that may be configured to affect the operation of
+ the Converter. This attribute is primarily for
+ design-time tools and is not specified to have
+ any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for converter. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "lifecycle" element provides a mechanism to specify
+ modifications to the behaviour of the default Lifecycle
+ implementation for this web application.
+
+ ]]>
+
+
+
+
+
+
+ The "phase-listener" element contains the fully
+ qualified class name of the concrete PhaseListener
+ implementation class that will be registered on
+ the Lifecycle.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for lifecycle. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ The localeType defines valid locale defined by ISO-639-1
+ and ISO-3166.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "locale-config" element allows the app developer to
+ declare the supported locales for this application.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "default-validators" element allows the app developer to
+ register a set of validators, referenced by identifier, that
+ are automatically assigned to any EditableValueHolder component
+ in the application, unless overridden or disabled locally.
+
+ ]]>
+
+
+
+
+
+
+ The "validator-id" element represents the identifier
+ of a registered validator.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Top level element for a flow
+ definition.
+
+
+
+
If there is no <start-node> element declared, it
+ is assumed to be <flowName>.xhtml.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+ Declare the id of the starting node in the
+ flow graph. The start node may be any of the node types mentioned in
+ the class javadocs for FlowHandler.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The id of this flow. The id
+ must be unique within the Application configuration Resource
+ file in which this flow is defined. The value of this attribute,
+ combined with the value of the <faces-config><name> element
+ must globally identify the flow within the application.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Invoke a method, passing parameters if necessary.
+ The return from the method is used as the outcome for where to go next in the
+ flow. If the method is a void method, the default outcome is used.
+
+ ]]>
+
+
+
+
+
+
+
+
+ A parameter to pass when calling the method
+ identified in the "method" element that is a sibling of this element.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A parameter to pass when calling the method
+ identified in the "method" element that is a sibling of this element.
+
+ ]]>
+
+
+
+
+
+
+ The optional "class" element within a "parameter" element
+ will be interpreted as the fully qualified class name for the type
+ of the "value" element.
+
+ ]]>
+
+
+
+
+
+
+ The "value" element within an "parameter"
+ must be a literal string or an EL Expression whose "get" will be called when the "method"
+ associated with this element is invoked.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ Define a view node in a flow graph.
+
+
This element must contain exactly one
+ <vdl-document> element.
+
+ ]]>
+
+
+
+
+
+
+
+ Define the path to the vdl-document for the enclosing view.
+
+
+ ]]>
+
+
+
+
+
+
+
+ The id of this view. It must be
+ unique within the flow.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Define a switch node in a flow graph.
+
+
+
+
This element must contain one or more
+ <case> elements. When control passes to the
+ <switch> node, each of the cases must be considered
+ in order and control must past to the <from-outcome>
+ of the first one whose <if> expression evaluates to
+ true.
+
+
+
+ ]]>
+
+
+
+
+
+
+ Defines a case that must be
+ considered in the list of cases in the
+ <switch>.
+
+ ]]>
+
+
+
+
+
+
+ Defines the default case that will
+ be taken if none of the other cases in the
+ <switch> are taken.
+
+ ]]>
+
+
+
+
+
+
+
+ The id of this switch. It must be
+ unique within the flow.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Defines a case that will
+ be considered in the <switch>.
+
+ ]]>
+
+
+
+
+
+
+
+ If this EL expression evaluates to
+ true, the corresponding from-outcome will
+ be the outcome taken by the enclosing <switch>
+
+ ]]>
+
+
+
+
+
+
+ The "from-outcome" element contains a logical outcome
+ string returned by the execution of an application
+ action method selected via an "actionRef" property
+ (or a literal value specified by an "action" property)
+ of a UICommand component. If specified, this rule
+ will be relevant only if the outcome value matches
+ this element's value. If not specified, this rule
+ will be relevant if the outcome value is non-null
+ or, if the "if" element is present, will be relevant
+ for any outcome value, with the assumption that the
+ condition specified in the "if" element ultimately
+ determines if this rule is a match.
+
+
If used in a faces flow, this element
+ represents the node id to which control will be passed.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Define a return node in a flow graph.
+
+
+
+
This element must contain exactly one <from-outcome> element.
+
+
+ ]]>
+
+
+
+
+
+
+ This element
+ represents the node id to which control will be passed.
+
+ ]]>
+
+
+
+
+
+
+
+ The id of this flow-return.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Define a call node in a flow graph.
+
+
+
+
This element must contain exactly one <flow-reference> element,
+ which must contain exactly one <flow-id> element.
+
+
+ ]]>
+
+
+
+
+
+
+ The flow id of the called flow.
+
+ ]]>
+
+
+
+
+
+
+ A parameter to pass when calling the flow
+ identified in the "flow-reference" element that is a sibling of this element.
+
+ ]]>
+
+
+
+
+
+
+
+ The id of this flow-return.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Identifiy the called flow.
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ The document id of the called flow.
+
+ ]]>
+
+
+
+
+
+
+ The id of the called flow.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ A MethodExpression that will be invoked when the flow is entered.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A MethodExpression that will be invoked when the flow is exited.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A named parameter whose value will be populated
+ with a correspondingly named parameter within an "outbound-parameter" element.
+
+ ]]>
+
+
+
+
+
+
+ The "name" element within an "inbound-parameter"
+ element declares the name of this parameter
+ to be passed into a flow. There must be
+ a sibling "value" element in the same parent as this element.
+
+ ]]>
+
+
+
+
+
+
+ The "value" element within an "inbound-parameter"
+ must be an EL Expression whose value will be set with the correspondingly
+ named "outbound-parameter" when this flow is entered, if such a
+ parameter exists.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ A named parameter whose value will be
+ passed to a correspondingly named parameter within an "inbound-parameter" element
+ on the target flow.
+
+ ]]>
+
+
+
+
+
+
+ The "name" element within an "outbound-parameter" element
+ declares the name of this parameter to be passed out of a flow. There must be
+ a sibling "value" element in the same parent as this element.
+
+ ]]>
+
+
+
+
+
+
+ The "value" element within an "outbound-parameter"
+ must be a literal string or an EL Expression whose "get" will be called when the "flow-call"
+ containing this element is traversed to go to a new flow.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The
+ "navigation-case" element describes a particular
+ combination of conditions that must match for this case to
+ be executed, and the view id of the component tree that
+ should be selected next.
+
+ ]]>
+
+
+
+
+
+
+
+
+ The "from-outcome" element contains a logical outcome
+ string returned by the execution of an application
+ action method selected via an "actionRef" property
+ (or a literal value specified by an "action" property)
+ of a UICommand component. If specified, this rule
+ will be relevant only if the outcome value matches
+ this element's value. If not specified, this rule
+ will be relevant if the outcome value is non-null
+ or, if the "if" element is present, will be relevant
+ for any outcome value, with the assumption that the
+ condition specified in the "if" element ultimately
+ determines if this rule is a match.
+
+ ]]>
+
+
+
+
+
+
+ Please see section 7.4.2 "Default NavigationHandler Algorithm" of the Jakarta Faces Specification Document
+ for the specification of this element.
+
+ ]]>
+
+
+
+
+
+
+ The "to-view-id" element
+ contains the view identifier (or
+ flow node id, or flow id)
+ of the next view (or flow node or
+ flow) that should be displayed if this
+ navigation rule is matched. If the contents is a
+ value expression, it should be resolved by the
+ navigation handler to obtain the view (
+ or flow node or flow)
+ identifier.
+
+ ]]>
+
+
+
+
+
+
+ The document id of the called flow.
+ If this element appears in a <navigation-case> nested within
+ a <flow-definition>, it must be ignored because navigation
+ cases within flows may only navigate among the view nodes of that
+ flow.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "navigation-rule" element represents an individual
+ decision rule that will be utilized by the default
+ NavigationHandler implementation to make decisions on
+ what view should be displayed next, based on the
+ view id being processed.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for navigation-rule. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "null-value" element indicates that the managed
+ property in which we are nested will be explicitly
+ set to null if our managed bean is automatically
+ created. This is different from omitting the managed
+ property element entirely, which will cause no
+ property setter to be called for this property.
+
+
The "null-value" element can only be used when the
+ associated "property-class" identifies a Java class,
+ not a Java primitive.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ The "property" element represents a JavaBean property of the
+ Java class represented by our parent element.
+
+
Property names must be unique within the scope of the Java
+ class that is represented by the parent element, and must
+ correspond to property names that will be recognized when
+ performing introspection against that class via
+ java.beans.Introspector.
+
+ ]]>
+
+
+
+
+
+
+
+ The "property-name" element represents the JavaBeans
+ property name under which the corresponding value
+ may be stored.
+
+ ]]>
+
+
+
+
+
+
+ The "property-class" element represents the Java type
+ of the value associated with this property name.
+ If not specified, it can be inferred from existing
+ classes; however, this element should be specified if
+ the configuration file is going to be the source for
+ generating the corresponding classes.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Any view that matches any of the
+ url-patterns in this element may only be reached from another Jakarta Faces
+ view in the same web application. Because the runtime is aware of
+ which views are protected, any navigation from an unprotected
+ view to a protected view is automatically subject to
+ protection.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for property. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "redirect" element indicates that navigation to the
+ specified "to-view-id" should be accomplished by
+ performing an HTTP redirect rather than the usual
+ ViewHandler mechanisms.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This element was introduced due to a specification
+ error, and is now deprecated. The correct name for
+ this element is "redirect-param" and its meaning is
+ documented therein. The "view-param" element is
+ maintained to preserve backwards compatibility.
+ Implementations must treat this element the same as
+ "redirect-param".
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "redirect-param" element, only valid within
+ a "redirect" element, contains child "name"
+ and "value" elements that must be included in the
+ redirect url when the redirect is performed.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "referenced-bean" element represents at design time the
+ promise that a Java object of the specified type will exist at
+ runtime in some scope, under the specified key. This can be
+ used by design time tools to construct user interface dialogs
+ based on the properties of the specified class. The presence
+ or absence of a referenced bean element has no impact on the
+ Jakarta Faces runtime environment inside a web application.
+
+ ]]>
+
+
+
+
+
+
+
+ The "referenced-bean-name" element represents the
+ attribute name under which the corresponding
+ referenced bean may be assumed to be stored, in one
+ of 'request', 'session', 'view', 'application'
+ or a custom scope.
+
+ ]]>
+
+
+
+
+
+
+ The "referenced-bean-class" element represents the
+ fully qualified class name of the Java class
+ (either abstract or concrete) or Java interface
+ implemented by the corresponding referenced bean.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "render-kit" element represents a concrete RenderKit
+ implementation that should be registered under the specified
+ render-kit-id. If no render-kit-id is specified, the
+ identifier of the default RenderKit
+ (RenderKitFactory.DEFAULT_RENDER_KIT) is assumed.
+
+ ]]>
+
+
+
+
+
+
+
+ The "render-kit-id" element represents an identifier
+ for the RenderKit represented by the parent
+ "render-kit" element.
+
+ ]]>
+
+
+
+
+
+
+ The "render-kit-class" element represents the fully
+ qualified class name of a concrete RenderKit
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "client-behavior-renderer" element represents a concrete
+ ClientBehaviorRenderer implementation class that should be
+ registered under the specified behavior renderer type identifier,
+ in the RenderKit associated with the parent "render-kit"
+ element. Client Behavior renderer type must be unique within the RenderKit
+ associated with the parent "render-kit" element.
+
+
Nested "attribute" elements identify generic component
+ attributes that are recognized by this renderer.
+
+ ]]>
+
+
+
+
+
+
+ The "client-behavior-renderer-type" element represents a renderer type
+ identifier for the Client Behavior Renderer represented by the parent
+ "client-behavior-renderer" element.
+
+ ]]>
+
+
+
+
+
+
+ The "client-behavior-renderer-class" element represents the fully
+ qualified class name of a concrete Client Behavior Renderer
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "renderer" element represents a concrete Renderer
+ implementation class that should be registered under the
+ specified component family and renderer type identifiers,
+ in the RenderKit associated with the parent "render-kit"
+ element. Combinations of component family and
+ renderer type must be unique within the RenderKit
+ associated with the parent "render-kit" element.
+
+
Nested "attribute" elements identify generic component
+ attributes that are recognized by this renderer.
+
+ ]]>
+
+
+
+
+
+
+
+ The "component-family" element represents the
+ component family for which the Renderer represented
+ by the parent "renderer" element will be used.
+
+ ]]>
+
+
+
+
+
+
+ The "renderer-type" element represents a renderer type
+ identifier for the Renderer represented by the parent
+ "renderer" element.
+
+ ]]>
+
+
+
+
+
+
+ The "renderer-class" element represents the fully
+ qualified class name of a concrete Renderer
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for renderer. It may contain implementation
+ specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for render-kit. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "suggested-value" contains the value for the property or
+ attribute in which this element resides. This value is
+ advisory only and is intended for tools to use when
+ populating pallettes.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "supported-locale" element allows authors to declare
+ which locales are supported in this application instance.
+
+
+ To facilitate BCP 47 this element first needs to be parsed by the
+ Locale.forLanguageTag method. If it does not return a Locale with
+ a language the old specification below needs to take effect.
+
+
+
It must be specified as :language:[_:country:[_:variant:]]
+ without the colons, for example "ja_JP_SJIS". The
+ separators between the segments may be '-' or '_'.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "behavior" element represents a concrete Behavior
+ implementation class that should be registered under the
+ specified behavior identifier. Behavior identifiers must
+ be unique within the entire web application.
+
+
Nested "attribute" elements identify generic attributes that
+ may be configured on the corresponding UIComponent in order
+ to affect the operation of the Behavior. Nested "property"
+ elements identify JavaBeans properties of the Behavior
+ implementation class that may be configured to affect the
+ operation of the Behavior. "attribute" and "property"
+ elements are intended to allow component developers to
+ more completely describe their components to tools and users.
+ These elements have no required runtime semantics.
+
+ ]]>
+
+
+
+
+
+
+
+ The "behavior-id" element represents the identifier
+ under which the corresponding Behavior class should
+ be registered.
+
+ ]]>
+
+
+
+
+
+
+ The "behavior-class" element represents the fully
+ qualified class name of a concrete Behavior
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+ Nested "attribute" elements identify generic
+ attributes that may be configured on the
+ corresponding UIComponent in order to affect the
+ operation of the Behavior. This attribute is
+ primarily for design-time tools and is not
+ specified to have any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+ Nested "property" elements identify JavaBeans
+ properties of the Behavior implementation class
+ that may be configured to affect the operation of
+ the Behavior. This attribute is primarily for
+ design-time tools and is not specified to have
+ any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for behavior. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "validator" element represents a concrete Validator
+ implementation class that should be registered under the
+ specified validator identifier. Validator identifiers must
+ be unique within the entire web application.
+
+
Nested "attribute" elements identify generic attributes that
+ may be configured on the corresponding UIComponent in order
+ to affect the operation of the Validator. Nested "property"
+ elements identify JavaBeans properties of the Validator
+ implementation class that may be configured to affect the
+ operation of the Validator. "attribute" and "property"
+ elements are intended to allow component developers to
+ more completely describe their components to tools and users.
+ These elements have no required runtime semantics.
+
+ ]]>
+
+
+
+
+
+
+
+ The "validator-id" element represents the identifier
+ under which the corresponding Validator class should
+ be registered.
+
+ ]]>
+
+
+
+
+
+
+ The "validator-class" element represents the fully
+ qualified class name of a concrete Validator
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+ Nested "attribute" elements identify generic
+ attributes that may be configured on the
+ corresponding UIComponent in order to affect the
+ operation of the Validator. This attribute is
+ primarily for design-time tools and is not
+ specified to have any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+ Nested "property" elements identify JavaBeans
+ properties of the Validator implementation class
+ that may be configured to affect the operation of
+ the Validator. This attribute is primarily for
+ design-time tools and is not specified to have
+ any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for validator. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ The "value" element is the String representation of
+ a literal value to which a scalar managed property
+ will be set, or a value binding expression ("#{...}")
+ that will be used to calculate the required value.
+ It will be converted as specified for the actual
+ property type.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ The presence of this element within the "application" element in
+ an application configuration resource file indicates the
+ developer wants to add an SystemEventListener to this
+ application instance. Elements nested within this element allow
+ selecting the kinds of events that will be delivered to the
+ listener instance, and allow selecting the kinds of classes that
+ can be the source of events that are delivered to the listener
+ instance.
+
+ ]]>
+
+
+
+
+
+
+ The "system-event-listener-class" element contains
+ the fully qualified class name of the concrete
+ SystemEventListener implementation class that will be
+ called when events of the type specified by the
+ "system-event-class" are sent by the runtime.
+
+ ]]>
+
+
+
+
+
+
+ The "system-event-class" element contains the fully
+ qualified class name of the SystemEvent subclass for
+ which events will be delivered to the class whose fully
+ qualified class name is given by the
+ "system-event-listener-class" element.
+
+ ]]>
+
+
+
+
+
+
+ The "source-class" element, if present, contains the
+ fully qualified class name of the class that will be the
+ source for the event to be delivered to the class whose
+ fully qualified class name is given by the
+ "system-event-listener-class" element.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ This type contains the recognized versions of
+ faces-config supported.
+
+ ]]>
+
+
+
+
+
+
+
+
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/CompositeComponentWizardIterator.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/CompositeComponentWizardIterator.java
index b82c3b32404c..024b6db52781 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/CompositeComponentWizardIterator.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/CompositeComponentWizardIterator.java
@@ -72,7 +72,9 @@ public Set instantiate(TemplateWizard wiz) throws IOException {
WebModule webModule = WebModule.getWebModule(project.getProjectDirectory());
if (webModule != null) {
JsfVersion version = JsfVersionUtils.forWebModule(webModule);
- if (version != null && version.isAtLeast(JsfVersion.JSF_4_1)) {
+ if (version != null && version.isAtLeast(JsfVersion.JSF_5_0)) {
+ templateProperties.put("isJSF50", Boolean.TRUE); //NOI18N
+ } else if (version != null && version.isAtLeast(JsfVersion.JSF_4_1)) {
templateProperties.put("isJSF41", Boolean.TRUE); //NOI18N
} else if (version != null && version.isAtLeast(JsfVersion.JSF_4_0)) {
templateProperties.put("isJSF40", Boolean.TRUE); //NOI18N
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/FacesConfigIterator.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/FacesConfigIterator.java
index bd6106c6e2eb..cf8e6db3cb1f 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/FacesConfigIterator.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/FacesConfigIterator.java
@@ -57,6 +57,7 @@
import static org.netbeans.modules.web.jsfapi.api.JsfVersion.JSF_2_3;
import static org.netbeans.modules.web.jsfapi.api.JsfVersion.JSF_3_0;
import static org.netbeans.modules.web.jsfapi.api.JsfVersion.JSF_4_0;
+import static org.netbeans.modules.web.jsfapi.api.JsfVersion.JSF_5_0;
import org.netbeans.modules.web.wizards.Utilities;
import org.netbeans.spi.java.classpath.ClassPathProvider;
import org.netbeans.spi.project.ui.templates.support.Templates;
@@ -141,7 +142,10 @@ public static FileObject createFacesConfig(Project project, FileObject targetDir
for (InitParam param : parameters) {
if (param.getParamName().equals(FACES_CONFIG_PARAM) || param.getParamName().equals(JAKARTAEE_FACES_CONFIG_PARAM)) {
found = true;
- String value = param.getParamValue() + ",\n /" + FileUtil.getRelativePath(wm.getDocumentBase(), targetDir) + "/" + targetName + ".xml"; //NOI18N
+ String value = param.getParamValue()
+ + ",\n /"
+ + FileUtil.getRelativePath(wm.getDocumentBase(), targetDir)
+ + "/" + targetName + ".xml"; //NOI18N
ddRoot.removeContextParam(param);
InitParam newParameter = (InitParam) ddRoot.createBean(INIT_PARAM);
newParameter.setParamName(param.getParamName());
@@ -153,8 +157,10 @@ public static FileObject createFacesConfig(Project project, FileObject targetDir
}
if (!found) {
InitParam contextParam = (InitParam) ddRoot.createBean(INIT_PARAM);
- if(WebApp.VERSION_6_1.equals(ddRoot.getVersion()) || WebApp.VERSION_6_0.equals(ddRoot.getVersion()) ||
- WebApp.VERSION_5_0.equals(ddRoot.getVersion())) {
+ if(WebApp.VERSION_6_2.equals(ddRoot.getVersion())
+ || WebApp.VERSION_6_1.equals(ddRoot.getVersion())
+ || WebApp.VERSION_6_0.equals(ddRoot.getVersion())
+ || WebApp.VERSION_5_0.equals(ddRoot.getVersion())) {
contextParam.setParamName(JAKARTAEE_FACES_CONFIG_PARAM);
} else {
contextParam.setParamName(FACES_CONFIG_PARAM);
@@ -191,7 +197,9 @@ private static String findFacesConfigTemplate(WebModule wm) {
// not found on project classpath (case of Maven project with JSF in deps)
if (jsfVersion == null) {
Profile profile = wm.getJ2eeProfile();
- if (profile.isAtLeast(Profile.JAKARTA_EE_11_WEB)) {
+ if (profile.isAtLeast(Profile.JAKARTA_EE_12_WEB)) {
+ return JSFCatalog.RES_FACES_CONFIG_5_0;
+ } else if (profile.isAtLeast(Profile.JAKARTA_EE_11_WEB)) {
return JSFCatalog.RES_FACES_CONFIG_4_1;
} else if (profile.isAtLeast(Profile.JAKARTA_EE_10_WEB)) {
return JSFCatalog.RES_FACES_CONFIG_4_0;
@@ -227,6 +235,8 @@ private static String findFacesConfigTemplate(WebModule wm) {
private static String facesConfigForVersion(JsfVersion jsfVersion) {
switch (jsfVersion) {
+ case JSF_5_0:
+ return JSFCatalog.RES_FACES_CONFIG_5_0;
case JSF_4_1:
return JSFCatalog.RES_FACES_CONFIG_4_1;
case JSF_4_0:
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanel.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanel.java
index d4b566b8aaf1..f5e408d9cb52 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanel.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanel.java
@@ -21,16 +21,11 @@
import java.io.File;
import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import java.util.prefs.Preferences;
-import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.netbeans.api.project.FileOwnerQuery;
import org.netbeans.api.project.Project;
-import org.netbeans.api.project.ProjectUtils;
import org.netbeans.api.project.libraries.Library;
import org.netbeans.modules.j2ee.deployment.plugins.api.ServerLibrary;
import org.netbeans.modules.web.api.webmodule.ExtenderController;
@@ -205,10 +200,10 @@ protected boolean isMaven() {
return isMaven != null && isMaven;
}
- @Deprecated
- /*
- * Use getFacesMapping() instead
+ /**
+ * @deprecated Use {@link getFacesMapping()} instead
*/
+ @Deprecated
public String getURLPattern(){
return component.getURLPattern();
}
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanelVisual.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanelVisual.java
index e8b93a689852..fdd98d9c51d5 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanelVisual.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanelVisual.java
@@ -154,8 +154,8 @@ public class JSFConfigurationPanelVisual extends javax.swing.JPanel implements H
private static final List JSF_LIBRARIES_CACHE = new CopyOnWriteArrayList<>();
/** Maps used for faster seek of JSF/Jakarta Faces registered libraries. */
- private static final Map JSF_SEEKING_MAP = new LinkedHashMap<>(2);
- private static final Map JSF_SEEKING_MAP_JAKARTA = new LinkedHashMap<>(2);
+ private static final Map JSF_SEEKING_MAP = new LinkedHashMap<>(4);
+ private static final Map JSF_SEEKING_MAP_JAKARTA = new LinkedHashMap<>(4);
static {
JSF_SEEKING_MAP.put(false, JSFUtils.EJB_STATELESS);
@@ -1811,17 +1811,20 @@ public void run() {
public void run() {
setServerLibraryModel(serverJsfLibraries);
if (serverJsfLibraries.isEmpty()) {
- Library preferredLibrary;
- if (getProfile() != null && getProfile().isAtLeast(Profile.JAKARTA_EE_11_WEB)) {
- preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_4_1_NAME);
- } else if (getProfile() != null && getProfile().isAtLeast(Profile.JAKARTA_EE_10_WEB)) {
- preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_4_0_NAME);
- } else if (getProfile() != null && getProfile().isAtLeast(Profile.JAKARTA_EE_9_WEB)) {
- preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_3_0_NAME);
- } else if (getProfile() != null && getProfile().isAtLeast(Profile.JAVA_EE_5)) {
- preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_2_0_NAME);
- } else {
- preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_1_2_NAME);
+ Library preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_1_2_NAME);
+ Profile profile = getProfile();
+ if (null != profile) {
+ if (profile.isAtLeast(Profile.JAKARTA_EE_12_WEB)) {
+ preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_5_0_NAME);
+ } else if (profile.isAtLeast(Profile.JAKARTA_EE_11_WEB)) {
+ preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_4_1_NAME);
+ } else if (profile.isAtLeast(Profile.JAKARTA_EE_10_WEB)) {
+ preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_4_0_NAME);
+ } else if (profile.isAtLeast(Profile.JAKARTA_EE_9_WEB)) {
+ preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_3_0_NAME);
+ } else if (profile.isAtLeast(Profile.JAVA_EE_5)) {
+ preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_2_0_NAME);
+ }
}
if (preferredLibrary != null) {
diff --git a/enterprise/web.jsfapi/nbproject/project.properties b/enterprise/web.jsfapi/nbproject/project.properties
index 0f4ec98bc91a..73811063fd2b 100644
--- a/enterprise/web.jsfapi/nbproject/project.properties
+++ b/enterprise/web.jsfapi/nbproject/project.properties
@@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-javac.source=1.8
+javac.release=17
javac.compilerargs=-Xlint -Xlint:-serial
diff --git a/enterprise/web.jsfapi/src/org/netbeans/modules/web/jsfapi/api/JsfVersion.java b/enterprise/web.jsfapi/src/org/netbeans/modules/web/jsfapi/api/JsfVersion.java
index 3d7df12c03f9..82c6225ada9f 100644
--- a/enterprise/web.jsfapi/src/org/netbeans/modules/web/jsfapi/api/JsfVersion.java
+++ b/enterprise/web.jsfapi/src/org/netbeans/modules/web/jsfapi/api/JsfVersion.java
@@ -35,7 +35,8 @@ public enum JsfVersion {
JSF_2_3("2.3"),
JSF_3_0("3.0"),
JSF_4_0("4.0"),
- JSF_4_1("4.1");
+ JSF_4_1("4.1"),
+ JSF_5_0("5.0");
private final String version;
@@ -49,6 +50,14 @@ public String getShortName() {
}
return "JSF " + version;
}
+
+ /**
+ *
+ * @return String representation
+ */
+ public String getVersion() {
+ return this.version;
+ }
/**
* Find out if the version of the JsfVersion is equal or higher to given
diff --git a/enterprise/web.jsfapi/test/unit/src/org/netbeans/modules/web/jsfapi/api/JsfVersionTest.java b/enterprise/web.jsfapi/test/unit/src/org/netbeans/modules/web/jsfapi/api/JsfVersionTest.java
index 51996c1b30a6..0eb452925e24 100644
--- a/enterprise/web.jsfapi/test/unit/src/org/netbeans/modules/web/jsfapi/api/JsfVersionTest.java
+++ b/enterprise/web.jsfapi/test/unit/src/org/netbeans/modules/web/jsfapi/api/JsfVersionTest.java
@@ -43,6 +43,7 @@ public void testVersionComparison_JSF_1_0() {
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1));
+ assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0));
}
@Test
@@ -59,6 +60,7 @@ public void testVersionComparison_JSF_1_1() {
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1));
+ assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0));
}
@Test
@@ -75,6 +77,7 @@ public void testVersionComparison_JSF_1_2() {
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1));
+ assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0));
}
@Test
@@ -91,6 +94,7 @@ public void testVersionComparison_JSF_2_0() {
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1));
+ assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0));
}
@Test
@@ -107,6 +111,7 @@ public void testVersionComparison_JSF_2_1() {
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1));
+ assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0));
}
@Test
@@ -123,6 +128,7 @@ public void testVersionComparison_JSF_2_2() {
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1));
+ assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0));
}
@Test
@@ -139,6 +145,7 @@ public void testVersionComparison_JSF_2_3() {
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1));
+ assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0));
}
@Test
@@ -155,6 +162,7 @@ public void testVersionComparison_JSF_3_0() {
assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_3_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1));
+ assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0));
}
@Test
@@ -171,6 +179,7 @@ public void testVersionComparison_JSF_4_0() {
assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_3_0));
assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_4_0));
assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1));
+ assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0));
}
@Test
@@ -187,6 +196,24 @@ public void testVersionComparison_JSF_4_1() {
assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_3_0));
assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_4_0));
assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_4_1));
+ assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0));
+ }
+
+ @Test
+ public void testVersionComparison_JSF_5_0() {
+ JsfVersion jsfVersion = JsfVersion.JSF_5_0;
+
+ assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_1_0));
+ assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_1_1));
+ assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_1_2));
+ assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_2_0));
+ assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_2_1));
+ assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_2_2));
+ assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_2_3));
+ assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_3_0));
+ assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_4_0));
+ assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_4_1));
+ assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_5_0));
}
@Test
@@ -201,10 +228,11 @@ public void testShortName() {
assertEquals("JSF 3.0", JsfVersion.JSF_3_0.getShortName());
assertEquals("Faces 4.0", JsfVersion.JSF_4_0.getShortName());
assertEquals("Faces 4.1", JsfVersion.JSF_4_1.getShortName());
+ assertEquals("Faces 5.0", JsfVersion.JSF_5_0.getShortName());
}
@Test
public void testLatest() {
- assertEquals(JsfVersion.JSF_4_1, JsfVersion.latest());
+ assertEquals(JsfVersion.JSF_5_0, JsfVersion.latest());
}
}
diff --git a/enterprise/web.jspparser/nbproject/project.properties b/enterprise/web.jspparser/nbproject/project.properties
index 1daa2d5ede6f..de942b6fd1de 100644
--- a/enterprise/web.jspparser/nbproject/project.properties
+++ b/enterprise/web.jspparser/nbproject/project.properties
@@ -42,7 +42,7 @@ test-unit-sys-prop.jsp.parser.jars-jakarta=\
${o.apache.tools.ant.module.dir}/ant/lib/ant.jar:\
${web.jspparser.dir}/modules/ext/glassfish-jspparser-7.0.25.jar:\
${servletjspapi.dir}/modules/ext/jsp-parser-ext-jakarta.jar:\
- ${servletjspapi.dir}/modules/ext/servlet-jsp-api-6.1_3.0.jar:\
+ ${servletjspapi.dir}/modules/ext/servlet-jsp-api-6.2_4.1.jar:\
${o.apache.tools.ant.module.dir}/ant/lib/ant-launcher.jar
test-unit-sys-prop.jstl.jars=\
diff --git a/enterprise/web.jspparser/src/org/netbeans/modules/web/jspparser/JspParserImpl.java b/enterprise/web.jspparser/src/org/netbeans/modules/web/jspparser/JspParserImpl.java
index 0a518aa5c1ac..bca8525cd753 100644
--- a/enterprise/web.jspparser/src/org/netbeans/modules/web/jspparser/JspParserImpl.java
+++ b/enterprise/web.jspparser/src/org/netbeans/modules/web/jspparser/JspParserImpl.java
@@ -91,7 +91,7 @@ public JspParserImpl() {
"modules/ext/jsp-parser-ext-jakarta.jar", //NOI18N
"modules/ext/jstl-jakarta-api.jar", //NOI18N
"modules/ext/jstl-jakarta-impl.jar", //NOI18N
- "modules/ext/servlet-jsp-api-6.1_3.0.jar", //NOI18N
+ "modules/ext/servlet-jsp-api-6.2_4.1.jar", //NOI18N
"ant/lib/ant-launcher.jar" //Glassfish V2 //NOI18N
};
diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/ProjectWebModule.java b/enterprise/web.project/src/org/netbeans/modules/web/project/ProjectWebModule.java
index 4a2530c13bcd..93aa50841ac4 100644
--- a/enterprise/web.project/src/org/netbeans/modules/web/project/ProjectWebModule.java
+++ b/enterprise/web.project/src/org/netbeans/modules/web/project/ProjectWebModule.java
@@ -400,9 +400,9 @@ public String getServerID () {
String inst = getServerInstanceID ();
if (inst != null) {
String id = Deployment.getDefault().getServerID(inst);
- if (id != null) {
- return id;
- }
+ if (id != null) {
+ return id;
+ }
}
return helper.getAntProjectHelper().getStandardPropertyEvaluator ().getProperty (WebProjectProperties.J2EE_SERVER_TYPE);
}
@@ -561,6 +561,9 @@ public String getModuleVersion () {
if (null == platformVersion) {
return WebApp.VERSION_3_1;
} else switch (platformVersion) {
+ case JAKARTA_EE_12_FULL:
+ case JAKARTA_EE_12_WEB:
+ return WebApp.VERSION_6_2;
case JAKARTA_EE_11_FULL:
case JAKARTA_EE_11_WEB:
return WebApp.VERSION_6_1;
diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java b/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java
index c17368708536..b180e89ab12e 100644
--- a/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java
+++ b/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java
@@ -20,6 +20,7 @@
package org.netbeans.modules.web.project;
import org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment;
+import org.netbeans.modules.j2ee.deployment.devmodules.api.InstanceRemovedException;
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform;
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
import org.netbeans.modules.j2ee.persistence.dd.common.Persistence;
@@ -56,21 +57,27 @@ public String getVersion() {
@Override
public Boolean isJPAVersionSupported(String version) {
J2eeModuleProvider j2eeModuleProvider = project.getLookup().lookup(J2eeModuleProvider.class);
- J2eePlatform platform = Deployment.getDefault().getJ2eePlatform(j2eeModuleProvider.getServerInstanceID());
-
- if (platform == null) {
- return null;
- }
- JpaSupport support = JpaSupport.getInstance(platform);
- JpaProvider provider = support.getDefaultProvider();
- if (provider != null) {
- return (Persistence.VERSION_3_2.equals(version) && provider.isJpa32Supported())
- || (Persistence.VERSION_3_1.equals(version) && provider.isJpa31Supported())
- || (Persistence.VERSION_3_0.equals(version) && provider.isJpa30Supported())
- || (Persistence.VERSION_2_2.equals(version) && provider.isJpa22Supported())
- || (Persistence.VERSION_2_1.equals(version) && provider.isJpa21Supported())
- || (Persistence.VERSION_2_0.equals(version) && provider.isJpa2Supported())
- || (Persistence.VERSION_1_0.equals(version) && provider.isJpa1Supported());
+ String serverInstanceID = j2eeModuleProvider.getServerInstanceID();
+ try {
+ J2eePlatform platform = Deployment.getDefault().getServerInstance(serverInstanceID).getJ2eePlatform();
+
+ if (platform == null) {
+ return null;
+ }
+ JpaSupport support = JpaSupport.getInstance(platform);
+ JpaProvider provider = support.getDefaultProvider();
+ if (provider != null) {
+ return (Persistence.VERSION_4_0.equals(version) && provider.isJpa40Supported())
+ || (Persistence.VERSION_3_2.equals(version) && provider.isJpa32Supported())
+ || (Persistence.VERSION_3_1.equals(version) && provider.isJpa31Supported())
+ || (Persistence.VERSION_3_0.equals(version) && provider.isJpa30Supported())
+ || (Persistence.VERSION_2_2.equals(version) && provider.isJpa22Supported())
+ || (Persistence.VERSION_2_1.equals(version) && provider.isJpa21Supported())
+ || (Persistence.VERSION_2_0.equals(version) && provider.isJpa2Supported())
+ || (Persistence.VERSION_1_0.equals(version) && provider.isJpa1Supported());
+ }
+ } catch (InstanceRemovedException ex) {
+ //noop
}
return null;
}
diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/WebProject.java b/enterprise/web.project/src/org/netbeans/modules/web/project/WebProject.java
index c7e301d22206..16368bfd2123 100644
--- a/enterprise/web.project/src/org/netbeans/modules/web/project/WebProject.java
+++ b/enterprise/web.project/src/org/netbeans/modules/web/project/WebProject.java
@@ -540,7 +540,7 @@ private PropertyEvaluator createEvaluator() {
private static final PropertyProvider UPDATE_PROPERTIES;
static {
- Map defs = new HashMap();
+ Map defs = new HashMap<>(16);
defs.put(ProjectProperties.ANNOTATION_PROCESSING_ENABLED, "true"); //NOI18N
defs.put(ProjectProperties.ANNOTATION_PROCESSING_ENABLED_IN_EDITOR, "true"); //NOI18N
@@ -1520,6 +1520,7 @@ private final class RecommendedTemplatesImpl implements RecommendedTemplates,
private boolean isEE5 = false;
private boolean serverSupportsEJB31 = false;
private boolean serverSupportsEJB40 = false;
+ private boolean serverSupportsEJB41 = false;
@Override
public String[] getRecommendedTypes() {
@@ -1529,7 +1530,7 @@ public String[] getRecommendedTypes() {
} else if (projectCap.isEjb31LiteSupported() || projectCap.isEjb40LiteSupported()) {
Set set = new HashSet<>(Arrays.asList(TYPES));
if (projectCap.isEjb31Supported() || projectCap.isEjb40Supported()
- || serverSupportsEJB31 || serverSupportsEJB40) {
+ || serverSupportsEJB31 || serverSupportsEJB40 || serverSupportsEJB41) {
set.addAll(Arrays.asList(TYPES_EJB31));
}
@@ -1554,7 +1555,7 @@ public String[] getPrivilegedTemplates() {
if (projectCap.isEjb31LiteSupported()) {
set.addAll(getPrivilegedTemplatesEE5());
if (projectCap.isEjb31Supported() || projectCap.isEjb40Supported()
- || serverSupportsEJB31 || serverSupportsEJB40) {
+ || serverSupportsEJB31 || serverSupportsEJB40 || serverSupportsEJB41) {
set.addAll(Arrays.asList(PRIVILEGED_NAMES_EE6_FULL));
}
@@ -1585,7 +1586,10 @@ private void checkEnvironment() {
for (Profile _profile : ProjectUtil.getSupportedProfiles(project)) {
if (_profile.isFullProfile()) {
- if (_profile.isAtLeast(Profile.JAKARTA_EE_9_FULL)) {
+ if (_profile.isAtLeast(Profile.JAKARTA_EE_12_FULL)) {
+ serverSupportsEJB41 = true;
+ break;
+ } else if (_profile.isAtLeast(Profile.JAKARTA_EE_9_FULL)) {
serverSupportsEJB40 = true;
break;
} else if (_profile.isAtLeast(Profile.JAVA_EE_6_FULL)) {
@@ -1995,24 +1999,11 @@ private void handleCopyFileToDestDir(String prefix, FileObject baseDir, FileObje
}
FileObject destFile = ensureDestinationFileExists(webBuildBase, path, fo.isFolder());
if (!fo.isFolder()) {
- InputStream is = null;
- OutputStream os = null;
- FileLock fl = null;
- try {
- is = fo.getInputStream();
- fl = destFile.lock();
- os = destFile.getOutputStream(fl);
+ try (InputStream is = fo.getInputStream();
+ FileLock fl = destFile.lock();
+ OutputStream os = destFile.getOutputStream(fl)) {
FileUtil.copy(is, os);
} finally {
- if (is != null) {
- is.close();
- }
- if (os != null) {
- os.close();
- }
- if (fl != null) {
- fl.releaseLock();
- }
File file = FileUtil.toFile(destFile);
if (file != null) {
fireArtifactChange(Collections.singleton(ArtifactListener.Artifact.forFile(file)));
@@ -2150,9 +2141,7 @@ protected Artifact filterArtifact(Artifact artifact, RelocationType type) {
private boolean containsTLD(File f) {
if (f.exists() && f.isFile() && f.canRead()) {
- ZipFile zip = null;
- try {
- zip = new ZipFile(f);
+ try (ZipFile zip = new ZipFile(f)) {
for (Enumeration entries = zip.entries(); entries.hasMoreElements();) {
String zipEntryName = ((ZipEntry) entries.nextElement()).getName();
if (TLD_PATTERN.matcher(zipEntryName).matches()) {
@@ -2162,14 +2151,6 @@ private boolean containsTLD(File f) {
return false;
} catch (IOException ex) {
LOGGER.log(Level.INFO, null, ex);
- } finally {
- if (zip != null) {
- try {
- zip.close();
- } catch (IOException ex) {
- LOGGER.log(Level.INFO, null, ex);
- }
- }
}
}
@@ -2437,15 +2418,9 @@ public WebProjectLookup(WebProject project, Lookup base, Lookup ee6, ProjectBrow
private void updateLookup(){
List lookups = new ArrayList<>();
lookups.add(base);
+ // profile will be null at the beginning
Profile profile = Profile.fromPropertiesString(project.evaluator().getProperty(WebProjectProperties.J2EE_PLATFORM));
- if (Profile.JAVA_EE_6_FULL.equals(profile) || Profile.JAVA_EE_6_WEB.equals(profile)
- || Profile.JAVA_EE_7_FULL.equals(profile) || Profile.JAVA_EE_7_WEB.equals(profile)
- || Profile.JAVA_EE_8_FULL.equals(profile) || Profile.JAVA_EE_8_WEB.equals(profile)
- || Profile.JAKARTA_EE_8_FULL.equals(profile) || Profile.JAKARTA_EE_8_WEB.equals(profile)
- || Profile.JAKARTA_EE_9_FULL.equals(profile) || Profile.JAKARTA_EE_9_WEB.equals(profile)
- || Profile.JAKARTA_EE_9_1_FULL.equals(profile) || Profile.JAKARTA_EE_9_1_WEB.equals(profile)
- || Profile.JAKARTA_EE_10_FULL.equals(profile) || Profile.JAKARTA_EE_10_WEB.equals(profile)
- || Profile.JAKARTA_EE_11_FULL.equals(profile) || Profile.JAKARTA_EE_11_WEB.equals(profile)) {
+ if (null != profile && profile.isAtLeast(Profile.JAVA_EE_6_WEB)) {
lookups.add(ee6);
}
if ("true".equals(project.evaluator().getProperty(WebProjectProperties.DISPLAY_BROWSER))) {
diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java b/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java
index 10cb463febf6..9d02472e6c08 100644
--- a/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java
+++ b/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java
@@ -213,13 +213,11 @@ private static AntProjectHelper createProjectImpl(final WebProjectCreateData cre
if(confFolderFO != null) {
String manifestText = readResource(WebProjectUtilities.class.getResourceAsStream(RESOURCE_FOLDER + "MANIFEST.MF")); //NOI18N
FileObject manifest = FileUtil.createData(confFolderFO, "MANIFEST.MF"); //NOI18N
- FileLock lock = manifest.lock();
- BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(manifest.getOutputStream(lock), FileEncodingQuery.getEncoding(manifest)));
- try {
+ Charset charset = FileEncodingQuery.getEncoding(manifest);
+ try (FileLock lock = manifest.lock();
+ OutputStreamWriter osw = new OutputStreamWriter(manifest.getOutputStream(lock), charset);
+ BufferedWriter bw = new BufferedWriter(osw)) {
bw.write(manifestText);
- } finally {
- bw.close();
- lock.releaseLock();
}
}
@@ -894,18 +892,15 @@ private static String readResource(InputStream is) throws IOException {
// read the config from resource first
StringBuilder sb = new StringBuilder();
String lineSep = System.getProperty("line.separator"); // NOI18N
- BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
- try {
+ try (BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {
String line = br.readLine();
while (line != null) {
sb.append(line);
sb.append(lineSep);
line = br.readLine();
}
- } finally {
- br.close();
}
-
+
return sb.toString();
}
diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java
index 49636e6ceae7..1cc5ae090858 100644
--- a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java
+++ b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java
@@ -22,7 +22,6 @@
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.netbeans.api.j2ee.core.Profile;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.java.project.classpath.ProjectClassPathModifier;
import org.netbeans.api.project.SourceGroup;
@@ -135,6 +134,9 @@ protected String getProjectJavaEEVersion() {
case JAKARTA_EE_11_WEB:
case JAKARTA_EE_11_FULL:
return JAKARTA_EE_VERSION_11;
+ case JAKARTA_EE_12_WEB:
+ case JAKARTA_EE_12_FULL:
+ return JAKARTA_EE_VERSION_12;
case JAVA_EE_5:
return JAVA_EE_VERSION_15;
default:
diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java
index 42ab71f7bc2f..1862de2092fa 100644
--- a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java
+++ b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java
@@ -24,7 +24,6 @@
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.netbeans.api.j2ee.core.Profile;
import org.netbeans.api.java.classpath.ClassPath;
import org.netbeans.api.java.project.classpath.ProjectClassPathModifier;
import org.netbeans.api.project.Project;
@@ -371,24 +370,13 @@ protected void addJaxwsArtifacts(Project project, String wsName, String serviceI
endpoint.setImplementation(serviceImpl);
endpoint.setUrlPattern("/" + wsName);
endpoints.addEnpoint(endpoint);
- FileLock lock = null;
- OutputStream os = null;
synchronized (this) {
- try{
- lock = sunjaxwsFile.lock();
- os = sunjaxwsFile.getOutputStream(lock);
+ try (FileLock lock = sunjaxwsFile.lock();
+ OutputStream os = sunjaxwsFile.getOutputStream(lock)) {
endpoints.write(os);
- }finally{
- if(lock != null) {
- lock.releaseLock();
- }
-
- if(os != null) {
- os.close();
- }
}
}
- }else{
+ } else {
String mes = NbBundle.getMessage(WebProjectJAXWSSupport.class, "MSG_CannotFindWEB-INF"); // NOI18N
NotifyDescriptor desc = new NotifyDescriptor.Message(mes, NotifyDescriptor.Message.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(desc);
@@ -441,45 +429,30 @@ public void removeNonJsr109Entries(String serviceName) throws IOException {
if(ddFolder != null){
FileObject sunjaxwsFile = ddFolder.getFileObject("sun-jaxws.xml");
if(sunjaxwsFile != null){
- FileLock lock = null;
//if there are no more services, delete the file
JaxWsModel jaxWsModel = project.getLookup().lookup(JaxWsModel.class);
if(jaxWsModel.getServices().length == 0) {
synchronized(this) {
- try{
- lock = sunjaxwsFile.lock();
+ try (FileLock lock = sunjaxwsFile.lock()) {
sunjaxwsFile.delete(lock);
- } finally{
- if(lock != null){
- lock.releaseLock();
- }
}
}
- } else{
+ } else {
//remove the entry from the sunjaxwsFile
Endpoints endpoints = EndpointsProvider.getDefault().getEndpoints(sunjaxwsFile);
Endpoint endpoint = endpoints.findEndpointByName(serviceName);
if(endpoint != null){
endpoints.removeEndpoint(endpoint);
- OutputStream os = null;
synchronized(this) {
- try{
- lock = sunjaxwsFile.lock();
- os = sunjaxwsFile.getOutputStream(lock);
+ try (FileLock lock = sunjaxwsFile.lock();
+ OutputStream os = sunjaxwsFile.getOutputStream(lock)) {
endpoints.write(os);
- }finally{
- if(lock != null){
- lock.releaseLock();
- }
- if(os != null){
- os.close();
- }
}
}
}
}
}
- }else{
+ } else {
String mes = NbBundle.getMessage(WebProjectJAXWSSupport.class, "MSG_CannotFindDDDirectory"); // NOI18N
NotifyDescriptor desc = new NotifyDescriptor.Message(mes, NotifyDescriptor.Message.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(desc);
@@ -620,6 +593,9 @@ protected String getProjectJavaEEVersion() {
case JAKARTA_EE_11_WEB:
case JAKARTA_EE_11_FULL:
return JAKARTA_EE_VERSION_11;
+ case JAKARTA_EE_12_WEB:
+ case JAKARTA_EE_12_FULL:
+ return JAKARTA_EE_VERSION_12;
case JAVA_EE_5:
return JAVA_EE_VERSION_15;
default:
diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java b/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java
index 5dc8775dc836..59c6d14487cb 100644
--- a/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java
+++ b/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java
@@ -377,6 +377,9 @@ private void init() {
Profile profile = Profile.fromPropertiesString(evaluator.getProperty(J2EE_PLATFORM));
if (profile != null) {
switch (profile) {
+ case JAKARTA_EE_12_FULL:
+ minimalSourceLevel = new SpecificationVersion("21");
+ break;
case JAKARTA_EE_11_FULL:
minimalSourceLevel = new SpecificationVersion("17");
break;
diff --git a/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java b/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java
index f4a970b2f82e..424319ab8f6e 100644
--- a/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java
+++ b/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java
@@ -119,6 +119,8 @@ public void testJavaEEProjectSettingsInWebProject() throws Exception {
assertEquals(Profile.JAKARTA_EE_10_WEB, obtainedProfileJakartaEE10);
Profile obtainedProfileJakartaEE11 = JavaEEProjectSettings.getProfile(webProject);
assertEquals(Profile.JAKARTA_EE_11_WEB, obtainedProfileJakartaEE11);
+ Profile obtainedProfileJakartaEE12 = JavaEEProjectSettings.getProfile(webProject);
+ assertEquals(Profile.JAKARTA_EE_12_WEB, obtainedProfileJakartaEE12);
}
/**
diff --git a/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java b/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java
index d0ae40d67979..8bd9134ee895 100644
--- a/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java
+++ b/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java
@@ -150,7 +150,7 @@ private boolean hasAnnotation(Element element, String... annotationFqns) {
}
private Map suggestWebSocketMethod() {
- Map result = new HashMap();
+ Map result = new HashMap<>(8);
result.put("javax.websocket.OnMessage", "onMessage"); // NOI18N
result.put("javax.websocket.OnOpen", "onOpen"); // NOI18N
result.put("javax.websocket.OnClose", "onClose"); // NOI18N
@@ -217,7 +217,7 @@ private List getElementPosition(CompilationInfo info, Tree tree) {
}
}
- List result = new ArrayList(2);
+ List result = new ArrayList<>(4);
result.add(startOffset);
result.add(endOffset);
return result;
@@ -274,7 +274,9 @@ void run() {
}
private boolean isEndpoint(TypeElement clazz) {
- return hasAnnotation(clazz, "javax.websocket.server.ServerEndpoint"); // NOI18N
+ final String javaxAnnotation = "javax.websocket.server.ServerEndpoint"; // NOI18N
+ final String jakartaAnnotation = "jakarta.websocket.server.ServerEndpoint"; // NOI18N
+ return hasAnnotation(clazz, javaxAnnotation, jakartaAnnotation);
}
Collection getDescriptions() {
diff --git a/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/spi/jaxws/client/ProjectJAXWSClientSupport.java b/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/spi/jaxws/client/ProjectJAXWSClientSupport.java
index 61fc07f5754d..9833990c8729 100644
--- a/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/spi/jaxws/client/ProjectJAXWSClientSupport.java
+++ b/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/spi/jaxws/client/ProjectJAXWSClientSupport.java
@@ -54,7 +54,6 @@
import org.openide.execution.ExecutorTask;
import org.openide.filesystems.FileLock;
import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileStateInvalidException;
import org.openide.filesystems.FileUtil;
import org.openide.nodes.Node;
import org.openide.util.Mutex;
@@ -87,6 +86,7 @@ public abstract class ProjectJAXWSClientSupport implements JAXWSClientSupportImp
protected static final String JAKARTA_EE_VERSION_91="jakarta-ee-version-91"; //NOI18N
protected static final String JAKARTA_EE_VERSION_10="jakarta-ee-version-10"; //NOI18N
protected static final String JAKARTA_EE_VERSION_11="jakarta-ee-version-11"; //NOI18N
+ protected static final String JAKARTA_EE_VERSION_12="jakarta-ee-version-12"; //NOI18N
Project project;
private AntProjectHelper helper;
diff --git a/enterprise/websvc.jaxwsapi/src/org/netbeans/modules/websvc/jaxws/spi/ProjectJAXWSSupport.java b/enterprise/websvc.jaxwsapi/src/org/netbeans/modules/websvc/jaxws/spi/ProjectJAXWSSupport.java
index cc8bbe18aa9c..8aba1c413e72 100644
--- a/enterprise/websvc.jaxwsapi/src/org/netbeans/modules/websvc/jaxws/spi/ProjectJAXWSSupport.java
+++ b/enterprise/websvc.jaxwsapi/src/org/netbeans/modules/websvc/jaxws/spi/ProjectJAXWSSupport.java
@@ -53,7 +53,6 @@
import org.openide.execution.ExecutorTask;
import org.openide.filesystems.FileLock;
import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileStateInvalidException;
import org.openide.filesystems.FileSystem.AtomicAction;
import org.openide.filesystems.FileUtil;
import org.openide.util.NbBundle;
@@ -83,6 +82,7 @@ public abstract class ProjectJAXWSSupport implements JAXWSSupportImpl {
protected static final String JAKARTA_EE_VERSION_91="jakarta-ee-version-91"; //NOI18N
protected static final String JAKARTA_EE_VERSION_10="jakarta-ee-version-10"; //NOI18N
protected static final String JAKARTA_EE_VERSION_11="jakarta-ee-version-11"; //NOI18N
+ protected static final String JAKARTA_EE_VERSION_12="jakarta-ee-version-12"; //NOI18N
private Project project;
private AntProjectHelper antProjectHelper;
@@ -332,22 +332,11 @@ private void writeJaxWsModel(final JaxWsModel jaxWsModel) {
if (jaxWsFo != null) {
jaxWsFo.getFileSystem().runAtomicAction(new AtomicAction() {
public void run() {
- FileLock lock=null;
- OutputStream os=null;
- try {
- lock = jaxWsFo.lock();
- os = jaxWsFo.getOutputStream(lock);
+ try (FileLock lock = jaxWsFo.lock();
+ OutputStream os = jaxWsFo.getOutputStream(lock)) {
jaxWsModel.write(os);
- os.close();
} catch (java.io.IOException ex) {
ErrorManager.getDefault().notify(ex);
- } finally {
- if (os!=null) {
- try {
- os.close();
- } catch (IOException ex) {}
- }
- if (lock!=null) lock.releaseLock();
}
}
});
diff --git a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java
index a1950e4cde4e..19a5c1577c21 100644
--- a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java
+++ b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java
@@ -124,13 +124,16 @@ protected boolean isAsync(Element method){
TypeMirror type = param.asType();
if ( type instanceof DeclaredType ){
Element paramElement = ((DeclaredType)type).asElement();
- if ( paramElement instanceof TypeElement ){
- hasAsyncType = ((TypeElement)paramElement).getQualifiedName().
- contentEquals("javax.ws.rs.container.AsyncResponse"); // NOI18N
+ if ( paramElement instanceof TypeElement ) {
+ javax.lang.model.element.Name name = ((TypeElement)paramElement).getQualifiedName();
+ hasAsyncType = name.contentEquals("javax.ws.rs.container.AsyncResponse") //NOI18N
+ || name.contentEquals("jakarta.ws.rs.container.AsyncResponse"); //NOI18N
}
}
+
if( hasAsyncType && hasAnnotation(param,
- "javax.ws.rs.container.Suspended")){ // NOI18N
+ "javax.ws.rs.container.Suspended", // NOI18N
+ "jakarta.ws.rs.container.Suspended") ) { // NOI18N
return true;
}
}
@@ -331,8 +334,11 @@ private String convertMethodName(String name){
}
private boolean isEjb(Element element){
- return hasAnnotation(element, "javax.ejb.Stateless",
- "javax.ejb.Singleton");// NOI18N
+ return hasAnnotation(element,
+ "javax.ejb.Stateless",
+ "javax.ejb.Singleton",
+ "jakarta.ejb.Stateless",
+ "jakarta.ejb.Singleton"); // NOI18N
}
private ClassTree createAsyncMethod( TreeMaker maker,
diff --git a/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java b/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java
index 5da1857e28f1..ca3614c1eb91 100644
--- a/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java
+++ b/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java
@@ -87,6 +87,7 @@ public abstract class RestSupport {
public static final String TEST_RESBEANS_CSS2 = "css_master-all.css";//NOI18N
public static final String REST_SERVLET_ADAPTOR = "ServletAdaptor";//NOI18N
public static final String JAX_RS_APPLICATION_CLASS = "javax.ws.rs.core.Application"; //NOI18N
+ public static final String JAX_RS_APPLICATION_JAKARTA_CLASS = "jakarta.ws.rs.core.Application"; //NOI18N
public static final String REST_SERVLET_ADAPTOR_CLASS = "com.sun.jersey.spi.container.servlet.ServletContainer"; //NOI18N
public static final String REST_SERVLET_ADAPTOR_CLASS_OLD = "com.sun.ws.rest.impl.container.servlet.ServletAdaptor"; //NOI18N
public static final String REST_SERVLET_ADAPTOR_CLASS_2_0 = "org.glassfish.jersey.servlet.ServletContainer"; //NOI18N
@@ -393,7 +394,10 @@ public AntProjectHelper getAntProjectHelper() {
* Check to see if there is JTA support.
*/
public boolean hasJTASupport() {
- return MiscPrivateUtilities.hasResource(getProject(), "javax/transaction/UserTransaction.class"); // NOI18N
+ final String javaxClazz = "javax/transaction/UserTransaction.class"; // NOI18N
+ final String jakartaClazz = "jakarta/transaction/UserTransaction.class"; // NOI18N
+ return MiscPrivateUtilities.hasResource(getProject(), javaxClazz)
+ || MiscPrivateUtilities.hasResource(getProject(), jakartaClazz);
}
/**
@@ -498,6 +502,19 @@ public boolean isEESpecWithJaxRS(){
return (isJee6 && MiscPrivateUtilities.supportsTargetProfile(project, Profile.JAVA_EE_6_FULL))
|| (profile != null && profile.isAtLeast(Profile.JAVA_EE_7_WEB));
}
+
+ /**
+ * Is this a Jakarta EE 12 profile project?
+ */
+ public boolean isJakartaEE12() {
+ WebModule webModule = WebModule.getWebModule(project.getProjectDirectory());
+ if ( webModule == null ){
+ return false;
+ }
+ Profile profile = webModule.getJ2eeProfile();
+ return Profile.JAKARTA_EE_12_WEB.equals(profile) ||
+ Profile.JAKARTA_EE_12_FULL.equals(profile);
+ }
/**
* Is this a Jakarta EE 11 profile project?
@@ -653,7 +670,8 @@ public boolean hasJaxRsOnClasspath(boolean checkServerClasspath) {
if (checkServerClasspath) {
JaxRsStackSupport support = getJaxRsStackSupport();
if (support != null){
- return support.isBundled(JAX_RS_APPLICATION_CLASS);
+ return support.isBundled(JAX_RS_APPLICATION_CLASS)
+ || support.isBundled(JAX_RS_APPLICATION_JAKARTA_CLASS);
}
}
return false;
diff --git a/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/IndexerCache.java b/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/IndexerCache.java
index e8e61687e5c5..d842e15cc1ff 100644
--- a/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/IndexerCache.java
+++ b/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/IndexerCache.java
@@ -261,6 +261,7 @@ public boolean equals(Object obj) {
"text/x-persistence3.0", //NOI18N
"text/x-persistence3.1", //NOI18N
"text/x-persistence3.2", //NOI18N
+ "text/x-persistence4.0", //NOI18N
"text/x-orm1.0", //NOI18N
"text/x-orm2.0", //NOI18N
"text/x-orm2.1", //NOI18N
@@ -268,6 +269,7 @@ public boolean equals(Object obj) {
"text/x-orm3.0", //NOI18N
"text/x-orm3.1", //NOI18N
"text/x-orm3.2", //NOI18N
+ "text/x-orm4.0", //NOI18N
"application/xhtml+xml", //NOI18N
"text/x-maven-pom+xml", //NOI18N
"text/x-maven-profile+xml", //NOI18N
@@ -286,18 +288,21 @@ public boolean equals(Object obj) {
"text/x-dd-servlet5.0", //NOI18N
"text/x-dd-servlet6.0", //NOI18N
"text/x-dd-servlet6.1", //NOI18N
+ "text/x-dd-servlet6.2", //NOI18N
"text/x-dd-servlet-fragment3.0", //NOI18N
"text/x-dd-servlet-fragment3.1", //NOI18N
"text/x-dd-servlet-fragment4.0", //NOI18N
"text/x-dd-servlet-fragment5.0", //NOI18N
"text/x-dd-servlet-fragment6.0", //NOI18N
"text/x-dd-servlet-fragment6.1", //NOI18N
+ "text/x-dd-servlet-fragment6.2", //NOI18N
"text/x-dd-ejbjar2.0", //NOI18N
"text/x-dd-ejbjar2.1", //NOI18N
"text/x-dd-ejbjar3.0", //NOI18N
"text/x-dd-ejbjar3.1", //NOI18N
"text/x-dd-ejbjar3.2", //NOI18N
"text/x-dd-ejbjar4.0", //NOI18N
+ "text/x-dd-ejbjar4.1", //NOI18N
"text/x-dd-client1.3", //NOI18N
"text/x-dd-client1.4", //NOI18N
"text/x-dd-client5.0", //NOI18N
@@ -307,6 +312,7 @@ public boolean equals(Object obj) {
"text/x-dd-client9.0", //NOI18N
"text/x-dd-client10.0", //NOI18N
"text/x-dd-client11.0", //NOI18N
+ "text/x-dd-client12.0", //NOI18N
"text/x-dd-application1.4", //NOI18N
"text/x-dd-application5.0", //NOI18N
"text/x-dd-application6.0", //NOI18N
@@ -315,6 +321,7 @@ public boolean equals(Object obj) {
"text/x-dd-application9.0", //NOI18N
"text/x-dd-application10.0", //NOI18N
"text/x-dd-application11.0", //NOI18N
+ "text/x-dd-application12.0", //NOI18N
"text/x-dd-sun-web+xml", //NOI18N
"text/x-dd-sun-ejb-jar+xml", //NOI18N
"text/x-dd-sun-application+xml", //NOI18N
diff --git a/java/j2ee.persistence/licenseinfo.xml b/java/j2ee.persistence/licenseinfo.xml
index da8619e6fa97..e3ea2ac17420 100644
--- a/java/j2ee.persistence/licenseinfo.xml
+++ b/java/j2ee.persistence/licenseinfo.xml
@@ -66,8 +66,10 @@
src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_3_0.xsdsrc/org/netbeans/modules/j2ee/persistence/dd/resources/orm_3_1.xsdsrc/org/netbeans/modules/j2ee/persistence/dd/resources/orm_3_2.xsd
+ src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.xsdsrc/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_0.xsdsrc/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_2.xsd
+ src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.xsd
Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved.
@@ -81,6 +83,7 @@
src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-3.0.xmlsrc/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-3.1.xmlsrc/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-3.2.xml
+ src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-4.0.xmlsrc/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/resources/IllegalOrphanException.java.txtsrc/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/resources/NonexistentEntityException.java.txtsrc/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/resources/PreexistingEntityException.java.txt
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceMetadata.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceMetadata.java
index 7d9d743268b0..658db08a695e 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceMetadata.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceMetadata.java
@@ -41,7 +41,7 @@ public final class PersistenceMetadata {
private Map ddMap;
private PersistenceMetadata() {
- ddMap = new WeakHashMap<>(5);
+ ddMap = new WeakHashMap<>(8);
}
/**
@@ -79,21 +79,20 @@ public Persistence getRoot(FileObject fo) throws java.io.IOException {
}
try (InputStream is=fo.getInputStream()) {
- if (Persistence.VERSION_3_2.equals(version)) {
- persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence.createGraph(is);
- } else if(Persistence.VERSION_3_1.equals(version)) {
- persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence.createGraph(is);
- } else if(Persistence.VERSION_3_0.equals(version)) {
- persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence.createGraph(is);
- } else if(Persistence.VERSION_2_2.equals(version)) {
- persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence.createGraph(is);
- } else if(Persistence.VERSION_2_1.equals(version)) {
- persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence.createGraph(is);
- } else if(Persistence.VERSION_2_0.equals(version)) {
- persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence.createGraph(is);
- } else {//1.0 - default
+ // 1.0 - default
+ if (null == version) {
persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence.createGraph(is);
- }
+ } else persistence = switch (version) {
+ case Persistence.VERSION_4_0 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.Persistence.createGraph(is);
+ case Persistence.VERSION_3_2 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence.createGraph(is);
+ case Persistence.VERSION_3_1 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence.createGraph(is);
+ case Persistence.VERSION_3_0 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence.createGraph(is);
+ case Persistence.VERSION_2_2 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence.createGraph(is);
+ case Persistence.VERSION_2_1 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence.createGraph(is);
+ case Persistence.VERSION_2_0 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence.createGraph(is);
+ default -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence.createGraph(is);
+ };
+
}
ddMap.put(fo, persistence);
}
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceUtils.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceUtils.java
index 29283e85ec87..a607a15bbb3f 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceUtils.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceUtils.java
@@ -119,7 +119,7 @@ public static PersistenceUnit[] getPersistenceUnits(FileObject sourceFile) throw
}
}
- return result.toArray(new PersistenceUnit[0]);
+ return result.toArray(PersistenceUnit[]::new);
}
/**
@@ -202,7 +202,7 @@ public static PersistenceScope[] getPersistenceScopes(Project project, FileObjec
/**
* method check target compile classpath for presence of persitence classes of certain version
* returns max supported specification
- * @param project
+ * @param target
* @return
*/
public static String getJPAVersion(Project target)
@@ -213,7 +213,9 @@ public static String getJPAVersion(Project target)
SourceGroup firstGroup=groups[0];
FileObject fo=firstGroup.getRootFolder();
ClassPath compile=ClassPath.getClassPath(fo, ClassPath.COMPILE);
- if(compile.findResource("jakarta/persistence/criteria/CriteriaSelect.class")!=null) {
+ if(compile.findResource("jakarta/persistence/PostDelete.class")!=null) {
+ version=Persistence.VERSION_4_0;
+ } else if(compile.findResource("jakarta/persistence/criteria/CriteriaSelect.class")!=null) {
version=Persistence.VERSION_3_2;
} else if(compile.findResource("jakarta/persistence/spi/TransformerException.class")!=null) {
version=Persistence.VERSION_3_1;
@@ -233,9 +235,11 @@ public static String getJPAVersion(Project target)
public static String getJPAVersion(Library lib) {
List roots=lib.getContent("classpath");
- ClassPath cp = ClassPathSupport.createClassPath(roots.toArray(new URL[0]));
+ ClassPath cp = ClassPathSupport.createClassPath(roots.toArray(URL[]::new));
String version=null;
- if(cp.findResource("jakarta/persistence/criteria/CriteriaSelect.class")!=null) {
+ if(cp.findResource("jakarta/persistence/PostDelete.class")!=null) {
+ version=Persistence.VERSION_4_0;
+ } else if(cp.findResource("jakarta/persistence/criteria/CriteriaSelect.class")!=null) {
version=Persistence.VERSION_3_2;
} else if(cp.findResource("jakarta/persistence/spi/TransformerException.class")!=null) {
version=Persistence.VERSION_3_1;
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/JPAParseUtils.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/JPAParseUtils.java
index 3cd978ac0373..d6595f9f6578 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/JPAParseUtils.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/JPAParseUtils.java
@@ -95,18 +95,22 @@ public InputSource resolveEntity(String publicId, String systemId) {
}
String resource=null;
// return a proper input source
- if (systemId!=null && systemId.endsWith("persistence_3_2.xsd")) {
- resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_2.xsd"; //NOI18N
- } else if (systemId!=null && systemId.endsWith("persistence_3_0.xsd")) {
- resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_0.xsd"; //NOI18N
- } else if (systemId!=null && systemId.endsWith("persistence_2_2.xsd")) {
- resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_2.xsd"; //NOI18N
- } else if (systemId!=null && systemId.endsWith("persistence_2_1.xsd")) {
- resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_1.xsd"; //NOI18N
- } else if (systemId!=null && systemId.endsWith("persistence_2_0.xsd")) {
- resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_0.xsd"; //NOI18N
- } else if (systemId!=null && systemId.endsWith("persistence_1_0.xsd")) {
- resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_1_0.xsd"; //NOI18N
+ if (systemId != null) {
+ if (systemId.endsWith("persistence_4_0.xsd")) {
+ resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.xsd"; //NOI18N
+ } else if (systemId.endsWith("persistence_3_2.xsd")) {
+ resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_2.xsd"; //NOI18N
+ } else if (systemId.endsWith("persistence_3_0.xsd")) {
+ resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_0.xsd"; //NOI18N
+ } else if (systemId.endsWith("persistence_2_2.xsd")) {
+ resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_2.xsd"; //NOI18N
+ } else if (systemId.endsWith("persistence_2_1.xsd")) {
+ resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_1.xsd"; //NOI18N
+ } else if (systemId.endsWith("persistence_2_0.xsd")) {
+ resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_0.xsd"; //NOI18N
+ } else if (systemId.endsWith("persistence_1_0.xsd")) {
+ resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_1_0.xsd"; //NOI18N
+ }
}
// additional logging for #127276
if (LOGGER.isLoggable(Level.FINE)) {
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/Persistence.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/Persistence.java
index ef2c481ca19c..a1df4636be69 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/Persistence.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/Persistence.java
@@ -27,8 +27,12 @@
*/
public interface Persistence {
static public final String VERSION = "Version"; // NOI18N
- static public final String PERSISTENCE_UNIT = "PersistenceUnit"; // NOI18N
+ static public final String PERSISTENCE_UNIT = "PersistenceUnit"; // NOI18N
+ /**
+ * Jakarta EE 12 - JPA 4.0 (Schema v4.0)
+ */
+ public static final String VERSION_4_0="4.0"; //NOI18N
/**
* Jakarta EE 11 - JPA 3.2 (Schema v3.2)
*/
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/orm/model_4_0/package-info.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/orm/model_4_0/package-info.java
new file mode 100644
index 000000000000..656f4dc4fe40
--- /dev/null
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/orm/model_4_0/package-info.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+@Schema2Beans(
+ schema="../../resources/orm_4_0.xsd",
+ docRoot="entity-mappings",
+ mddFile="../../resources/orm_4_0.mdd",
+ schemaType=SchemaType.XML_SCHEMA,
+ outputType=OutputType.TRADITIONAL_BASEBEAN,
+ useInterfaces=true,
+ validate=true,
+ attrProp=true,
+ removeUnreferencedNodes=true,
+ java5=true
+)
+@org.netbeans.api.annotations.common.SuppressWarnings(value="NM_SAME_SIMPLE_NAME_AS_INTERFACE", justification="Generated implementation classes")
+package org.netbeans.modules.j2ee.persistence.dd.orm.model_4_0;
+
+import org.netbeans.modules.schema2beans.Schema2Beans;
+import org.netbeans.modules.schema2beans.Schema2Beans.OutputType;
+import org.netbeans.modules.schema2beans.Schema2Beans.SchemaType;
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/persistence/model_4_0/package-info.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/persistence/model_4_0/package-info.java
new file mode 100644
index 000000000000..897c170e5cc8
--- /dev/null
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/persistence/model_4_0/package-info.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+@Schema2Beans(
+ schema="../../resources/persistence_4_0.xsd",
+ mddFile="../../resources/persistence_4_0.mdd",
+ schemaType=SchemaType.XML_SCHEMA,
+ outputType=OutputType.TRADITIONAL_BASEBEAN,
+ useInterfaces=true,
+ validate=true,
+ attrProp=true,
+ removeUnreferencedNodes=true,
+ java5=true
+)
+@org.netbeans.api.annotations.common.SuppressWarnings(value="NM_SAME_SIMPLE_NAME_AS_INTERFACE", justification="Generated implementation classes")
+package org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0;
+
+import org.netbeans.modules.schema2beans.Schema2Beans;
+import org.netbeans.modules.schema2beans.Schema2Beans.OutputType;
+import org.netbeans.modules.schema2beans.Schema2Beans.SchemaType;
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.mdd b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.mdd
new file mode 100644
index 000000000000..efbdd8208c00
--- /dev/null
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.mdd
@@ -0,0 +1,377 @@
+
+
+
+
+ entity-mappings
+ https://jakarta.ee/xml/ns/persistence/orm
+ EntityMappings
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.EntityMappings
+
+
+ string
+ http://www.w3.org/2001/XMLSchema
+ String
+ java.lang.String
+
+
+ persistence-unit-metadata
+ https://jakarta.ee/xml/ns/persistence/orm
+ PersistenceUnitMetadata
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.PersistenceUnitMetadata
+
+
+ access-type
+ https://jakarta.ee/xml/ns/persistence/orm
+ AccessType
+ java.lang.String
+
+
+ sequence-generator
+ https://jakarta.ee/xml/ns/persistence/orm
+ SequenceGenerator
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.SequenceGenerator
+
+
+ table-generator
+ https://jakarta.ee/xml/ns/persistence/orm
+ TableGenerator
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.TableGenerator
+
+
+ named-query
+ https://jakarta.ee/xml/ns/persistence/orm
+ NamedQuery
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.NamedQuery
+
+
+ named-native-query
+ https://jakarta.ee/xml/ns/persistence/orm
+ NamedNativeQuery
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.NamedNativeQuery
+
+
+ sql-result-set-mapping
+ https://jakarta.ee/xml/ns/persistence/orm
+ SqlResultSetMapping
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.SqlResultSetMapping
+
+
+ mapped-superclass
+ https://jakarta.ee/xml/ns/persistence/orm
+ MappedSuperclass
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.MappedSuperclass
+
+
+ entity
+ https://jakarta.ee/xml/ns/persistence/orm
+ Entity
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Entity
+
+
+ embeddable
+ https://jakarta.ee/xml/ns/persistence/orm
+ Embeddable
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Embeddable
+
+
+ embeddable-attributes
+ https://jakarta.ee/xml/ns/persistence/orm
+ EmbeddableAttributes
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.EmbeddableAttributes
+
+
+ basic
+ https://jakarta.ee/xml/ns/persistence/orm
+ Basic
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Basic
+
+
+ transient
+ https://jakarta.ee/xml/ns/persistence/orm
+ Transient
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Transient
+
+
+ column
+ https://jakarta.ee/xml/ns/persistence/orm
+ Column
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Column
+
+
+ lob
+ https://jakarta.ee/xml/ns/persistence/orm
+ Lob
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Lob
+
+
+ temporal
+ https://jakarta.ee/xml/ns/persistence/orm
+ Temporal
+ java.lang.String
+
+
+ enumerated
+ https://jakarta.ee/xml/ns/persistence/orm
+ Enumerated
+ java.lang.String
+
+
+ table
+ https://jakarta.ee/xml/ns/persistence/orm
+ Table
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Table
+
+
+ secondary-table
+ https://jakarta.ee/xml/ns/persistence/orm
+ SecondaryTable
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.SecondaryTable
+
+
+ primary-key-join-column
+ https://jakarta.ee/xml/ns/persistence/orm
+ PrimaryKeyJoinColumn
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.PrimaryKeyJoinColumn
+
+
+ id-class
+ https://jakarta.ee/xml/ns/persistence/orm
+ IdClass
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.IdClass
+
+
+ inheritance
+ https://jakarta.ee/xml/ns/persistence/orm
+ Inheritance
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Inheritance
+
+
+ discriminator-value
+ https://jakarta.ee/xml/ns/persistence/orm
+ DiscriminatorValue
+ java.lang.String
+
+
+ discriminator-column
+ https://jakarta.ee/xml/ns/persistence/orm
+ DiscriminatorColumn
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.DiscriminatorColumn
+
+
+ emptyType
+ https://jakarta.ee/xml/ns/persistence/orm
+ EmptyType
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.EmptyType
+
+
+ entity-listeners
+ https://jakarta.ee/xml/ns/persistence/orm
+ EntityListeners
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.EntityListeners
+
+
+ pre-persist
+ https://jakarta.ee/xml/ns/persistence/orm
+ PrePersist
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.PrePersist
+
+
+ post-persist
+ https://jakarta.ee/xml/ns/persistence/orm
+ PostPersist
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostPersist
+
+
+ pre-remove
+ https://jakarta.ee/xml/ns/persistence/orm
+ PreRemove
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.PreRemove
+
+
+ post-remove
+ https://jakarta.ee/xml/ns/persistence/orm
+ PostRemove
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostRemove
+
+
+ pre-update
+ https://jakarta.ee/xml/ns/persistence/orm
+ PreUpdate
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.PreUpdate
+
+
+ post-update
+ https://jakarta.ee/xml/ns/persistence/orm
+ PostUpdate
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostUpdate
+
+
+ post-load
+ https://jakarta.ee/xml/ns/persistence/orm
+ PostLoad
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostLoad
+
+
+ attribute-override
+ https://jakarta.ee/xml/ns/persistence/orm
+ AttributeOverride
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.AttributeOverride
+
+
+ association-override
+ https://jakarta.ee/xml/ns/persistence/orm
+ AssociationOverride
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.AssociationOverride
+
+
+ attributes
+ https://jakarta.ee/xml/ns/persistence/orm
+ Attributes
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Attributes
+
+
+ version
+ https://jakarta.ee/xml/ns/persistence/orm
+ Version
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Version
+
+
+ many-to-one
+ https://jakarta.ee/xml/ns/persistence/orm
+ ManyToOne
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.ManyToOne
+
+
+ one-to-many
+ https://jakarta.ee/xml/ns/persistence/orm
+ OneToMany
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.OneToMany
+
+
+ one-to-one
+ https://jakarta.ee/xml/ns/persistence/orm
+ OneToOne
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.OneToOne
+
+
+ many-to-many
+ https://jakarta.ee/xml/ns/persistence/orm
+ ManyToMany
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.ManyToMany
+
+
+ embedded
+ https://jakarta.ee/xml/ns/persistence/orm
+ Embedded
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Embedded
+
+
+ order-by
+ https://jakarta.ee/xml/ns/persistence/orm
+ OrderBy
+ java.lang.String
+
+
+ map-key
+ https://jakarta.ee/xml/ns/persistence/orm
+ MapKey
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.MapKey
+
+
+ join-table
+ https://jakarta.ee/xml/ns/persistence/orm
+ JoinTable
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.JoinTable
+
+
+ cascade-type
+ https://jakarta.ee/xml/ns/persistence/orm
+ CascadeType
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.CascadeType
+
+
+ join-column
+ https://jakarta.ee/xml/ns/persistence/orm
+ JoinColumn
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.JoinColumn
+
+
+ unique-constraint
+ https://jakarta.ee/xml/ns/persistence/orm
+ UniqueConstraint
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.UniqueConstraint
+
+
+ id
+ https://jakarta.ee/xml/ns/persistence/orm
+ Id
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.Id
+
+
+ embedded-id
+ https://jakarta.ee/xml/ns/persistence/orm
+ EmbeddedId
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.EmbeddedId
+
+
+ generated-value
+ https://jakarta.ee/xml/ns/persistence/orm
+ GeneratedValue
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.GeneratedValue
+
+
+ entity-listener
+ https://jakarta.ee/xml/ns/persistence/orm
+ EntityListener
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.EntityListener
+
+
+ entity-result
+ https://jakarta.ee/xml/ns/persistence/orm
+ EntityResult
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.EntityResult
+
+
+ column-result
+ https://jakarta.ee/xml/ns/persistence/orm
+ ColumnResult
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.ColumnResult
+
+
+ field-result
+ https://jakarta.ee/xml/ns/persistence/orm
+ FieldResult
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.FieldResult
+
+
+ query-hint
+ https://jakarta.ee/xml/ns/persistence/orm
+ QueryHint
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.QueryHint
+
+
+ persistence-unit-defaults
+ https://jakarta.ee/xml/ns/persistence/orm
+ PersistenceUnitDefaults
+ org.netbeans.modules.j2ee.persistence.api.metadata.orm.PersistenceUnitDefaults
+
+
\ No newline at end of file
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.xsd b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.xsd
new file mode 100644
index 000000000000..d509334dd44b
--- /dev/null
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.xsd
@@ -0,0 +1,2447 @@
+
+
+
+
+
+
+
+ ...
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The entity-mappings element is the root element of a mapping
+ file. It contains the following four types of elements:
+
+ 1. The persistence-unit-metadata element contains metadata
+ for the entire persistence unit. It is undefined if this element
+ occurs in multiple mapping files within the same persistence unit.
+
+ 2. The package, schema, catalog and access elements apply to all of
+ the entity, mapped-superclass and embeddable elements defined in
+ the same file in which they occur.
+
+ 3. The sequence-generator, table-generator, converter, named-query,
+ named-native-query, named-stored-procedure-query, and
+ sql-result-set-mapping elements are global to the persistence
+ unit. It is undefined to have more than one sequence-generator
+ or table-generator of the same name in the same or different
+ mapping files in a persistence unit. It is undefined to have
+ more than one named-query, named-native-query, sql-result-set-mapping,
+ or named-stored-procedure-query of the same name in the same
+ or different mapping files in a persistence unit. It is also
+ undefined to have more than one converter for the same target
+ type in the same or different mapping files in a persistence unit.
+
+ 4. The entity, mapped-superclass and embeddable elements each define
+ the mapping information for a managed persistent class. The mapping
+ information contained in these elements may be complete or it may
+ be partial.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Metadata that applies to the persistence unit and not just to
+ the mapping file in which it is contained.
+
+ If the xml-mapping-metadata-complete element is specified,
+ the complete set of mapping metadata for the persistence unit
+ is contained in the XML mapping files for the persistence unit.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ These defaults are applied to the persistence unit as a whole
+ unless they are overridden by local annotation or XML
+ element settings.
+
+ schema - Used as the schema for all tables, secondary tables, join
+ tables, collection tables, sequence generators, and table
+ generators that apply to the persistence unit
+ catalog - Used as the catalog for all tables, secondary tables, join
+ tables, collection tables, sequence generators, and table
+ generators that apply to the persistence unit
+ delimited-identifiers - Used to treat database identifiers as
+ delimited identifiers.
+ access - Used as the access type for all managed classes in
+ the persistence unit
+ cascade-persist - Adds cascade-persist to the set of cascade options
+ in all entity relationships of the persistence unit
+ entity-listeners - List of default entity listeners to be invoked
+ on each entity in the persistence unit.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines the settings and mappings for an entity. Is allowed to be
+ sparsely populated and used in conjunction with the annotations.
+ Alternatively, the metadata-complete attribute can be used to
+ indicate that no annotations on the entity class (and its fields
+ or properties) are to be processed. If this is the case then
+ the defaulting rules for the entity and its subelements will
+ be recursively applied.
+
+ @Target(TYPE) @Retention(RUNTIME)
+ public @interface Entity {
+ String name() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This element determines how the persistence provider accesses the
+ state of an entity or embedded object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(AssociationOverrides.class)
+ @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface AssociationOverride {
+ String name();
+ JoinColumn[] joinColumns() default{};
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+ JoinTable joinTable() default @JoinTable;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(AttributeOverrides.class)
+ @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface AttributeOverride {
+ String name();
+ Column column();
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This element contains the entity field or property mappings.
+ It may be sparsely populated to include only a subset of the
+ fields or properties. If metadata-complete for the entity is true
+ then the remainder of the attributes will be defaulted according
+ to the default rules.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface Basic {
+ FetchType fetch() default FetchType.EAGER;
+ boolean optional() default true;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH, DETACH }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({}) @Retention(RUNTIME)
+ public @interface CheckConstraint {
+ String name() default "";
+ String constraint();
+ String options() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface CollectionTable {
+ String name() default "";
+ String catalog() default "";
+ String schema() default "";
+ JoinColumn[] joinColumns() default {};
+ ForeignKey foreignKey() default @ForeignKey(ConstraintMode.PROVIDER_DEFAULT);
+ UniqueConstraint[] uniqueConstraints() default {};
+ Index[] indexes() default {};
+ String options() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface Column {
+ String name() default "";
+ boolean unique() default false;
+ boolean nullable() default true;
+ boolean insertable() default true;
+ boolean updatable() default true;
+ String columnDefinition() default "";
+ String options() default "";
+ String table() default "";
+ int length() default 255;
+ int precision() default 0; // decimal precision
+ int scale() default 0; // decimal scale
+ CheckConstraint[] check() default {};
+ String comment() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ type() default void.class;
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ public enum ConstraintMode { CONSTRAINT, NO_CONSTRAINT, PROVIDER_DEFAULT }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ targetClass();
+ ColumnResult[] columns();
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ converter() default AttributeConverter.class;
+ String attributeName() default "";
+ boolean disableConversion() default false;
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({TYPE}) @Retention(RUNTIME)
+ public @interface Converter {
+ boolean autoApply() default false;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({TYPE}) @Retention(RUNTIME)
+ public @interface DiscriminatorColumn {
+ String name() default "DTYPE";
+ DiscriminatorType discriminatorType() default STRING;
+ String columnDefinition() default "";
+ String options() default "";
+ int length() default 31;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ public enum DiscriminatorType { STRING, CHAR, INTEGER }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({TYPE}) @Retention(RUNTIME)
+ public @interface DiscriminatorValue {
+ String value();
+ }
+
+
+
+
+
+
+
+
+
+
+ targetClass() default void.class;
+ FetchType fetch() default FetchType.LAZY;
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines the settings and mappings for embeddable objects. Is
+ allowed to be sparsely populated and used in conjunction with
+ the annotations. Alternatively, the metadata-complete attribute
+ can be used to indicate that no annotations are to be processed
+ in the class. If this is the case then the defaulting rules will
+ be recursively applied.
+
+ @Target({TYPE}) @Retention(RUNTIME)
+ public @interface Embeddable {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface Embedded {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface EmbeddedId {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines an entity listener to be invoked at lifecycle events
+ for the entities that list this listener.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [] value();
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ entityClass();
+ LockModeType lockMode() default LockModeType.OPTIMISTIC;
+ FieldResult[] fields() default {};
+ String discriminatorColumn() default "";
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ public enum EnumType { ORDINAL, STRING }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface Enumerated {
+ EnumType value() default ORDINAL;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ public enum FetchType { LAZY, EAGER }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({}) @Retention(RUNTIME)
+ public @interface FieldResult {
+ String name();
+ String column();
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({}) @Retention(RUNTIME)
+ public @interface ForeignKey {
+ String name() default "";
+ ConstraintMode value() default CONSTRAINT;
+ String foreign-key-definition() default "";
+ String options() default "";
+ }
+
+ Note that the elements that embed the use of the annotation
+ default this use as @ForeignKey(PROVIDER_DEFAULT).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface GeneratedValue {
+ GenerationType strategy() default AUTO;
+ String generator() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ public enum GenerationType { TABLE, SEQUENCE, IDENTITY, UUID, AUTO }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface Id {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ value();
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ @Target({}) @Retention(RUNTIME)
+ public @interface Index {
+ String name() default "";
+ String columnList();
+ boolean unique() default false;
+ String options() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({TYPE}) @Retention(RUNTIME)
+ public @interface Inheritance {
+ InheritanceType strategy() default InheritanceType.SINGLE_TABLE;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ public enum InheritanceType { SINGLE_TABLE, TABLE_PER_CLASS, JOINED }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(JoinColumns.class)
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface JoinColumn {
+ String name() default "";
+ String referencedColumnName() default "";
+ boolean unique() default false;
+ boolean nullable() default true;
+ boolean insertable() default true;
+ boolean updatable() default true;
+ String columnDefinition() default "";
+ String options() default "";
+ String table() default "";
+ ForeignKey foreignKey() default @ForeignKey();
+ CheckConstraint[] check() default {};
+ String comment() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface JoinTable {
+ String name() default "";
+ String catalog() default "";
+ String schema() default "";
+ JoinColumn[] joinColumns() default {};
+ JoinColumn[] inverseJoinColumns() default {};
+ ForeignKey foreignKey() default @ForeignKey(ConstraintMode.PROVIDER_DEFAULT);
+ ForeignKey inverseForeignKey() default @ForeignKey(ConstraintMode.PROVIDER_DEFAULT);
+ UniqueConstraint[] uniqueConstraints() default {};
+ Index[] indexes() default {};
+ CheckConstraint[] check() default {};
+ String comment() default "";
+ String options() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface Lob {}
+
+
+
+
+
+
+
+
+
+
+
+ public enum LockModeType implements FindOption, RefreshOption { READ, WRITE, OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE, PESSIMISTIC_FORCE_INCREMENT, NONE}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ targetEntity() default void.class;
+ CascadeType[] cascade() default {};
+ FetchType fetch() default FetchType.LAZY;
+ String mappedBy() default "";
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ targetEntity() default void.class;
+ CascadeType[] cascade() default {};
+ FetchType fetch() default FetchType.EAGER;
+ boolean optional() default true;
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface MapKey {
+ String name() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+ value();
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface MapKeyColumn {
+ String name() default "";
+ boolean unique() default false;
+ boolean nullable() default false;
+ boolean insertable() default true;
+ boolean updatable() default true;
+ String columnDefinition() default "";
+ String options() default "";
+ String table() default "";
+ int length() default 255;
+ int precision() default 0; // decimal precision
+ int scale() default 0; // decimal scale
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(MapKeyJoinColumns.class)
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface MapKeyJoinColumn {
+ String name() default "";
+ String referencedColumnName() default "";
+ boolean unique() default false;
+ boolean nullable() default false;
+ boolean insertable() default true;
+ boolean updatable() default true;
+ String columnDefinition() default "";
+ String options() default "";
+ String table() default "";
+ ForeignKey foreignKey() default @ForeignKey(ConstraintMode.PROVIDER_DEFAULT);
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines the settings and mappings for a mapped superclass. Is
+ allowed to be sparsely populated and used in conjunction with
+ the annotations. Alternatively, the metadata-complete attribute
+ can be used to indicate that no annotations are to be processed
+ If this is the case then the defaulting rules will be recursively
+ applied.
+
+ @Target(TYPE) @Retention(RUNTIME)
+ public @interface MappedSuperclass {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({}) @Retention(RUNTIME)
+ public @interface NamedAttributeNode {
+ String value();
+ String subgraph() default "";
+ String keySubgraph() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(NamedEntityGraphs.class)
+ @Target({TYPE}) @Retention(RUNTIME)
+ public @interface NamedEntityGraph {
+ String name() default "";
+ NamedAttributeNode[] attributeNodes() default {};
+ boolean includeAllAttributes() default false;
+ NamedSubgraph[] subgraphs() default {};
+ NamedSubGraph[] subclassSubgraphs() default {};
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ resultClass() default void.class;
+ String resultSetMapping() default ""; //named SqlResultSetMapping
+ EntityResult[] entities() default {};
+ ConstructorResult[] classes() default {};
+ ColumnResult[] columns() default {};
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(NamedQueries.class)
+ @Target({TYPE}) @Retention(RUNTIME)
+ public @interface NamedQuery {
+ String name();
+ String query();
+ LockModeType lockMode() default LockModeType.NONE;
+ QueryHint[] hints() default {};
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(NamedStoredProcedureQueries.class)
+ @Target({TYPE}) @Retention(RUNTIME)
+ public @interface NamedStoredProcedureQuery {
+ String name();
+ String procedureName();
+ StoredProcedureParameter[] parameters() default {};
+ Class[] resultClasses() default {};
+ String[] resultSetMappings() default{};
+ QueryHint[] hints() default {};
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ type() default void.class;
+ NamedAttributeNode[] attributeNodes();
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ targetEntity() default void.class;
+ CascadeType[] cascade() default {};
+ FetchType fetch() default FetchType.LAZY;
+ String mappedBy() default "";
+ boolean orphanRemoval() default false;
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ targetEntity() default void.class;
+ CascadeType[] cascade() default {};
+ FetchType fetch() default FetchType.EAGER;
+ boolean optional() default true;
+ String mappedBy() default "";
+ boolean orphanRemoval() default false;
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface OrderBy {
+ String value() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface OrderColumn {
+ String name() default "";
+ boolean nullable() default true;
+ boolean insertable() default true;
+ boolean updatable() default true;
+ String columnDefinition() default "";
+ String options() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ public enum ParameterMode { IN, INOUT, OUT, REF_CURSOR }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD}) @Retention(RUNTIME)
+ public @interface PostLoad {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD}) @Retention(RUNTIME)
+ public @interface PostPersist {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD}) @Retention(RUNTIME)
+ public @interface PostRemove {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD}) @Retention(RUNTIME)
+ public @interface PostUpdate {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD}) @Retention(RUNTIME)
+ public @interface PrePersist {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD}) @Retention(RUNTIME)
+ public @interface PreRemove {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD}) @Retention(RUNTIME)
+ public @interface PreUpdate {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(PrimaryKeyJoinColumns.class)
+ @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface PrimaryKeyJoinColumn {
+ String name() default "";
+ String referencedColumnName() default "";
+ String columnDefinition() default "";
+ String options() default "";
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({}) @Retention(RUNTIME)
+ public @interface QueryHint {
+ String name();
+ String value();
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(SecondaryTables.class)
+ @Target({TYPE}) @Retention(RUNTIME)
+ public @interface SecondaryTable {
+ String name();
+ String catalog() default "";
+ String schema() default "";
+ PrimaryKeyJoinColumn[] pkJoinColumns() default {};
+ ForeignKey foreignKey() default @ForeignKey(ConstraintMode.PROVIDER_DEFAULT);
+ UniqueConstraint[] uniqueConstraints() default {};
+ Index[] indexes() default {};
+ CheckConstraint[] check() default {};
+ String comment() default "";
+ String options() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(SequenceGenerators.class)
+ @Target({TYPE, METHOD, FIELD, PACKAGE}) @Retention(RUNTIME)
+ public @interface SequenceGenerator {
+ String name() default "";
+ String sequenceName() default "";
+ String catalog() default "";
+ String schema() default "";
+ int initialValue() default 1;
+ int allocationSize() default 50;
+ String options() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(SqlResultSetMappings.class)
+ @Target({TYPE}) @Retention(RUNTIME)
+ public @interface SqlResultSetMapping {
+ String name();
+ EntityResult[] entities() default {};
+ ConstructorResult[] classes() default{};
+ ColumnResult[] columns() default {};
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ type();
+ }
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({TYPE}) @Retention(RUNTIME)
+ public @interface Table {
+ String name() default "";
+ String catalog() default "";
+ String schema() default "";
+ UniqueConstraint[] uniqueConstraints() default {};
+ Index[] indexes() default {};
+ CheckConstraint[] check() default {};
+ String comment() default "";
+ String options() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Repeatable(TableGenerators.class)
+ @Target({TYPE, METHOD, FIELD, PACKAGE}) @Retention(RUNTIME)
+ public @interface TableGenerator {
+ String name() default "";
+ String table() default "";
+ String catalog() default "";
+ String schema() default "";
+ String pkColumnName() default "";
+ String valueColumnName() default "";
+ String pkColumnValue() default "";
+ int initialValue() default 0;
+ int allocationSize() default 50;
+ UniqueConstraint[] uniqueConstraints() default {};
+ Indexes[] indexes() default {};
+ String options() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface Temporal {
+ TemporalType value();
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ @Deprecated(since = "3.2")
+ public enum TemporalType {
+ DATE, // java.sql.Date
+ TIME, // java.sql.Time
+ TIMESTAMP // java.sql.Timestamp
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface Transient {}
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({}) @Retention(RUNTIME)
+ public @interface UniqueConstraint {
+ String name() default "";
+ String[] columnNames();
+ String options() default "";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Target({METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface Version {}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.mdd b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.mdd
new file mode 100644
index 000000000000..09375b8799c0
--- /dev/null
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.mdd
@@ -0,0 +1,100 @@
+
+
+
+
+ persistence
+ https://jakarta.ee/xml/ns/persistence
+ Persistence
+
+ PersistenceUnit
+
+
+ org.netbeans.modules.j2ee.persistence.dd.common.Persistence
+
+
+
+ persistence-unit
+ https://jakarta.ee/xml/ns/persistence
+ PersistenceUnit
+
+ Description
+
+
+ Provider
+
+
+ JtaDataSource
+
+
+ NonJtaDataSource
+
+
+ MappingFile
+
+
+ JarFile
+
+
+ Class2
+
+
+ ExcludeUnlistedClasses
+
+
+ Properties
+
+
+ org.netbeans.modules.j2ee.persistence.dd.common.PersistenceUnit
+
+
+
+ string
+ http://www.w3.org/2001/XMLSchema
+ String
+ java.lang.String
+
+
+ boolean
+ http://www.w3.org/2001/XMLSchema
+ Boolean
+ boolean
+
+
+ properties
+ https://jakarta.ee/xml/ns/persistence
+ Properties
+
+ Property2
+
+
+ org.netbeans.modules.j2ee.persistence.dd.common.Properties
+
+
+
+ property
+ https://jakarta.ee/xml/ns/persistence
+ Property
+
+ org.netbeans.modules.j2ee.persistence.dd.common.Property
+
+
+
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.xsd b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.xsd
new file mode 100644
index 000000000000..d20ce2f618b1
--- /dev/null
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.xsd
@@ -0,0 +1,361 @@
+
+
+
+
+
+
+
+ ...
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Configuration of a persistence unit.
+
+
+
+
+
+
+
+
+
+
+
+ Description of this persistence unit.
+
+
+
+
+
+
+
+
+
+
+
+ Provider class that supplies EntityManagers for this
+ persistence unit.
+
+
+
+
+
+
+
+
+
+
+
+ Qualifier annotation class used for dependency injection.
+
+
+
+
+
+
+
+
+
+
+
+ Scope annotation class used for dependency injection.
+
+
+
+
+
+
+
+
+
+
+
+ The container-specific name of the JTA datasource to use.
+
+
+
+
+
+
+
+
+
+
+
+ The container-specific name of a non-JTA datasource to use.
+
+
+
+
+
+
+
+
+
+
+
+ File containing mapping information. Loaded as a resource
+ by the persistence provider.
+
+
+
+
+
+
+
+
+
+
+
+ Jar file that is to be scanned for managed classes.
+
+
+
+
+
+
+
+
+
+
+
+ Managed class to be included in the persistence unit and
+ to scan for annotations. It should be annotated
+ with either @Entity, @Embeddable or @MappedSuperclass.
+
+
+
+
+
+
+
+
+
+
+
+ When set to true then only listed classes and jars will
+ be scanned for persistent classes, otherwise the
+ enclosing jar or directory will also be scanned.
+ Not applicable to Java SE persistence units.
+
+
+
+
+
+
+
+
+
+
+
+ Defines whether caching is enabled for the
+ persistence unit if caching is supported by the
+ persistence provider. When set to ALL, all entities
+ will be cached. When set to NONE, no entities will
+ be cached. When set to ENABLE_SELECTIVE, only entities
+ specified as cacheable will be cached. When set to
+ DISABLE_SELECTIVE, entities specified as not cacheable
+ will not be cached. When not specified or when set to
+ UNSPECIFIED, provider defaults may apply.
+
+
+
+
+
+
+
+
+
+
+
+ The validation mode to be used for the persistence unit.
+
+
+
+
+
+
+
+
+
+
+
+
+ A list of standard and vendor-specific properties
+ and hints.
+
+
+
+
+
+
+
+
+ A name-value pair.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ An extension point for integration related configuration, e.g. cdi:
+
+
+
+
+
+
+
+
+
+
+
+
+ Name used in code to reference this persistence unit.
+
+
+
+
+
+
+
+
+
+
+
+ Type of transactions used by EntityManagers from this
+ persistence unit.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ public enum PersistenceUnitTransactionType {JTA, RESOURCE_LOCAL};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ public enum SharedCacheMode { ALL, NONE, ENABLE_SELECTIVE, DISABLE_SELECTIVE, UNSPECIFIED};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ public enum ValidationMode { AUTO, CALLBACK, NONE};
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java
index 1daa427ad875..53499984597e 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java
@@ -27,11 +27,6 @@
import static org.netbeans.modules.j2ee.persistence.dd.common.PersistenceUnit.JAVAX_NAMESPACE;
import org.openide.util.NbBundle;
-/**
- *
- * @author pblaha
- */
-
/**
* This class represents DataNucleus provider.
*
@@ -111,13 +106,13 @@ public String getTableGenerationCreateValue() {
}
@Override
- public Map getUnresolvedVendorSpecificProperties() {
+ public Map getUnresolvedVendorSpecificProperties() {
return Collections.emptyMap();
}
@Override
- public Map getDefaultVendorSpecificProperties() {
- Map properties = new HashMap<>();
+ public Map getDefaultVendorSpecificProperties() {
+ Map properties = new HashMap<>(4);
properties.put("datanucleus.transaction.nontx.read", "true"); //NOI18N
properties.put("datanucleus.transaction.nontx.write", "true"); //NOI18N
properties.put("datanucleus.ConnectionURL", "appengine"); //NOI18N
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/Provider.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/Provider.java
index d2f18a12aead..831502f2d02a 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/Provider.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/Provider.java
@@ -81,22 +81,19 @@ public boolean isOnClassPath(ClassPath cp)
{
String classRelativePath = getProviderClass().replace('.', '/') + ".class"; //NOI18N
boolean ret = cp.findResource(classRelativePath) != null;
- if(ret && version != null)
- {
- if(Persistence.VERSION_3_2.equals(version)) {
- ret &= cp.findResource("jakarta/persistence/criteria/CriteriaSelect.class") != null;
- } else if(Persistence.VERSION_3_1.equals(version)){
- ret &= cp.findResource("jakarta/persistence/spi/TransformerException.class") != null;
- } else if(Persistence.VERSION_3_0.equals(version)){
- ret &= cp.findResource("jakarta/persistence/Entity.class") != null;
- } else if (Persistence.VERSION_2_2.equals(version)) {
- ret &= cp.findResource("javax/persistence/TableGenerators.class") != null;
- } else if (Persistence.VERSION_2_1.equals(version)) {
- ret &= cp.findResource("javax/persistence/criteria/CriteriaUpdate.class") != null;
- } else if (Persistence.VERSION_2_0.equals(version)) {
- ret &= cp.findResource("javax/persistence/criteria/JoinType.class") != null;
- } else if (Persistence.VERSION_1_0.equals(version)) {
- ret &= cp.findResource("javax/persistence/Entity.class") != null && cp.findResource("javax/persistence/criteria/JoinType.class") == null;
+ if(ret && version != null) {
+ if(null != version) switch (version) {
+ case Persistence.VERSION_4_0 -> ret &= cp.findResource("jakarta/persistence/PostDelete.class") != null;
+ case Persistence.VERSION_3_2 -> ret &= cp.findResource("jakarta/persistence/criteria/CriteriaSelect.class") != null;
+ case Persistence.VERSION_3_1 -> ret &= cp.findResource("jakarta/persistence/spi/TransformerException.class") != null;
+ case Persistence.VERSION_3_0 -> ret &= cp.findResource("jakarta/persistence/Entity.class") != null;
+ case Persistence.VERSION_2_2 -> ret &= cp.findResource("javax/persistence/TableGenerators.class") != null;
+ case Persistence.VERSION_2_1 -> ret &= cp.findResource("javax/persistence/criteria/CriteriaUpdate.class") != null;
+ case Persistence.VERSION_2_0 -> ret &= cp.findResource("javax/persistence/criteria/JoinType.class") != null;
+ case Persistence.VERSION_1_0 -> ret &= cp.findResource("javax/persistence/Entity.class") != null
+ && cp.findResource("javax/persistence/criteria/JoinType.class") == null;
+ default -> {
+ }
}
}
return ret;
@@ -111,15 +108,15 @@ protected boolean isJakartaNamespace() {
return getVersion()!=null && Float.parseFloat(Persistence.VERSION_2_2) < Float.parseFloat(getVersion());
}
- private Set initPropertyNames(){
+ private Set initPropertyNames(){
Set result = new HashSet<>();
result.add(getJdbcDriver());
result.add(getJdbcUsername());
result.add(getJdbcUrl());
result.add(getJdbcPassword());
result.add(getTableGenerationPropertyName());
- for (Iterator it = getUnresolvedVendorSpecificProperties().keySet().iterator(); it.hasNext();) {
- String propertyName = (String) it.next();
+ for (Iterator it = getUnresolvedVendorSpecificProperties().keySet().iterator(); it.hasNext();) {
+ String propertyName = it.next();
result.add(propertyName);
}
return result;
@@ -127,9 +124,9 @@ private Set initPropertyNames(){
/**
* Gets the names of all provider specific properties.
- * @return Set of Strings representing names of provider specific properties.
+ * @return Set{@code } representing names of provider specific properties.
*/
- public Set getPropertyNames(){
+ public Set getPropertyNames(){
return this.vendorSpecificProperties;
}
@@ -142,21 +139,18 @@ public final Property getTableGenerationProperty(String strategy, String version
return null;
}
Property result;
- if (Persistence.VERSION_3_2.equals(version)) {
- result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Property();
- } else if (Persistence.VERSION_3_1.equals(version)) {
- result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Property();
- } else if (Persistence.VERSION_3_0.equals(version)) {
- result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Property();
- } else if (Persistence.VERSION_2_2.equals(version)) {
- result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Property();
- } else if (Persistence.VERSION_2_1.equals(version)) {
- result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Property();
- } else if (Persistence.VERSION_2_0.equals(version)) {
- result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Property();
- } else {
+ if (null == version) {
result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Property();
- }
+ } else result = switch (version) {
+ case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.Property();
+ case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Property();
+ case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Property();
+ case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Property();
+ case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Property();
+ case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Property();
+ case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Property();
+ default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Property();
+ };
result.setName(getTableGenerationPropertyName());
if (TABLE_GENERATION_CREATE.equals(strategy)){
result.setValue(getTableGenerationCreateValue());
@@ -260,13 +254,13 @@ public String getTableGenerationDropCreateValue(){
/**
* @return Map{@code } containing vendor specific properties.
*/
- public abstract Map getUnresolvedVendorSpecificProperties();
+ public abstract Map getUnresolvedVendorSpecificProperties();
/**
* @return Map{@code } containing vendor specific properties
* which should be set on a new unit by default.
*/
- public abstract Map getDefaultVendorSpecificProperties();
+ public abstract Map getDefaultVendorSpecificProperties();
/**
* Gets a map containing provider specific name / values pairs of given
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtil.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtil.java
index eca1564d3782..7a8080e29586 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtil.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtil.java
@@ -69,6 +69,7 @@ public class ProviderUtil {
public static final Provider HIBERNATE_PROVIDER3_0 = new HibernateProvider(Persistence.VERSION_3_0);
public static final Provider HIBERNATE_PROVIDER3_1 = new HibernateProvider(Persistence.VERSION_3_1);
public static final Provider HIBERNATE_PROVIDER3_2 = new HibernateProvider(Persistence.VERSION_3_2);
+ public static final Provider HIBERNATE_PROVIDER4_0 = new HibernateProvider(Persistence.VERSION_4_0);
public static final Provider TOPLINK_PROVIDER1_0 = ToplinkProvider.create(Persistence.VERSION_1_0);
public static final Provider ECLIPSELINK_PROVIDER1_0 = new EclipseLinkProvider(Persistence.VERSION_1_0);
public static final Provider ECLIPSELINK_PROVIDER2_0 = new EclipseLinkProvider(Persistence.VERSION_2_0);
@@ -77,6 +78,7 @@ public class ProviderUtil {
public static final Provider ECLIPSELINK_PROVIDER3_0 = new EclipseLinkProvider(Persistence.VERSION_3_0);
public static final Provider ECLIPSELINK_PROVIDER3_1 = new EclipseLinkProvider(Persistence.VERSION_3_1);
public static final Provider ECLIPSELINK_PROVIDER3_2 = new EclipseLinkProvider(Persistence.VERSION_3_2);
+ public static final Provider ECLIPSELINK_PROVIDER4_0 = new EclipseLinkProvider(Persistence.VERSION_4_0);
public static final Provider KODO_PROVIDER = new KodoProvider();
public static final Provider DATANUCLEUS_PROVIDER1_0 = new DataNucleusProvider(Persistence.VERSION_1_0);
public static final Provider DATANUCLEUS_PROVIDER2_0 = new DataNucleusProvider(Persistence.VERSION_2_0);
@@ -85,10 +87,13 @@ public class ProviderUtil {
public static final Provider DATANUCLEUS_PROVIDER3_0 = new DataNucleusProvider(Persistence.VERSION_3_0);
public static final Provider DATANUCLEUS_PROVIDER3_1 = new DataNucleusProvider(Persistence.VERSION_3_1);
public static final Provider DATANUCLEUS_PROVIDER3_2 = new DataNucleusProvider(Persistence.VERSION_3_2);
+ public static final Provider DATANUCLEUS_PROVIDER4_0 = new DataNucleusProvider(Persistence.VERSION_4_0);
public static final Provider OPENJPA_PROVIDER1_0 = new OpenJPAProvider(Persistence.VERSION_1_0);
public static final Provider OPENJPA_PROVIDER2_0 = new OpenJPAProvider(Persistence.VERSION_2_0);
public static final Provider OPENJPA_PROVIDER2_1 = new OpenJPAProvider(Persistence.VERSION_2_1);
public static final Provider OPENJPA_PROVIDER2_2 = new OpenJPAProvider(Persistence.VERSION_2_2);
+ public static final Provider OPENJPA_PROVIDER3_0 = new OpenJPAProvider(Persistence.VERSION_3_0);
+ public static final Provider OPENJPA_PROVIDER3_1 = new OpenJPAProvider(Persistence.VERSION_3_1);
public static final Provider DEFAULT_PROVIDER = new DefaultProvider();
public static final Provider DEFAULT_PROVIDER2_0 = new DefaultProvider(Persistence.VERSION_2_0);
public static final Provider DEFAULT_PROVIDER2_1 = new DefaultProvider(Persistence.VERSION_2_1);
@@ -96,6 +101,7 @@ public class ProviderUtil {
public static final Provider DEFAULT_PROVIDER3_0 = new DefaultProvider(Persistence.VERSION_3_0);
public static final Provider DEFAULT_PROVIDER3_1 = new DefaultProvider(Persistence.VERSION_3_1);
public static final Provider DEFAULT_PROVIDER3_2 = new DefaultProvider(Persistence.VERSION_3_2);
+ public static final Provider DEFAULT_PROVIDER4_0 = new DefaultProvider(Persistence.VERSION_4_0);
/**
* TopLink provider using the provider class that was used in NetBeans 5.5. Needed
* for maintaining backwards compatibility with persistence units created in 5.5.
@@ -129,27 +135,15 @@ public static Provider getProvider(String providerClass, Project project) {
Provider ret = null;
switch(ver) {
- case Persistence.VERSION_1_0:
- ret = DEFAULT_PROVIDER;
- break;
- case Persistence.VERSION_2_0:
- ret = DEFAULT_PROVIDER2_0;
- break;
- case Persistence.VERSION_2_1:
- ret = DEFAULT_PROVIDER2_1;
- break;
- case Persistence.VERSION_2_2:
- ret = DEFAULT_PROVIDER2_2;
- break;
- case Persistence.VERSION_3_0:
- ret = DEFAULT_PROVIDER3_0;
- break;
- case Persistence.VERSION_3_1:
- ret = DEFAULT_PROVIDER3_1;
- break;
- case Persistence.VERSION_3_2:
- ret = DEFAULT_PROVIDER3_2;
- }// some unknown provider
+ case Persistence.VERSION_1_0 -> ret = DEFAULT_PROVIDER;
+ case Persistence.VERSION_2_0 -> ret = DEFAULT_PROVIDER2_0;
+ case Persistence.VERSION_2_1 -> ret = DEFAULT_PROVIDER2_1;
+ case Persistence.VERSION_2_2 -> ret = DEFAULT_PROVIDER2_2;
+ case Persistence.VERSION_3_0 -> ret = DEFAULT_PROVIDER3_0;
+ case Persistence.VERSION_3_1 -> ret = DEFAULT_PROVIDER3_1;
+ case Persistence.VERSION_3_2 -> ret = DEFAULT_PROVIDER3_2;
+ case Persistence.VERSION_4_0 -> ret = DEFAULT_PROVIDER4_0;
+ } // some unknown provider
for (Provider each : getAllProviders()) {
if (each.getProviderClass().equals(providerClass.trim())) {
@@ -303,7 +297,9 @@ public static void setTableGeneration(PersistenceUnit persistenceUnit, String ta
return;
}
String version = Persistence.VERSION_1_0;
- if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
+ if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) {
+ version = Persistence.VERSION_4_0;
+ } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
version = Persistence.VERSION_3_2;
} else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {
version = Persistence.VERSION_3_1;
@@ -403,39 +399,37 @@ public static PersistenceUnit buildPersistenceUnit(String name, Provider provide
Parameters.notNull("provider", provider);
Parameters.notNull("connection", connection);
PersistenceUnit persistenceUnit = null;
- if (Persistence.VERSION_3_2.equals(version)) {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
- } else if (Persistence.VERSION_3_1.equals(version)) {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- } else if (Persistence.VERSION_3_0.equals(version)) {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
- } else if (Persistence.VERSION_2_2.equals(version)) {
+ if (null == version) {//currently default 2.2
persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
- } else if (Persistence.VERSION_2_1.equals(version)) {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
- } else if (Persistence.VERSION_2_0.equals(version)) {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
- } else {//currently default 1.0
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
- }
+ } else persistenceUnit = switch (version) {
+ case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit();
+ case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
+ case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
+ case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
+ case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
+ case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
+ default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
+ }; //currently default 1.0
+
persistenceUnit.setName(name);
persistenceUnit.setProvider(provider.getProviderClass());
Properties properties = persistenceUnit.newProperties();
- Map connectionProperties = provider.getConnectionPropertiesMap(connection, version);
- for (Iterator it = connectionProperties.keySet().iterator(); it.hasNext();) {
- String propertyName = (String) it.next();
+ Map connectionProperties = provider.getConnectionPropertiesMap(connection, version);
+ for (Iterator it = connectionProperties.keySet().iterator(); it.hasNext();) {
+ String propertyName = it.next();
Property property = properties.newProperty();
property.setName(propertyName);
- property.setValue((String) connectionProperties.get(propertyName));
+ property.setValue(connectionProperties.get(propertyName));
properties.addProperty2(property);
}
- Map defaultProperties = provider.getDefaultVendorSpecificProperties();
- for (Iterator it = defaultProperties.keySet().iterator(); it.hasNext();) {
- String propertyName = (String) it.next();
+ Map defaultProperties = provider.getDefaultVendorSpecificProperties();
+ for (Iterator it = defaultProperties.keySet().iterator(); it.hasNext();) {
+ String propertyName = it.next();
Property property = properties.newProperty();
property.setName(propertyName);
- property.setValue((String) defaultProperties.get(propertyName));
+ property.setValue(defaultProperties.get(propertyName));
properties.addProperty2(property);
}
@@ -478,19 +472,24 @@ public static void setDatabaseConnection(PersistenceUnit persistenceUnit, Provid
}
Property[] properties = getProperties(persistenceUnit);
- String version = Persistence.VERSION_1_0;
- if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ String version = Persistence.VERSION_2_2;
+ // we have persistence unit with specific version, should use it
+ if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) {
+ version = Persistence.VERSION_4_0;
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
version = Persistence.VERSION_3_2;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {
version = Persistence.VERSION_3_1;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {
version = Persistence.VERSION_3_0;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {
version = Persistence.VERSION_2_2;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {
version = Persistence.VERSION_2_1;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {
version = Persistence.VERSION_2_0;
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit) {
+ version = Persistence.VERSION_1_0;
}
Map propertiesMap = provider.getConnectionPropertiesMap(connection, version);
@@ -591,19 +590,24 @@ public static Provider getProvider(PersistenceUnit persistenceUnit) {
*/
public static Provider getProvider(PersistenceUnit persistenceUnit, Provider[] providers) {
Parameters.notNull("persistenceUnit", persistenceUnit); //NOI18N
- String version = Persistence.VERSION_1_0;
- if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ String version = Persistence.VERSION_2_2;
+ // we have persistence unit with specific version, should use it
+ if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) {
+ version = Persistence.VERSION_4_0;
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
version = Persistence.VERSION_3_2;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {
version = Persistence.VERSION_3_1;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {
version = Persistence.VERSION_3_0;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {
version = Persistence.VERSION_2_2;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {
version = Persistence.VERSION_2_1;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {
version = Persistence.VERSION_2_0;
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit) {
+ version = Persistence.VERSION_1_0;
}
long top_version = Math.round(Double.parseDouble(version) * 100);
long longVersion = top_version;
@@ -643,22 +647,16 @@ public static Provider getProvider(PersistenceUnit persistenceUnit, Provider[] p
}
}
if(top_provider == null) {
- switch (version) {
- case Persistence.VERSION_1_0:
- return DEFAULT_PROVIDER;
- case Persistence.VERSION_2_0:
- return DEFAULT_PROVIDER2_0;
- case Persistence.VERSION_2_1:
- return DEFAULT_PROVIDER2_1;
- case Persistence.VERSION_2_2:
- return DEFAULT_PROVIDER2_2;
- case Persistence.VERSION_3_0:
- return DEFAULT_PROVIDER3_0;
- case Persistence.VERSION_3_2:
- return DEFAULT_PROVIDER3_2;
- default:
- return DEFAULT_PROVIDER3_1;
- }// some unknown provider
+ return switch (version) {
+ case Persistence.VERSION_1_0 -> DEFAULT_PROVIDER;
+ case Persistence.VERSION_2_0 -> DEFAULT_PROVIDER2_0;
+ case Persistence.VERSION_2_1 -> DEFAULT_PROVIDER2_1;
+ case Persistence.VERSION_2_2 -> DEFAULT_PROVIDER2_2;
+ case Persistence.VERSION_3_0 -> DEFAULT_PROVIDER3_0;
+ case Persistence.VERSION_3_2 -> DEFAULT_PROVIDER3_2;
+ case Persistence.VERSION_4_0 -> DEFAULT_PROVIDER4_0;
+ default -> DEFAULT_PROVIDER3_1;
+ }; // some unknown provider
}
return top_provider;
}
@@ -668,9 +666,9 @@ private static Set filterProvidersByProperties(Set providers
Set ret = null;
if(providers == null){}
else if(providers.size()<= 1 || properties==null || properties.length==0) {
- ret = new HashSet(providers);
+ ret = new HashSet<>(providers);
} else {
- ret = new HashSet(providers);
+ ret = new HashSet<>(providers);
HashMap > rates = new HashMap<>();
int lowrate = Integer.MAX_VALUE;
for(Provider each : providers){
@@ -818,18 +816,21 @@ public static void addPersistenceUnit(PersistenceUnit persistenceUnit, Project p
*
*/
public static void addPersistenceUnit(PersistenceUnit persistenceUnit, Project project, FileObject root) throws InvalidPersistenceXmlException {
- String version = Persistence.VERSION_1_0;
- if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ String version = Persistence.VERSION_2_2;
+ // we have persistence unit with specific version, should use it
+ if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) {
+ version = Persistence.VERSION_4_0;
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
version = Persistence.VERSION_3_2;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {
version = Persistence.VERSION_3_1;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {
version = Persistence.VERSION_3_0;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {
version = Persistence.VERSION_2_2;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {
version = Persistence.VERSION_2_1;
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {
version = Persistence.VERSION_2_0;
}
PUDataObject pud = getPUDataObject(project, root, version);
@@ -1036,15 +1037,20 @@ public static String getDatasourceName(PersistenceUnit pu) {
*/
public static Provider[] getAllProviders() {
return new Provider[] {
+ DATANUCLEUS_PROVIDER4_0,
+ ECLIPSELINK_PROVIDER4_0,
+ HIBERNATE_PROVIDER4_0,
DATANUCLEUS_PROVIDER3_2,
ECLIPSELINK_PROVIDER3_2,
HIBERNATE_PROVIDER3_2,
DATANUCLEUS_PROVIDER3_1,
ECLIPSELINK_PROVIDER3_1,
HIBERNATE_PROVIDER3_1,
+ OPENJPA_PROVIDER3_1,
DATANUCLEUS_PROVIDER3_0,
ECLIPSELINK_PROVIDER3_0,
HIBERNATE_PROVIDER3_0,
+ OPENJPA_PROVIDER3_0,
DATANUCLEUS_PROVIDER2_2,
ECLIPSELINK_PROVIDER2_2,
HIBERNATE_PROVIDER2_2,
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/spi/entitymanagergenerator/EntityManagerGenerationStrategySupport.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/spi/entitymanagergenerator/EntityManagerGenerationStrategySupport.java
index 847f1434aea5..f9a0c842ced6 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/spi/entitymanagergenerator/EntityManagerGenerationStrategySupport.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/spi/entitymanagergenerator/EntityManagerGenerationStrategySupport.java
@@ -459,17 +459,20 @@ private String getPersistenceVersion() {
} else {
version = Persistence.VERSION_1_0;
}
- if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ // we have persistence unit with specific version, should use it
+ if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) {
+ version = Persistence.VERSION_4_0;
+ } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
version = Persistence.VERSION_3_2;
- } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {
version = Persistence.VERSION_3_1;
- } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {
version = Persistence.VERSION_3_0;
- } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {
version = Persistence.VERSION_2_2;
- } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {
version = Persistence.VERSION_2_1;
- } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {// we have persistence unit with specific version, should use it
+ } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {
version = Persistence.VERSION_2_0;
}
return version;
@@ -478,13 +481,13 @@ private String getPersistenceVersion() {
protected String getEntityManagerFqn() {
String version = getPersistenceVersion();
switch(version) {
- case Persistence.VERSION_1_0:
- case Persistence.VERSION_2_0:
- case Persistence.VERSION_2_1:
- case Persistence.VERSION_2_2:
- return ENTITY_MANAGER_FQN;
- default:
- return ENTITY_MANAGER_JAKARTA_FQN;
+ case Persistence.VERSION_1_0:
+ case Persistence.VERSION_2_0:
+ case Persistence.VERSION_2_1:
+ case Persistence.VERSION_2_2:
+ return ENTITY_MANAGER_FQN;
+ default:
+ return ENTITY_MANAGER_JAKARTA_FQN;
}
}
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/layer.xml b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/layer.xml
index d0200cc1dc9f..ef6a92a33b3c 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/layer.xml
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/layer.xml
@@ -223,6 +223,7 @@
+
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-4.0.xml b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-4.0.xml
new file mode 100644
index 000000000000..758be7dc4e44
--- /dev/null
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-4.0.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PUDataObject.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PUDataObject.java
index 7a2fdfca63f2..f37df671c812 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PUDataObject.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PUDataObject.java
@@ -184,27 +184,42 @@ public boolean parseDocument() {
Persistence newPersistence;
Persistence cleanPersistence;
try (InputStream is = getEditorSupport().getInputStream()) {
- if(Persistence.VERSION_3_2.equals(version)) {
- newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence.createGraph(is);
- cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence();
- } else if(Persistence.VERSION_3_1.equals(version)) {
- newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence.createGraph(is);
- cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence();
- } else if(Persistence.VERSION_3_0.equals(version)) {
- newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence.createGraph(is);
- cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence();
- } else if(Persistence.VERSION_2_2.equals(version)) {
- newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence.createGraph(is);
- cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence();
- } else if(Persistence.VERSION_2_1.equals(version)) {
- newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence.createGraph(is);
- cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence();
- } else if(Persistence.VERSION_2_0.equals(version)) {
- newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence.createGraph(is);
- cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence();
- } else {//1.0 - default
+ if(null == version) {
newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence.createGraph(is);
cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence();
+ } else switch (version) {
+ case Persistence.VERSION_4_0 -> {
+ newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.Persistence.createGraph(is);
+ cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.Persistence();
+ }
+ case Persistence.VERSION_3_2 -> {
+ newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence.createGraph(is);
+ cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence();
+ }
+ case Persistence.VERSION_3_1 -> {
+ newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence.createGraph(is);
+ cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence();
+ }
+ case Persistence.VERSION_3_0 -> {
+ newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence.createGraph(is);
+ cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence();
+ }
+ case Persistence.VERSION_2_2 -> {
+ newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence.createGraph(is);
+ cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence();
+ }
+ case Persistence.VERSION_2_1 -> {
+ newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence.createGraph(is);
+ cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence();
+ }
+ case Persistence.VERSION_2_0 -> {
+ newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence.createGraph(is);
+ cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence();
+ }
+ default -> {
+ newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence.createGraph(is);
+ cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence();
+ }
}
} catch (RuntimeException ex) { // must catch RTE (thrown by schema2beans when document is not valid)
LOG.log(Level.INFO, null, ex);
@@ -458,15 +473,11 @@ protected void updateDataFromModel(Object model, FileLock lock, boolean modify)
if (model == null) {
return;
}
- try (Writer out = new StringWriter()) {
+ try (lock; Writer out = new StringWriter()) {
((BaseBean) model).write(out);
getDataCache().setData(lock, out.toString(), modify);
} catch (IOException | Schema2BeansException e) {
LOG.log(Level.INFO, null, e);
- } finally {
- if (lock != null){
- lock.releaseLock();
- }
}
}
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCatalog.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCatalog.java
index 273dd90ece32..87950f873e51 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCatalog.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCatalog.java
@@ -61,6 +61,7 @@ private void initialize(){
schemas.add(new SchemaInfo("persistence_2_2.xsd", RESOURCE_PATH, PERSISTENCE_NS));
schemas.add(new SchemaInfo("persistence_3_0.xsd", RESOURCE_PATH, PERSISTENCE_JAKARTA_NS));
schemas.add(new SchemaInfo("persistence_3_2.xsd", RESOURCE_PATH, PERSISTENCE_JAKARTA_NS));
+ schemas.add(new SchemaInfo("persistence_4_0.xsd", RESOURCE_PATH, PERSISTENCE_JAKARTA_NS));
// orm
schemas.add(new SchemaInfo("orm_1_0.xsd", RESOURCE_PATH, ORM_OLD_NS));
schemas.add(new SchemaInfo("orm_2_0.xsd", RESOURCE_PATH, ORM_OLD_NS));
@@ -69,6 +70,7 @@ private void initialize(){
schemas.add(new SchemaInfo("orm_3_0.xsd", RESOURCE_PATH, ORM_JAKARTA_NS));
schemas.add(new SchemaInfo("orm_3_1.xsd", RESOURCE_PATH, ORM_JAKARTA_NS));
schemas.add(new SchemaInfo("orm_3_2.xsd", RESOURCE_PATH, ORM_JAKARTA_NS));
+ schemas.add(new SchemaInfo("orm_4_0.xsd", RESOURCE_PATH, ORM_JAKARTA_NS));
}
@Override
@@ -85,7 +87,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc
}
@Override
- public Iterator getPublicIDs() {
+ public Iterator getPublicIDs() {
List result = new ArrayList<>();
for (SchemaInfo each : schemas){
result.add(each.getPublicId());
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCfgProperties.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCfgProperties.java
index 0fa119bd5420..40a64942ac84 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCfgProperties.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCfgProperties.java
@@ -190,11 +190,13 @@ public class PersistenceCfgProperties {
possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER2_2).put(PersistenceUnitProperties.SHARED_CACHE_MODE, SHARED_CACHE_MODE);
possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER2_2).put(PersistenceUnitProperties.WEAVING_MAPPEDSUPERCLASS, TRUE_FALSE);
possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER2_2).put(ProviderUtil.ECLIPSELINK_PROVIDER2_2.getTableGenerationPropertyName(),possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER2_0).get(ProviderUtil.ECLIPSELINK_PROVIDER2_0.getTableGenerationPropertyName()));
+
//EclipseLink JPA 3.0 (initially just copy of 2.2 and then replace javax to jakarta)
possiblePropertyValues.put(ProviderUtil.ECLIPSELINK_PROVIDER3_0, new HashMap<>());
for (Map.Entry entry : possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER2_2).entrySet()) {
possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_0).put(entry.getKey().replace(JAVAX_NAMESPACE, JAKARTA_NAMESPACE), entry.getValue());
}
+
//EclipseLink JPA 3.1 (initially just copy of 3.0)
possiblePropertyValues.put(ProviderUtil.ECLIPSELINK_PROVIDER3_1, new HashMap<>());
possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_1).putAll(possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_0));
@@ -202,6 +204,10 @@ public class PersistenceCfgProperties {
//EclipseLink JPA 3.2 (initially just copy of 3.0)
possiblePropertyValues.put(ProviderUtil.ECLIPSELINK_PROVIDER3_2, new HashMap<>());
possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_2).putAll(possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_0));
+
+ //EclipseLink JPA 4.0 (initially just copy of 3.0)
+ possiblePropertyValues.put(ProviderUtil.ECLIPSELINK_PROVIDER4_0, new HashMap<>());
+ possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER4_0).putAll(possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_0));
//Hibernate JPA 1.0
possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER1_0, new HashMap());
@@ -239,11 +245,13 @@ public class PersistenceCfgProperties {
//Hibernate JPA 2.2 (initially just copy of 2.0)
possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER2_2, new HashMap());
possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER2_2).putAll(possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER2_0));
+
//Hibernate JPA 3.0 (initially just copy of 2.2 and then replace javax to jakarta)
possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER3_0, new HashMap());
for (Map.Entry entry : possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER2_2).entrySet()) {
possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_0).put(entry.getKey().replace(JAVAX_NAMESPACE, JAKARTA_NAMESPACE), entry.getValue());
}
+
//Hibernate JPA 3.1 (initially just copy of 3.0)
possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER3_1, new HashMap());
possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_1).putAll(possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_0));
@@ -252,6 +260,10 @@ public class PersistenceCfgProperties {
possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER3_2, new HashMap());
possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_2).putAll(possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_0));
+ //Hibernate JPA 4.0 (initially just copy of 3.0)
+ possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER4_0, new HashMap());
+ possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER4_0).putAll(possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_0));
+
//OpenJPA JPA 1.0
possiblePropertyValues.put(ProviderUtil.OPENJPA_PROVIDER1_0, new HashMap());
possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER1_0).put(ProviderUtil.OPENJPA_PROVIDER1_0.getJdbcUrl(), null);
@@ -373,6 +385,16 @@ public class PersistenceCfgProperties {
possiblePropertyValues.put(ProviderUtil.OPENJPA_PROVIDER2_2, new HashMap());
possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER2_2).putAll(possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER2_1));
+ //OpenJPA JPA 3.0 (initially just copy of 2.2 and then replace javax to jakarta)
+ possiblePropertyValues.put(ProviderUtil.OPENJPA_PROVIDER3_0, new HashMap<>());
+ for (Map.Entry entry : possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER2_2).entrySet()) {
+ possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER3_0).put(entry.getKey().replace(JAVAX_NAMESPACE, JAKARTA_NAMESPACE), entry.getValue());
+ }
+
+ //OpenJPA JPA 3.1 (initially just copy of 3.0)
+ possiblePropertyValues.put(ProviderUtil.OPENJPA_PROVIDER3_1, new HashMap());
+ possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER3_1).putAll(possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER3_0));
+
//DataNucleus JPA 1.0
possiblePropertyValues.put(ProviderUtil.DATANUCLEUS_PROVIDER1_0, new HashMap());
possiblePropertyValues.get(ProviderUtil.DATANUCLEUS_PROVIDER1_0).put(ProviderUtil.DATANUCLEUS_PROVIDER1_0.getJdbcUrl(), null);
@@ -613,6 +635,10 @@ public class PersistenceCfgProperties {
possiblePropertyValues.put(ProviderUtil.DATANUCLEUS_PROVIDER3_2, new HashMap());
possiblePropertyValues.get(ProviderUtil.DATANUCLEUS_PROVIDER3_2).putAll(possiblePropertyValues.get(ProviderUtil.DATANUCLEUS_PROVIDER3_0));
+ //DataNucleus JPA 4.0 (initially just copy of 3.0)
+ possiblePropertyValues.put(ProviderUtil.DATANUCLEUS_PROVIDER4_0, new HashMap());
+ possiblePropertyValues.get(ProviderUtil.DATANUCLEUS_PROVIDER4_0).putAll(possiblePropertyValues.get(ProviderUtil.DATANUCLEUS_PROVIDER3_0));
+
//toplink 1.0
possiblePropertyValues.put(ProviderUtil.TOPLINK_PROVIDER1_0, new HashMap());
possiblePropertyValues.get(ProviderUtil.TOPLINK_PROVIDER1_0).put(ProviderUtil.TOPLINK_PROVIDER1_0.getJdbcUrl(), null);
@@ -669,7 +695,7 @@ public static Map> getAllKeyAndValues(){
* @return
*/
public static List getProviders(){
- ArrayList ret = new ArrayList<>();
+ List ret = new ArrayList<>(8);
ret.add(ProviderUtil.ECLIPSELINK_PROVIDER3_1);
ret.add(ProviderUtil.HIBERNATE_PROVIDER2_2);
ret.add(ProviderUtil.DATANUCLEUS_PROVIDER2_2);
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceToolBarMVElement.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceToolBarMVElement.java
index 6dd8c8368a3d..8b024096e103 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceToolBarMVElement.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceToolBarMVElement.java
@@ -404,7 +404,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
PersistenceUnit punit;
boolean useModelgen = false;
String modelGenLib = null;
- if(Persistence.VERSION_3_2.equals(version)) {
+ if(Persistence.VERSION_4_0.equals(version)) {
+ useModelgen = true;
+ punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit();
+ } else if(Persistence.VERSION_3_2.equals(version)) {
useModelgen = true;
punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
} else if(Persistence.VERSION_3_1.equals(version)) {
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitPanel.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitPanel.java
index cc99d5a50156..3bde8181f197 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitPanel.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitPanel.java
@@ -211,18 +211,20 @@ private void setVisiblePanel(){
}
private void initCache(){
String caching = "";
- if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
- caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) persistenceUnit).getSharedCacheMode();
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {
- caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) persistenceUnit).getSharedCacheMode();
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {
- caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) persistenceUnit).getSharedCacheMode();
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {
- caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) persistenceUnit).getSharedCacheMode();
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {
- caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) persistenceUnit).getSharedCacheMode();
- } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {
- caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) persistenceUnit).getSharedCacheMode();
+ if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit pu40) {
+ caching = pu40.getSharedCacheMode();
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit pu32) {
+ caching = pu32.getSharedCacheMode();
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit pu31) {
+ caching = pu31.getSharedCacheMode();
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit pu30) {
+ caching = pu30.getSharedCacheMode();
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit pu22) {
+ caching = pu22.getSharedCacheMode();
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit pu21) {
+ caching = pu21.getSharedCacheMode();
+ } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit pu20) {
+ caching = pu20.getSharedCacheMode();
}
if(cachingTypes[0].equals(caching))
@@ -251,18 +253,20 @@ else if(cachingTypes[3].equals(caching))
private void initValidation(){
String validation = "";
- if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
- validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) persistenceUnit).getValidationMode();
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {
- validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) persistenceUnit).getValidationMode();
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {
- validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) persistenceUnit).getValidationMode();
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {
- validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) persistenceUnit).getValidationMode();
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {
- validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) persistenceUnit).getValidationMode();
- } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {
- validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) persistenceUnit).getValidationMode();
+ if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit pu40) {
+ validation = pu40.getValidationMode();
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit pu32) {
+ validation = pu32.getValidationMode();
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit pu31) {
+ validation = pu31.getValidationMode();
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit pu30) {
+ validation = pu30.getValidationMode();
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit pu22) {
+ validation = pu22.getValidationMode();
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit pu21) {
+ validation = pu21.getValidationMode();
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit pu20) {
+ validation = pu20.getValidationMode();
}
if(validationModes[1].equals(validation))
@@ -536,32 +540,36 @@ else if(source==ddNoValidation)
vMode = validationModes[2];
}
if(!"".equals(cType)) {
- if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType);
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType);
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType);
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType);
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType);
- } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType);
+ if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit pu40) {
+ pu40.setSharedCacheMode(cType);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit pu32) {
+ pu32.setSharedCacheMode(cType);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit pu31) {
+ pu31.setSharedCacheMode(cType);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit pu30) {
+ pu30.setSharedCacheMode(cType);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit pu22) {
+ pu22.setSharedCacheMode(cType);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit pu21) {
+ pu21.setSharedCacheMode(cType);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit pu20) {
+ pu20.setSharedCacheMode(cType);
}
} else if(!"".equals(vMode)) {
- if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) persistenceUnit).setValidationMode(vMode);
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) persistenceUnit).setValidationMode(vMode);
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) persistenceUnit).setValidationMode(vMode);
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) persistenceUnit).setValidationMode(vMode);
- } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) persistenceUnit).setValidationMode(vMode);
- } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {
- ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) persistenceUnit).setValidationMode(vMode);
+ if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit pu40) {
+ pu40.setValidationMode(vMode);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit pu32) {
+ pu32.setValidationMode(vMode);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit pu31) {
+ pu31.setValidationMode(vMode);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit pu30) {
+ pu30.setValidationMode(vMode);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit pu22) {
+ pu22.setValidationMode(vMode);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit pu21) {
+ pu21.setValidationMode(vMode);
+ } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit pu20) {
+ pu20.setValidationMode(vMode);
}
}
ProviderUtil.normalizeIfPossible(project, persistenceUnit);
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/Util.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/Util.java
index 01f71945a303..08c6354f47a8 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/Util.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/Util.java
@@ -80,7 +80,8 @@ public static ArrayList getAvailPropNames(Persistence persistence, Provi
}
}
}
- if(Persistence.VERSION_3_2.equals(persistence.getVersion())
+ if(Persistence.VERSION_4_0.equals(persistence.getVersion())
+ || Persistence.VERSION_3_2.equals(persistence.getVersion())
|| Persistence.VERSION_3_1.equals(persistence.getVersion())
|| Persistence.VERSION_3_0.equals(persistence.getVersion())) {
availProps.replaceAll(s -> s.replace(PersistenceUnit.JAVAX_NAMESPACE, PersistenceUnit.JAKARTA_NAMESPACE));
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/PersistenceProviderComboboxHelper.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/PersistenceProviderComboboxHelper.java
index 5b7f1d219fda..577ab08a805e 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/PersistenceProviderComboboxHelper.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/PersistenceProviderComboboxHelper.java
@@ -181,7 +181,8 @@ private void initCombo(JComboBox providerCombo) {
|| Util.isJPAVersionSupported(project, Persistence.VERSION_2_2)
|| Util.isJPAVersionSupported(project, Persistence.VERSION_3_0)
|| Util.isJPAVersionSupported(project, Persistence.VERSION_3_1)
- || Util.isJPAVersionSupported(project, Persistence.VERSION_3_2))
+ || Util.isJPAVersionSupported(project, Persistence.VERSION_3_2)
+ || Util.isJPAVersionSupported(project, Persistence.VERSION_4_0))
&& (defProviderVersion == null || defProviderVersion.equals(Persistence.VERSION_1_0));//jpa 3.1 is supported by default (or first) is jpa1.0 or udefined version provider
if(specialCase){
for (int i = 1; i new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit();
+ case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
+ case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
+ case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
+ case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
+ case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
+ default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
+ };
if (isContainerManaged) {
PersistenceUnitWizardPanelDS puPanel = (PersistenceUnitWizardPanelDS) panel;
if (puPanel.getDatasource() != null && !"".equals(puPanel.getDatasource().trim())) {
@@ -482,21 +482,19 @@ public static PersistenceUnit buildPersistenceUnitUsingData(Project project, Str
}
}
PersistenceUnit punit = null;
- if (Persistence.VERSION_3_2.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
- } else if (Persistence.VERSION_3_1.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- } else if (Persistence.VERSION_3_0.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
- } else if (Persistence.VERSION_2_2.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
- } else if (Persistence.VERSION_2_1.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
- } else if (Persistence.VERSION_2_0.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
- } else {//currently default 1.0
+ if (null == version) {
+ //currently default 1.0
punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
- }
+ } else punit = switch (version) {
+ case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit();
+ case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
+ case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
+ case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
+ case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
+ case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
+ default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
+ };
if (isContainerManaged) {
if (preselectedDB == null || preselectedDB.trim().isEmpty()) {
//find first with default/sample part in name
@@ -601,7 +599,9 @@ public static boolean createPersistenceUnitUsingWizard(Project project,
return false;
}
String version = Persistence.VERSION_1_0;
- if(punit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
+ if(punit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) {
+ version = Persistence.VERSION_4_0;
+ } else if(punit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {
version = Persistence.VERSION_3_2;
} else if(punit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {
version = Persistence.VERSION_3_1;
@@ -744,7 +744,8 @@ public static void addLibraryToProject(Project project, Library library, String
public static void addPersistenceUnitToProject(Project project) {
if(PersistenceUtils.getJPAVersion(project) == null){
Library lib;
- if(isJPAVersionSupported(project, Persistence.VERSION_3_2)
+ if(isJPAVersionSupported(project, Persistence.VERSION_4_0)
+ || isJPAVersionSupported(project, Persistence.VERSION_3_2)
|| isJPAVersionSupported(project, Persistence.VERSION_3_1)
|| isJPAVersionSupported(project, Persistence.VERSION_3_0)
|| isJPAVersionSupported(project, Persistence.VERSION_2_2)
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/unit/PersistenceUnitWizard.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/unit/PersistenceUnitWizard.java
index da9832e229f3..e9d17ba820fe 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/unit/PersistenceUnitWizard.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/unit/PersistenceUnitWizard.java
@@ -129,11 +129,9 @@ public Set instantiate() throws java.io.IOException {
@Override
public Set instantiate(ProgressHandle handle) throws IOException {
- try {
+ try (handle) {
handle.start();
return instantiateWProgress(handle);
- } finally {
- handle.finish();
}
}
@@ -212,21 +210,19 @@ private Set instantiateWProgress(ProgressHandle handle) throws IOException {
//
if (descriptor.isContainerManaged()) {
LOG.fine("Creating a container managed PU");
- if(Persistence.VERSION_3_2.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
- } else if(Persistence.VERSION_3_1.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- } else if(Persistence.VERSION_3_0.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
- } else if(Persistence.VERSION_2_2.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
- } else if(Persistence.VERSION_2_1.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
- } else if(Persistence.VERSION_2_0.equals(version)) {
- punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
- } else {//currently default 1.0
+ if(null == version) {
+ //currently default 1.0
punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
- }
+ } else punit = switch (version) {
+ case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit();
+ case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
+ case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
+ case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
+ case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
+ case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
+ default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
+ };
if (descriptor.getDatasource() != null && !"".equals(descriptor.getDatasource())){
if (descriptor.isJTA()) {
punit.setJtaDataSource(descriptor.getDatasource());
diff --git a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtilTest.java b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtilTest.java
index 6dba6d6419da..6029b3d0d5cd 100644
--- a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtilTest.java
+++ b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtilTest.java
@@ -44,6 +44,7 @@ public class ProviderUtilTest extends NbTestCase {
private PersistenceUnit persistenceUnit5;
private PersistenceUnit persistenceUnit6;
private PersistenceUnit persistenceUnit7;
+ private PersistenceUnit persistenceUnit8;
public ProviderUtilTest(String testName) {
super(testName);
@@ -58,6 +59,7 @@ protected void setUp() throws Exception {
this.persistenceUnit5 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
this.persistenceUnit6 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
this.persistenceUnit7 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
+ this.persistenceUnit8 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit();
}
@Override
@@ -285,6 +287,20 @@ public void testSetProvider7(){
assertPropertyExists(persistenceUnit7, provider.getJdbcUrl());
assertPropertyExists(persistenceUnit7, provider.getJdbcUsername());
}
+
+ public void testGetProvider8() {
+ persistenceUnit8.setProvider(ProviderUtil.ECLIPSELINK_PROVIDER4_0.getProviderClass());
+ assertEquals(ProviderUtil.ECLIPSELINK_PROVIDER4_0, ProviderUtil.getProvider(persistenceUnit8));
+ }
+
+ public void testSetProvider8(){
+ Provider provider = ProviderUtil.ECLIPSELINK_PROVIDER4_0;
+ ProviderUtil.setProvider(persistenceUnit8, provider, getConnection(), Provider.TABLE_GENERATTION_UNKOWN);
+ assertEquals(provider.getProviderClass(), persistenceUnit8.getProvider());
+ assertPropertyExists(persistenceUnit8, provider.getJdbcDriver());
+ assertPropertyExists(persistenceUnit8, provider.getJdbcUrl());
+ assertPropertyExists(persistenceUnit8, provider.getJdbcUsername());
+ }
/**
* Tests that changing of provider preserves existing
diff --git a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitDataObjectTest.java b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitDataObjectTest.java
index b4523e30af64..70e0f48460ca 100644
--- a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitDataObjectTest.java
+++ b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitDataObjectTest.java
@@ -42,23 +42,19 @@ public void testAddPersistenceUnit() throws Exception{
String version=dataObject.getPersistence().getVersion();
PersistenceUnit persistenceUnit = null;
- if(Persistence.VERSION_3_2.equals(version)) {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
- } else if(Persistence.VERSION_3_1.equals(version)) {
+ if(null == version) {
persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- } else if(Persistence.VERSION_3_0.equals(version)) {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
- } else if(Persistence.VERSION_2_2.equals(version)) {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
- } else if(Persistence.VERSION_2_1.equals(version)) {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
- } else if(Persistence.VERSION_2_0.equals(version)) {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
- } else if(Persistence.VERSION_1_0.equals(version)) {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
- } else {
- persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- }
+ } else persistenceUnit = switch (version) {
+ case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit();
+ case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
+ case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
+ case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
+ case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
+ case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
+ case Persistence.VERSION_1_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
+ default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ };
persistenceUnit.setName("em3");
persistenceUnit.setJtaDataSource("jdbc/__default");
diff --git a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceValidatorTest.java b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceValidatorTest.java
index 820a81a227f1..820bc290f10e 100644
--- a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceValidatorTest.java
+++ b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceValidatorTest.java
@@ -45,43 +45,35 @@ protected void setUp() throws Exception {
public void testValidateNameIsUnique() {
String version=dataObject.getPersistence().getVersion();
PersistenceUnit unit1 = null;
- if(Persistence.VERSION_3_2.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
- } else if(Persistence.VERSION_3_1.equals(version)) {
+ if(null == version) {
unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- } else if(Persistence.VERSION_3_0.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
- } else if(Persistence.VERSION_2_2.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
- } else if(Persistence.VERSION_2_1.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
- } else if(Persistence.VERSION_2_0.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
- } else if(Persistence.VERSION_1_0.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
- } else {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- }
+ } else unit1 = switch (version) {
+ case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit();
+ case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
+ case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
+ case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
+ case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
+ case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
+ case Persistence.VERSION_1_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
+ default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ };
unit1.setName("name1");
dataObject.addPersistenceUnit(unit1);
PersistenceUnit unit2 = null;
- if(Persistence.VERSION_3_2.equals(version)) {
- unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
- } else if(Persistence.VERSION_3_1.equals(version)) {
+ if(null == version) {
unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- } else if(Persistence.VERSION_3_0.equals(version)) {
- unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
- } else if(Persistence.VERSION_2_2.equals(version)) {
- unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
- } else if(Persistence.VERSION_2_1.equals(version)) {
- unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
- } else if(Persistence.VERSION_2_0.equals(version)) {
- unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
- } else if(Persistence.VERSION_1_0.equals(version)) {
- unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
- } else {
- unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- }
+ } else unit2 = switch (version) {
+ case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit();
+ case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
+ case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
+ case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
+ case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
+ case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
+ case Persistence.VERSION_1_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
+ default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ };
unit2.setName("name1");
dataObject.addPersistenceUnit(unit2);
PersistenceValidator validator = new PersistenceValidatorImpl(dataObject, false);
@@ -101,23 +93,19 @@ public void testValidateExcludeUnlistedClasses(){
PersistenceValidator javaSEvalidator = new PersistenceValidatorImpl(dataObject, true);
String version=dataObject.getPersistence().getVersion();
PersistenceUnit unit1 = null;
- if(Persistence.VERSION_3_2.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
- } else if(Persistence.VERSION_3_1.equals(version)) {
+ if(null == version) {
unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- } else if(Persistence.VERSION_3_0.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
- } else if(Persistence.VERSION_2_2.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
- } else if(Persistence.VERSION_2_1.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
- } else if(Persistence.VERSION_2_0.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
- } else if(Persistence.VERSION_1_0.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
- } else {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- }
+ } else unit1 = switch (version) {
+ case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit();
+ case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
+ case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
+ case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
+ case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
+ case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
+ case Persistence.VERSION_1_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
+ default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ };
unit1.setName("unit1");
unit1.setExcludeUnlistedClasses(true);
dataObject.addPersistenceUnit(unit1);
@@ -139,23 +127,19 @@ public void testValidateJarFiles(){
PersistenceValidator javaSEvalidator = new PersistenceValidatorImpl(dataObject, true);
String version=dataObject.getPersistence().getVersion();
PersistenceUnit unit1 = null;
- if(Persistence.VERSION_3_2.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
- } else if(Persistence.VERSION_3_1.equals(version)) {
+ if(null == version) {
unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- } else if(Persistence.VERSION_3_0.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
- } else if(Persistence.VERSION_2_2.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
- } else if(Persistence.VERSION_2_1.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
- } else if(Persistence.VERSION_2_0.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
- } else if(Persistence.VERSION_1_0.equals(version)) {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
- } else {
- unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
- }
+ } else unit1 = switch (version) {
+ case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit();
+ case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit();
+ case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit();
+ case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit();
+ case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit();
+ case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit();
+ case Persistence.VERSION_1_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit();
+ default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit();
+ };
unit1.setName("unit1");
unit1.addJarFile("my-jar.jar");
dataObject.addPersistenceUnit(unit1);
diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps
index 12e962c4c826..ebf8b9d31e0d 100644
--- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps
+++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps
@@ -102,6 +102,7 @@ ide/db.metadata.model/external/mysql-connector-j-8.0.31.jar ide/db.mysql/externa
# Jakarta EE API doc is repackaged to align with old NetBeans format, embedded indexes are thus identically and can be ignored.
enterprise/jakartaee10.platform/external/generated-jakarta.jakartaee-api-10.0.0-javadoc.jar enterprise/jakartaee10.platform/external/jakarta.jakartaee-api-10.0.0-javadoc.jar
enterprise/jakartaee11.platform/external/generated-jakarta.jakartaee-api-11.0.0-javadoc.jar enterprise/jakartaee11.platform/external/jakarta.jakartaee-api-11.0.0-javadoc.jar
+enterprise/jakartaee12.platform/external/generated-jakarta.jakartaee-api-12.0.0-javadoc.jar enterprise/jakartaee12.platform/external/jakarta.jakartaee-api-12.0.0-javadoc.jar
# Jakarta Servlet API is used by both servletjspapi and websvc.restlib
enterprise/servletjspapi/external/jakarta.servlet-api-4.0.4.jar enterprise/websvc.restlib/external/jakarta.servlet-api-4.0.4.jar
diff --git a/nbbuild/cluster.properties b/nbbuild/cluster.properties
index bbd52bc8c877..96255e931011 100644
--- a/nbbuild/cluster.properties
+++ b/nbbuild/cluster.properties
@@ -758,6 +758,8 @@ nb.cluster.enterprise=\
jakartaee10.platform,\
jakartaee11.api,\
jakartaee11.platform,\
+ jakartaee12.api,\
+ jakartaee12.platform,\
jakartaee8.api,\
jakartaee8.platform,\
jakartaee9.api,\
diff --git a/nbbuild/rat-exclusions.txt b/nbbuild/rat-exclusions.txt
index 113d0a947505..909e5bd7e2e9 100644
--- a/nbbuild/rat-exclusions.txt
+++ b/nbbuild/rat-exclusions.txt
@@ -35,6 +35,7 @@ enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/application/model_8/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/application/model_9/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/application/model_10/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/application/model_11/*
+enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/application/model_12/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_1_4/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_5_0/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_6_0/*
@@ -43,11 +44,13 @@ enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_8_0/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_9_0/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_10_0/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_11_0/*
+enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_12_0/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_2_1/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_3_0/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_3_1/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_3_2/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_4_0/*
+enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_4_1/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_2_4/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_2_5/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_3_0/*
@@ -56,12 +59,14 @@ enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_4_0/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_5_0/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_0/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_1/*
+enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_2/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_3_0_frag/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_3_1_frag/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_4_0_frag/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_5_0_frag/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_0_frag/*
enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_1_frag/*
+enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_2_frag/*
extide/gradle/netbeans-gradle-tooling/.gradle/**
profiler/lib.profiler/release/BUILDINFO.txt
webcommon/javascript2.jquery/external/jquery-api.xml