diff options
author | cbridgha | 2007-09-05 01:54:41 +0000 |
---|---|---|
committer | cbridgha | 2007-09-05 01:54:41 +0000 |
commit | f57f13b30eaf33ac1e145021c50ec2f62aba465c (patch) | |
tree | ff483c344b2836210bd551185d5455631512195b /plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal | |
parent | a8959cb8b1660fc6c53759d92c621c98ccf5fccf (diff) | |
download | webtools.javaee-200708050923.tar.gz webtools.javaee-200708050923.tar.xz webtools.javaee-200708050923.zip |
This commit was manufactured by cvs2svn to create tag 'v200708050923'.v200708050923
Diffstat (limited to 'plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal')
75 files changed, 0 insertions, 8598 deletions
diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/DefaultEJBModelExtenderProvider.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/DefaultEJBModelExtenderProvider.java deleted file mode 100644 index f921460a5..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/DefaultEJBModelExtenderProvider.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Nov 25, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal; - -/** - * @author mdelder - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class DefaultEJBModelExtenderProvider implements IEJBModelExtenderProvider { - - /** - * - */ - public DefaultEJBModelExtenderProvider() { - super(); - - } - - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.core.moduleextension.helper.IEJBModelExtenderProvider#getEJBModuleExtension(java.lang.Object) - */ - public EjbModuleExtensionHelper getEJBModuleExtension(Object context) { - return null; - } - - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.core.moduleextension.helper.IEJBModelExtenderProvider#hasEJBModuleExtension(java.lang.Object) - */ - public boolean hasEJBModuleExtension(Object context) { - return getEJBModuleExtension(context) != null; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/EJBModelExtenderManager.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/EJBModelExtenderManager.java deleted file mode 100644 index 616e889ee..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/EJBModelExtenderManager.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Sep 19, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal; - - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class EJBModelExtenderManager implements IEJBModelExtenderManager { - - private IEJBModelExtenderProvider provider = new DefaultEJBModelExtenderProvider(); - - /** - * @deprecated Should use IEJBModelExtenderManager.INSTANCE.getEJBModuleExtension(null); - */ - public static EjbModuleExtensionHelper getEJBModuleExtension() { - return IEJBModelExtenderManager.INSTANCE.getEJBModuleExtension(null); - } - - public EjbModuleExtensionHelper getEJBModuleExtension(Object context) { - return provider.getEJBModuleExtension(context); - } - - public boolean hasEJBModuleExtension(Object context) { - return getEJBModuleExtension(context) != null; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.core.moduleextension.helper.IEJBModelExtenderManager#setProvider(org.eclipse.jst.j2ee.internal.core.moduleextension.helper.IEJBModelExtenderProvider) - */ - public void setProvider(IEJBModelExtenderProvider provider) { - this.provider = provider; - } - - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.core.moduleextension.helper.IEJBModelExtenderManager#isProviderSet() - */ - public boolean isProviderSet() { - return !(this.provider instanceof DefaultEJBModelExtenderProvider); - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/EjbModuleExtensionHelper.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/EjbModuleExtensionHelper.java deleted file mode 100644 index 0002f56eb..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/EjbModuleExtensionHelper.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Sep 19, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal; - -import java.util.List; - -import org.eclipse.jst.j2ee.ejb.ContainerManagedEntity; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.jst.j2ee.ejb.EnterpriseBean; - - - -/** - * This is a helper used for deriving the JNDI name of enterprise beans, - * and for inheritance support. The helper can be plugged in by application - * server vendors. - */ - -public interface EjbModuleExtensionHelper extends J2EEModuleExtensionHelper { - List getSubtypes(EnterpriseBean anEJB); - EnterpriseBean getSuperType(EnterpriseBean anEJB); - List getRoleMethodNamesExtended(ContainerManagedEntity cmp); - String getEJBInheritanceFileName(); - String getJNDIName(EJBJar jar, EnterpriseBean bean); - List getRelationships_cmp11(EJBJar jar); - List getLocalRelationshipRoles_cmp11(ContainerManagedEntity cmp); - boolean isEJBInheritanceSupported(); -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/ExceptionHelper.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/ExceptionHelper.java deleted file mode 100644 index cdd7d065d..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/ExceptionHelper.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal; - - - -import java.util.ArrayList; -import java.util.List; -/** - * Utility class to factor common code for implementers of IWrappedException - */ -public class ExceptionHelper { -/** - * Utility class; cannot be instantiated - */ -private ExceptionHelper() { - super(); -} -/** - * Return the messages from @exception and all nested exceptions, in order from outermost to innermost - */ -public static java.lang.String[] getAllMessages(IWrappedException exception) { - List messages = new ArrayList(4); - messages.add(exception.getMessage()); - Exception nested = exception.getNestedException(); - while (nested != null) { - messages.add(nested.getMessage()); - if (nested instanceof IWrappedException) - nested = ((IWrappedException)nested).getNestedException(); - else - nested = null; - } - return (String[])messages.toArray(new String[messages.size()]); -} -/** - * Return the messages from @exception and all nested exceptions, in order from outermost to innermost, - * concatenated as one - */ -public static String getConcatenatedMessages(IWrappedException exception) { - String[] messages = getAllMessages(exception); - StringBuffer sb = new StringBuffer(256); - for (int i = 0; i < messages.length; i++){ - sb.append(messages[i]); - if (i < messages.length-1) - sb.append('\n'); - } - return sb.toString(); -} -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/IEJBModelExtenderManager.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/IEJBModelExtenderManager.java deleted file mode 100644 index f72b2f95b..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/IEJBModelExtenderManager.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal; - -/** - * The IEJBModelExtenderManager replaces the former J2EEModuleExtensionManager and acts - * as a facade for a single IEJBModelExtenderProvider. The IEJBModelExtenderProvider will - * provide the correct extension helper based on a given context (@see IEJBModelExtenderProvider). - * - * @author mdelder - * - */ -public interface IEJBModelExtenderManager extends IEJBModelExtenderProvider { - - IEJBModelExtenderManager INSTANCE = new EJBModelExtenderManager(); - - /** - * - * @return true if the provider for which the manager is a facade has been set - */ - boolean isProviderSet(); - - /** - * - * @param provider the manager will act as a facade to the given provider - */ - void setProvider(IEJBModelExtenderProvider provider); - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/IEJBModelExtenderProvider.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/IEJBModelExtenderProvider.java deleted file mode 100644 index 28f285bfc..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/IEJBModelExtenderProvider.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Nov 25, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal; - -/** - * @author mdelder - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface IEJBModelExtenderProvider { - - /** - * - * @param context a supplied object to determine the context (e.g. IProject if available) - * @return the appropriate EjbModuleExtensionHelper or <b>null</b> if none exists - */ - EjbModuleExtensionHelper getEJBModuleExtension(Object context); - - /** - * - * @param context a supplied object to determine the context (e.g. IProject if available) - * @return true if the given context has an extension - */ - boolean hasEJBModuleExtension(Object context); - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/IWrappedException.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/IWrappedException.java deleted file mode 100644 index cce0218be..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/IWrappedException.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal; - - - -/** - * Common interface for WrappedRuntime and Wrapped exceptions, which can contain nested exceptions - */ -public interface IWrappedException { -/** - * Return the messages from this and all nested exceptions, in order from outermost to innermost - */ -public String[] getAllMessages(); -/** - * Return the messages from this and all nested exceptions, in order from outermost to innermost, - * concatenated as one - */ -public String getConcatenatedMessages(); -public String getMessage(); -public java.lang.Exception getNestedException(); -public void printStackTrace(); -public void printStackTrace(java.io.PrintStream s); -public void printStackTrace(java.io.PrintWriter s); -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java deleted file mode 100644 index 9b1da226a..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java +++ /dev/null @@ -1,189 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal; - -import org.eclipse.emf.common.util.URI; - - - -/** - * This is a catalog of useful constants for the archive support. Can be used to - * store relative paths to specific xml and xmi resources. - */ -public interface J2EEConstants extends J2EEVersionConstants { - //Standard Jar info - /** "META-INF/MANIFEST.MF" */ - String MANIFEST_URI = "META-INF/MANIFEST.MF"; //$NON-NLS-1$ - URI MANIFEST_URI_OBJ = URI.createURI(MANIFEST_URI); - String MANIFEST_SHORT_NAME = "MANIFEST.MF"; //$NON-NLS-1$ - - /** "META-INF" */ - String META_INF = "META-INF"; //$NON-NLS-1$ - /** "WEB-INF" */ - String WEB_INF = "WEB-INF"; //$NON-NLS-1$ - String WEB_INF_CLASSES = "WEB-INF/classes"; //$NON-NLS-1$ - String WEB_INF_LIB = "WEB-INF/lib"; //$NON-NLS-1$ - /** "ALT-INF" */ - String ALT_INF = "ALT-INF"; //$NON-NLS-1$ - //Application client info - /** "Application-client_ID" */ - String APP_CLIENT_ID = "Application-client_ID"; //$NON-NLS-1$ - /** "META-INF/application-client.xml" */ - String APP_CLIENT_DD_URI = "META-INF/application-client.xml"; //$NON-NLS-1$ - URI APP_CLIENT_DD_URI_OBJ = URI.createURI(APP_CLIENT_DD_URI); - /** "application-client.xml" */ - String APP_CLIENT_DD_SHORT_NAME = "application-client.xml"; //$NON-NLS-1$ - /** Doc type for app client deployment descriptors */ - String APP_CLIENT_DOCTYPE = "application-client"; //$NON-NLS-1$ - String APP_CLIENT_PUBLICID_1_2 = "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.2//EN"; //$NON-NLS-1$ - String APP_CLIENT_PUBLICID_1_3 = "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN"; //$NON-NLS-1$ - String APP_CLIENT_SYSTEMID_1_2 = "http://java.sun.com/j2ee/dtds/application-client_1_2.dtd"; //$NON-NLS-1$ - String APP_CLIENT_ALT_SYSTEMID_1_2 = "http://java.sun.com/j2ee/dtds/application-client_1.2.dtd"; //$NON-NLS-1$ - String APP_CLIENT_SYSTEMID_1_3 = "http://java.sun.com/dtd/application-client_1_3.dtd"; //$NON-NLS-1$ - String APP_CLIENT_ALT_SYSTEMID_1_3 = "http://java.sun.com/dtd/application-client_1.3.dtd"; //$NON-NLS-1$ - String APP_CLIENT_SCHEMA_1_4 = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd";//$NON-NLS-1$ - String APP_CLIENT_SCHEMA_5 = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application-client_5.xsd"; //$NON-NLS-1$ // EJB3 - - //Application constants - /** "Application_ID" */ - String APPL_ID = "Application_ID"; //$NON-NLS-1$ - /** "META-INF/application.xml" */ - String APPLICATION_DD_URI = "META-INF/application.xml"; //$NON-NLS-1$ - URI APPLICATION_DD_URI_OBJ = URI.createURI(APPLICATION_DD_URI); - /** "application.xml" */ - String APPLICATION_DD_SHORT_NAME = "application.xml"; //$NON-NLS-1$ - String EAR_FILE_EXT = ".ear"; ////$NON-NLS-1$ - /** Doc type for application deployment descriptors */ - String APPLICATION_DOCTYPE = "application"; //$NON-NLS-1$ - String APPLICATION_PUBLICID_1_2 = "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN"; //$NON-NLS-1$ - String APPLICATION_PUBLICID_1_3 = "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"; //$NON-NLS-1$ - String APPLICATION_PUBLICID_1_4 = "-//Sun Microsystems, Inc.//DTD J2EE Application 1.4//EN"; //$NON-NLS-1$ - String APPLICATION_SYSTEMID_1_2 = "http://java.sun.com/j2ee/dtds/application_1_2.dtd"; //$NON-NLS-1$ - String APPLICATION_ALT_SYSTEMID_1_2 = "http://java.sun.com/j2ee/dtds/application_1.2.dtd"; //$NON-NLS-1$ - String APPLICATION_SYSTEMID_1_3 = "http://java.sun.com/dtd/application_1_3.dtd"; //$NON-NLS-1$ - String APPLICATION_ALT_SYSTEMID_1_3 = "http://java.sun.com/dtd/application_1.3.dtd"; //$NON-NLS-1$ - String APPLICATION_SYSTEMID_1_4 = "http://java.sun.com/dtd/application_1_4.dtd"; //$NON-NLS-1$ - String APPLICATION_ALT_SYSTEMID_1_4 = "http://java.sun.com/dtd/application_1_4.dtd"; //$NON-NLS-1$ - String APPLICATION_SCHEMA_1_4 = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd";//$NON-NLS-1$ - String APPLICATION_SCHEMA_5 = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"; //$NON-NLS-1$ // EJB3 - - //EJB Jar Constants - /** "ejb-jar_ID" */ - String EJBJAR_ID = "ejb-jar_ID"; //$NON-NLS-1$ - /** "AssemblyDescriptor_ID" */ - String ASSEMBLYDESCRIPTOR_ID = "AssemblyDescriptor_ID"; //$NON-NLS-1$ - /** "ejb-jar.xml" */ - String EJBJAR_DD_SHORT_NAME = "ejb-jar.xml"; //$NON-NLS-1$ - /** "META-INF/ejb-jar.xml" */ - String EJBJAR_DD_URI = "META-INF/ejb-jar.xml"; //$NON-NLS-1$ - URI EJBJAR_DD_URI_OBJ = URI.createURI(EJBJAR_DD_URI); - /** "META-INF/ibm-ejb-jar-bnd.xmi" */ - String EJBJAR_DOCTYPE = "ejb-jar"; //$NON-NLS-1$ - String EJBJAR_PUBLICID_1_1 = "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"; //$NON-NLS-1$ - String EJBJAR_PUBLICID_2_0 = "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"; //$NON-NLS-1$ - String EJBJAR_SYSTEMID_1_1 = "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd"; //$NON-NLS-1$ - String EJBJAR_ALT_SYSTEMID_1_1 = "http://java.sun.com/j2ee/dtds/ejb-jar_1.1.dtd"; //$NON-NLS-1$ - String EJBJAR_SYSTEMID_2_0 = "http://java.sun.com/dtd/ejb-jar_2_0.dtd"; //$NON-NLS-1$ - String EJBJAR_ALT_SYSTEMID_2_0 = "http://java.sun.com/dtd/ejb-jar_2.0.dtd"; //$NON-NLS-1$ - String EJBJAR_SCHEMA_2_1 = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd";//$NON-NLS-1$ - String EJBJAR_SCHEMA_2_1_NS = "http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd";//$NON-NLS-1$ - String EJBJAR_SCHEMA_3_0 = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"; //$NON-NLS-1$ // EJB3 - String EJBJAR_SCHEMA_3_0_NS = "http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"; //$NON-NLS-1$ // EJB3 - - //Web app Constants - /** "WebApp_ID" */ - String WEBAPP_ID = "WebApp_ID"; //$NON-NLS-1$ - /** "WEB-INF/web.xml" */ - String WEBAPP_DD_URI = "WEB-INF/web.xml"; //$NON-NLS-1$ - URI WEBAPP_DD_URI_OBJ = URI.createURI(WEBAPP_DD_URI); - /** "web.xml" */ - String WEBAPP_DD_SHORT_NAME = "web.xml"; //$NON-NLS-1$ - /** "WEB-INF/ibm-web-bnd.xmi" */ - /** Doc type for web app deployment descriptors */ - String WEBAPP_DOCTYPE = "web-app"; //$NON-NLS-1$ - String CONTEXTROOT = "context-root"; //$NON-NLS-1$ - String WEBAPP_PUBLICID_2_2 = "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"; //$NON-NLS-1$ - String WEBAPP_PUBLICID_2_3 = "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"; //$NON-NLS-1$ - String WEBAPP_SYSTEMID_2_2 = "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"; //$NON-NLS-1$ - String WEBAPP_ALT_SYSTEMID_2_2 = "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd"; //$NON-NLS-1$ - String WEBAPP_SYSTEMID_2_3 = "http://java.sun.com/dtd/web-app_2_3.dtd"; //$NON-NLS-1$ - String WEBAPP_ALT_SYSTEMID_2_3 = "http://java.sun.com/dtd/web-app_2.3.dtd"; //$NON-NLS-1$ - String WEBAPP_SCHEMA_2_4 = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";//$NON-NLS-1$ - String WEBAPP_SCHEMA_2_5 = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";//$NON-NLS-1$ - //J2C Resource Adapter Constants - /** "J2CResourceAdapter_ID" */ - String RAR_ID = "J2CResourceAdapter_ID"; //$NON-NLS-1$ - /** "META-INF/ra.xml" */ - String RAR_DD_URI = "META-INF/ra.xml"; //$NON-NLS-1$ - URI RAR_DD_URI_OBJ = URI.createURI(RAR_DD_URI); - String RAR_SHORT_NAME = "ra.xml"; //$NON-NLS-1$ - //Need connector constant. - String CONNECTOR_ID = "Connector_ID"; //$NON-NLS-1$ - /** Doc type for connector deployment descriptors */ - String CONNECTOR_DOCTYPE = "connector"; //$NON-NLS-1$ - String CONNECTOR_PUBLICID_1_0 = "-//Sun Microsystems, Inc.//DTD Connector 1.0//EN"; //$NON-NLS-1$ - String CONNECTOR_SYSTEMID_1_0 = "http://java.sun.com/dtd/connector_1_0.dtd"; //$NON-NLS-1$ - String CONNECTOR_ALT_SYSTEMID_1_0 = "http://java.sun.com/dtd/connector_1.0.dtd"; //$NON-NLS-1$ - String CONNECTOR_SCHEMA_1_5 = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd";//$NON-NLS-1$ - - //Web Services Constants - /** Doc type for webservices deployment descriptors */ - String WEB_SERVICES_CLIENT_DOCTYPE = "webservicesclient"; //$NON-NLS-1$ - String WEB_SERVICES_CLIENT_PUBLICID_1_0 = "-//IBM Corporation, Inc.//DTD J2EE Web services client 1.0//EN"; //$NON-NLS-1$ - String WEB_SERVICES_CLIENT_SYSTEMID_1_0 = "http://www.ibm.com/webservices/dtd/j2ee_web_services_client_1_0.dtd"; //$NON-NLS-1$ - String WEB_SERVICES_CLIENT_LOC_1_1 = "http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd"; //$NON-NLS-1$ - String WEB_SERVICES_CLIENT_SHORTNAME = "webservicesclient.xml"; //$NON-NLS-1$ - String WEB_SERVICES_CLIENT_DD_URI = "webservicesclient.xml"; //$NON-NLS-1$ - String WEB_SERVICES_CLIENT_META_INF_DD_URI = "META-INF/webservicesclient.xml"; //$NON-NLS-1$ - String WEB_SERVICES_CLIENT_WEB_INF_DD_URI = "WEB-INF/webservicesclient.xml"; //$NON-NLS-1$ - URI WEB_SERVICES_CLIENT_DD_URI_OBJ = URI.createURI(WEB_SERVICES_CLIENT_DD_URI); - URI WEB_SERVICES_CLIENT_META_INF_DD_URI_OBJ = URI.createURI(WEB_SERVICES_CLIENT_META_INF_DD_URI); - URI WEB_SERVICES_CLIENT_WEB_INF_DD_URI_OBJ = URI.createURI(WEB_SERVICES_CLIENT_WEB_INF_DD_URI); - - String WEB_SERVICES_DD_URI = "webservices.xml"; //$NON-NLS-1$ - String WEB_SERVICES_META_INF_DD_URI = "META-INF/webservices.xml"; //$NON-NLS-1$ - String WEB_SERVICES_WEB_INF_DD_URI = "WEB-INF/webservices.xml"; //$NON-NLS-1$ - URI WEB_SERVICES_DD_URI_OBJ = URI.createURI(WEB_SERVICES_DD_URI); - URI WEB_SERVICES_META_INF_DD_URI_OBJ = URI.createURI(WEB_SERVICES_META_INF_DD_URI); - URI WEB_SERVICES_WEB_INF_DD_URI_OBJ = URI.createURI(WEB_SERVICES_WEB_INF_DD_URI); - - //Miscellaneous constants - /** "UTF-8" */ - String DEFAULT_XML_ENCODING = "UTF-8"; //$NON-NLS-1$ - /** "1.0" */ - String DEFAULT_XML_VERSION = "1.0"; //$NON-NLS-1$ - String JAVA_SUN_COM_URL = "http://java.sun.com"; //$NON-NLS-1$ - String WWW_W3_ORG_URL = "http://www.w3.org"; //$NON-NLS-1$ - String WWW_IBM_COM_URL = "http://www.ibm.com"; //$NON-NLS-1$ - - String J2EE_NS_URL = "http://java.sun.com/xml/ns/j2ee"; //$NON-NLS-1$ - String JAVAEE_NS_URL = "http://java.sun.com/xml/ns/javaee"; //$NON-NLS-1$ //EJB3 - String J2EE_1_4_XSD_SHORT_NAME = "j2ee_1_4.xsd"; //$NON-NLS-1$ - String JAVAEE_5_XSD_SHORT_NAME = "javaee_5.xsd"; //$NON-NLS-1$ //EJB3 - String XSI_NS_URL = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$ - String APPLICATION_SCHEMA_LOC_1_4 = "http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"; //$NON-NLS-1$ - String APPLICATION_SCHEMA_LOC_5 = "http://java.sun.com/xml/ns/javaee/application_5.xsd"; //$NON-NLS-1$ // EJB3 - String APP_CLIENT_SCHEMA_LOC_1_4 = "http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd"; //$NON-NLS-1$ - String APP_CLIENT_SCHEMA_LOC_5 = "http://java.sun.com/xml/ns/javaee/application-client_5.xsd"; //$NON-NLS-1$ //EJB3 - String EJB_JAR_SCHEMA_LOC_2_1 = "http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"; //$NON-NLS-1$ - String EJB_JAR_SCHEMA_LOC_3_0 = "http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"; //$NON-NLS-1$ // EJB3 - String CONNECTOR_SCHEMA_LOC_1_5 = "http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"; //$NON-NLS-1$ - String WEB_APP_SCHEMA_LOC_2_4 = "http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; //$NON-NLS-1$ - String WEB_APP_SCHEMA_LOC_2_5 = "http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; //$NON-NLS-1$ //EJB3 - String WEB_SERVICES_CLIENT_SCHEMA_LOC_1_1 = "http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd"; //$NON-NLS-1$ - String JSP_SCHEMA_LOC_2_0 = "http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd"; //$NON-NLS-1$ - String JSP_SCHEMA_LOC_2_1 = "http://java.sun.com/xml/ns/javaee/jsp_2_1.xsd"; //$NON-NLS-1$ //EJB3 - - public static final String EAR_MODEL_NAME = "EAR_VALIDATION"; //$NON-NLS-1$ -} - - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEInit.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEInit.java deleted file mode 100644 index 5cc1c5213..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEInit.java +++ /dev/null @@ -1,275 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal; - -import java.lang.reflect.Method; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jst.j2ee.application.ApplicationFactory; -import org.eclipse.jst.j2ee.application.ApplicationPackage; -import org.eclipse.jst.j2ee.application.internal.impl.ApplicationResourceFactory; -import org.eclipse.jst.j2ee.client.ClientFactory; -import org.eclipse.jst.j2ee.client.ClientPackage; -import org.eclipse.jst.j2ee.client.internal.impl.ApplicationClientResourceFactory; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.internal.impl.J2EEResourceFactoryRegistry; -import org.eclipse.jst.j2ee.ejb.EjbFactory; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.ejb.internal.impl.EJBJarResourceFactory; -import org.eclipse.jst.j2ee.ejb.internal.impl.EjbFactoryImpl; -import org.eclipse.jst.j2ee.ejb.internal.util.EJBAttributeMaintenanceFactoryImpl; -import org.eclipse.jst.j2ee.internal.common.J2EEXMIResourceFactory; -import org.eclipse.jst.j2ee.internal.xml.J2EEXmlDtDEntityResolver; -import org.eclipse.jst.j2ee.jca.JcaFactory; -import org.eclipse.jst.j2ee.jca.JcaPackage; -import org.eclipse.jst.j2ee.jca.internal.impl.ConnectorResourceFactory; -import org.eclipse.jst.j2ee.jsp.JspFactory; -import org.eclipse.jst.j2ee.jsp.JspPackage; -import org.eclipse.jst.j2ee.taglib.internal.TaglibFactory; -import org.eclipse.jst.j2ee.taglib.internal.TaglibPackage; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; -import org.eclipse.jst.j2ee.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.internal.impl.WebAppResourceFactory; -import org.eclipse.jst.j2ee.webservice.internal.wsdd.WsddResourceFactory; -import org.eclipse.jst.j2ee.webservice.jaxrpcmap.JaxrpcmapFactory; -import org.eclipse.jst.j2ee.webservice.jaxrpcmap.JaxrpcmapPackage; -import org.eclipse.jst.j2ee.webservice.jaxrpcmap.JaxrpcmapResourceFactory; -import org.eclipse.jst.j2ee.webservice.wsclient.Webservice_clientFactory; -import org.eclipse.jst.j2ee.webservice.wsclient.Webservice_clientPackage; -import org.eclipse.jst.j2ee.webservice.wsclient.internal.impl.WebServicesClientResourceFactory; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonPackage; -import org.eclipse.jst.j2ee.webservice.wsdd.WsddFactory; -import org.eclipse.jst.j2ee.webservice.wsdd.WsddPackage; -import org.eclipse.wst.common.internal.emf.utilities.AdapterFactoryDescriptor; -import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities; -import org.eclipse.wst.common.internal.emf.utilities.EncoderDecoderRegistry; -import org.eclipse.wst.common.internal.emf.utilities.ExtendedEcoreUtil; -import org.eclipse.wst.common.internal.emf.utilities.PasswordEncoderDecoder; -import org.eclipse.wst.common.internal.emf.utilities.Revisit; - -/** - * Insert the type's description here. - * Creation date: (10/3/2000 3:07:37 PM) - * @author: Administrator - */ -public class J2EEInit { - - - static { - try { - if(Boolean.getBoolean("LOG_XERCES_VERSION")) { //$NON-NLS-1$ - Class clz = ClassLoader.getSystemClassLoader().loadClass("org.apache.xerces.impl.Version"); //$NON-NLS-1$ - Method main = clz.getDeclaredMethod("main", new Class[] { String[].class } ); //$NON-NLS-1$ - Object version = clz.newInstance(); - main.invoke(version, new Object[] { new String[] {} }); - System.out.println(clz.getResource("Version.class")); //$NON-NLS-1$ - } - } catch(Throwable t) { - System.out.println("Problem while logging version " + t); - t.printStackTrace(); - } - } - - protected static boolean initialized = false; - protected static boolean plugin_initialized = false; - public static void init() { - init(true); - } - - public static void init(boolean shouldPreRegisterPackages) { - if (!initialized) { - initialized = true; - setDefaultEncoderDecoder(); - DOMUtilities.setDefaultEntityResolver(J2EEXmlDtDEntityResolver.INSTANCE); - org.eclipse.jem.internal.java.init.JavaInit.init(shouldPreRegisterPackages); - if (shouldPreRegisterPackages) - preRegisterPackages(); - initResourceFactories(); - EjbFactoryImpl.internalRegisterEJBRelationAdapterFactory(new AdapterFactoryDescriptor() { - public AdapterFactory createAdapterFactory() { - return new EJBAttributeMaintenanceFactoryImpl(); - } - }); - EjbFactoryImpl.internalRegisterRelationshipsAdapterFactory(new AdapterFactoryDescriptor() { - public AdapterFactory createAdapterFactory() { - return new EJBAttributeMaintenanceFactoryImpl(); - } - }); - - } - } - - /** - * If the currently defaulted encoder is the initial pass thru encoder, - * then register a Password encoder for security; otherwise if a more sophisticated - * encoder is already registered, then do nothing. - */ - private static void setDefaultEncoderDecoder() { - EncoderDecoderRegistry reg = EncoderDecoderRegistry.getDefaultRegistry(); - if (reg.getDefaultEncoderDecoder() == EncoderDecoderRegistry.INITIAL_DEFAULT_ENCODER) { - reg.setDefaultEncoderDecoder(new PasswordEncoderDecoder()); - } - } - - private static void preRegisterPackages() { - //common - ExtendedEcoreUtil.preRegisterPackage("common.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return CommonPackage.eINSTANCE; - } - public EFactory getEFactory() { - return CommonFactory.eINSTANCE; - } - }); - //application - ExtendedEcoreUtil.preRegisterPackage("application.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return ApplicationPackage.eINSTANCE; - } - public EFactory getEFactory() { - return ApplicationFactory.eINSTANCE; - } - }); - //client - ExtendedEcoreUtil.preRegisterPackage("client.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return ClientPackage.eINSTANCE; - } - public EFactory getEFactory() { - return ClientFactory.eINSTANCE; - } - }); - //webapplication - ExtendedEcoreUtil.preRegisterPackage("webapplication.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return WebapplicationPackage.eINSTANCE; - } - public EFactory getEFactory() { - return WebapplicationFactory.eINSTANCE; - } - }); - //ejb - ExtendedEcoreUtil.preRegisterPackage("ejb.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return EjbPackage.eINSTANCE; - } - public EFactory getEFactory() { - return EjbFactory.eINSTANCE; - } - }); - //jca - ExtendedEcoreUtil.preRegisterPackage("jca.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return JcaPackage.eINSTANCE; - } - public EFactory getEFactory() { - return JcaFactory.eINSTANCE; - } - }); - //webservicesclient - ExtendedEcoreUtil.preRegisterPackage("webservice_client.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return Webservice_clientPackage.eINSTANCE; - } - public EFactory getEFactory() { - return Webservice_clientFactory.eINSTANCE; - } - }); - //webservicescommon - ExtendedEcoreUtil.preRegisterPackage("wscommon.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return WscommonPackage.eINSTANCE; - } - public EFactory getEFactory() { - return WscommonFactory.eINSTANCE; - } - }); - //webservicesdd - ExtendedEcoreUtil.preRegisterPackage("wsdd.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return WsddPackage.eINSTANCE; - } - public EFactory getEFactory() { - return WsddFactory.eINSTANCE; - } - }); - //jaxrpcmap - ExtendedEcoreUtil.preRegisterPackage("jaxrpcmap.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return JaxrpcmapPackage.eINSTANCE; - } - public EFactory getEFactory() { - return JaxrpcmapFactory.eINSTANCE; - } - }); -// jsp - ExtendedEcoreUtil.preRegisterPackage("jsp.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return JspPackage.eINSTANCE; - } - public EFactory getEFactory() { - return JspFactory.eINSTANCE; - } - }); - //taglib - ExtendedEcoreUtil.preRegisterPackage("taglib.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return TaglibPackage.eINSTANCE; - } - public EFactory getEFactory() { - return TaglibFactory.eINSTANCE; - } - }); - - } - - public static void initResourceFactories() { - //Make protected - Revisit.revisit(); - - // Only register the default factories if another set has not - // already been registered. - - Resource.Factory j2ee = J2EEResourceFactoryRegistry.INSTANCE.getFactory(J2EEConstants.EJBJAR_DD_URI_OBJ); - Resource.Factory defaultFact = J2EEResourceFactoryRegistry.INSTANCE.getFactory(URI.createURI(Resource.Factory.Registry.DEFAULT_EXTENSION)); - if (j2ee == defaultFact) { - EJBJarResourceFactory.register(); - WebAppResourceFactory.register(); - ApplicationClientResourceFactory.register(); - ApplicationResourceFactory.register(); - ConnectorResourceFactory.register(); - WebServicesClientResourceFactory.register(); - WsddResourceFactory.register(); - //register() is not called on the JaxrpcmapResourceFactory because - //the jaxprc-mapping descriptor does not have a standard short name. - //The short names have to be registered once they are known. - J2EEXMIResourceFactory.register(); - } - EJBJarResourceFactory.registerDtds(); - WebAppResourceFactory.registerDtds(); - ApplicationClientResourceFactory.registerDtds(); - ApplicationResourceFactory.registerDtds(); - ConnectorResourceFactory.registerDtds(); - WebServicesClientResourceFactory.registerDtds(); - WsddResourceFactory.registerDtds(); - JaxrpcmapResourceFactory.registerDtds(); - } - public static void setPluginInit(boolean bPluginInit) { - // Here's where the configuration file would be read. - plugin_initialized = bPluginInit; - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEModuleExtensionHelper.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEModuleExtensionHelper.java deleted file mode 100644 index 2b8b84d1c..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEModuleExtensionHelper.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Sep 19, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal; - - - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface J2EEModuleExtensionHelper { - String getDocType(); -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEMultiStatus.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEMultiStatus.java deleted file mode 100644 index 11f91db1f..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEMultiStatus.java +++ /dev/null @@ -1,114 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal; - -/** - * @author DABERG - */ -public class J2EEMultiStatus extends J2EEStatus { - private J2EEStatus[] children = new J2EEStatus[0]; - - public void add(J2EEStatus status) { - J2EEStatus[] result = - new J2EEStatus[children.length + 1]; - System.arraycopy(children, 0, result, 0, children.length); - result[result.length - 1] = status; - children = result; - int newSev = status.getSeverity(); - int currentSev = getSeverity(); - /* If all the statuses are NOT_NEEDED OR NOT_POSSIBLE, you want the combined status to be the highest severity - * however, if all but one status are NOT_NEEDED or NOT_POSSIBLE, and one status completed, then the combined status - * should be OK. If there is a warning or error, then they take precedence - */ - if (children.length == 1) - setSeverity(newSev); - else if (currentSev > COMPLETED_OK && currentSev < WARNING && newSev == COMPLETED_OK) - setSeverity(newSev); - else if (newSev > currentSev && (currentSev != COMPLETED_OK || newSev >= WARNING) ) - setSeverity(newSev); - - } - /** - * Adds all of the children of the given status to this multi-status. - * Does nothing if the given status has no children (which includes - * the case where it is not a multi-status). - * - * @param status the status whose children are to be added to this one - */ - public void addAll(J2EEStatus status) { - if (status == null) - return; - J2EEStatus[] statuses = status.getChildren(); - for (int i = 0; i < statuses.length; i++) { - add(statuses[i]); - } - } - - public J2EEStatus[] getChildren() { - return children; - } - - public boolean isMultiStatus() { - return true; - } - /** - * Merges the given status into this multi-status. - * Equivalent to <code>add(status)</code> if the - * given status is not a multi-status. - * Equivalent to <code>addAll(status)</code> if the - * given status is a multi-status. - * - * @param status the status to merge into this one - * @see #add - * @see #addAll - */ - public void merge(J2EEStatus status) { - if (status == null) - return; - if (!status.isMultiStatus()) { - add(status); - } else { - addAll(status); - } - } - /** - * Returns a string representation of the status, suitable - * for debugging purposes only. - */ - public String toString() { - StringBuffer buf = new StringBuffer(super.toString()); - buf.append(" children={"); //$NON-NLS-1$ - for (int i = 0; i < children.length; i++) { - if (i != 0) { - buf.append("\n"); //$NON-NLS-1$ - } - buf.append(children[i].toString()); - } - buf.append("}"); //$NON-NLS-1$ - return buf.toString(); - } - - /** - * @see com.ibm.ejs.models.base.extensions.helper.J2EEStatus#append(J2EEStatus) - */ - public J2EEStatus append(J2EEStatus aStatus) { - if (aStatus != null) - merge(aStatus); - return this; - } - - public boolean isEmpty() { - return children.length == 0; - } - - -} - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EESpecificationConstants.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EESpecificationConstants.java deleted file mode 100644 index 6136035ab..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EESpecificationConstants.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal; - - - -public interface J2EESpecificationConstants { - String J2EE_VERSION_1_2 = "J2EE_1.2"; //$NON-NLS-1$ - String J2EE_VERSION_1_3 = "J2EE_1.3"; //$NON-NLS-1$ - String J2EE_VERSION_1_4 = "J2EE_1.4"; //$NON-NLS-1$ - - String DEFAULT_COMPLETED_STATUS_MSG = MOFJ2EEResourceHandler.DEFAULT_COMPLETED_STATUS_MSG; - String DEFAULT_NOT_NEEDED_STATUS_MSG = MOFJ2EEResourceHandler.DEFAULT_NOT_NEEDED_STATUS_MSG; - String DEFAULT_NOT_POSSIBLE_STATUS_MSG = MOFJ2EEResourceHandler.DEFAULT_NOT_POSSIBLE_STATUS_MSG; - String DEFAULT_ERROR_STATUS_MSG = MOFJ2EEResourceHandler.DEFAULT_ERROR_STATUS_MSG; - - String REMOVED_LOCAL_CLIENT_MSG = MOFJ2EEResourceHandler.REMOVED_LOCAL_CLIENT_MSG; - String REMOVED_ACCESS_INTENTS_MSG = MOFJ2EEResourceHandler.REMOVED_ACCESS_INTENTS_MSG; - String REMOVED_ISOLATION_LEVELS_MSG = MOFJ2EEResourceHandler.REMOVED_ISOLATION_LEVELS_MSG; - String CONVERTED_FINDER_MSG = MOFJ2EEResourceHandler.CONVERTED_FINDER_MSG; - String UNNAMED_EJB = MOFJ2EEResourceHandler.UNNAMED_EJB; - String CONVERTED_QUERY_DESCRIPTION = MOFJ2EEResourceHandler.CONVERTED_QUERY_DESCRIPTION; - String MIGRATED_DEFAULT_DATASOURCE_JAR_MSG = MOFJ2EEResourceHandler.MIGRATED_DEFAULT_DATASOURCE_JAR_MSG; - String MIGRATED_DEFAULT_DATASOURCE_MSG = MOFJ2EEResourceHandler.MIGRATED_DEFAULT_DATASOURCE_MSG; - String ERROR_TEXT = MOFJ2EEResourceHandler.ERROR; - String WARNING_TEXT = MOFJ2EEResourceHandler.WARNING; - String INFO_TEXT = MOFJ2EEResourceHandler.INFO; -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEStatus.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEStatus.java deleted file mode 100644 index 3b9b2bde6..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEStatus.java +++ /dev/null @@ -1,233 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal; - -import java.text.MessageFormat; - -import org.eclipse.emf.ecore.ENamedElement; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.internal.common.XMLResource; - - -/** - * @author DABERG - * - */ -public class J2EEStatus implements J2EESpecificationConstants { - - public static final int COMPLETED_OK = 0; - public static final int NOT_NEEDED = 1; - public static final int NOT_POSSIBLE = 2; - public static final int WARNING = 3; - public static final int ERROR = 4; - - public static final J2EEStatus OK_STATUS = new J2EEStatus(COMPLETED_OK, ""); //$NON-NLS-1$ - - private static final J2EEStatus[] EmptyStatusArray = new J2EEStatus[0]; - - private int severity; - private String message; - private XMLResource resource; - private EObject targetObject; - - public J2EEStatus() { - //Default - } - - public J2EEStatus(int aSeverity, String aMessage) { - this(aSeverity, (EObject)null, aMessage); - } - public J2EEStatus(int aSeverity, XMLResource xmlResource) { - this(aSeverity, xmlResource, null); - } - - public J2EEStatus(int aSeverity, EObject anObject) { - this(aSeverity, anObject, null); - } - - public J2EEStatus(int aSeverity, XMLResource xmlResource, String aMessage) { - severity = aSeverity; - resource = xmlResource; - message = aMessage; - } - - public J2EEStatus(int aSeverity, EObject anObject, String aMessage) { - severity = aSeverity; - targetObject = anObject; - message = aMessage; - } - - public String format(String aPattern, String arg1) { - return MessageFormat.format(aPattern, new String[]{arg1}); - } - - /** - * Returns the message. - * @return String - */ - public String getMessage() { - if (message == null) - message = createDefaultMessage(); - return message; - } - - public String getMessageForDisplay() { - return getSeverityText()+" "+getMessage(); //$NON-NLS-1$ - } - - protected String getSeverityText() { - switch (severity) { - case ERROR: - return ERROR_TEXT; - case WARNING: - return WARNING_TEXT; - case NOT_NEEDED: - case NOT_POSSIBLE: - return INFO_TEXT; - default: - return ""; //$NON-NLS-1$ - } - } - - /** - * Method createDefaultMessage. - * @return String - */ - private String createDefaultMessage() { - String objDesc; - if (getResource() != null) - objDesc = getResource().getURI().toString(); - else if (getTargetObject() != null && getTargetObject() instanceof ENamedElement) - objDesc = ((ENamedElement) getTargetObject()).getName(); - else - return null; - switch (getSeverity()) { - case COMPLETED_OK : - return format(DEFAULT_COMPLETED_STATUS_MSG, objDesc); - case NOT_NEEDED : - return format(DEFAULT_NOT_NEEDED_STATUS_MSG, objDesc); - case NOT_POSSIBLE : - return format(DEFAULT_NOT_POSSIBLE_STATUS_MSG, objDesc); - case ERROR : - return format(DEFAULT_ERROR_STATUS_MSG, objDesc); - } - return null; - } - - - /** - * Sets the message. - * @param message The message to set - */ - public void setMessage(String message) { - this.message = message; - } - - /** - * The migration was completed fine or was not needed. - */ - public boolean isOK() { - return severity == COMPLETED_OK || severity == NOT_NEEDED; - } - - /** - * An error ocurred during migration. - */ - public boolean isError() { - return severity == ERROR; - } - - /** - * A warning ocurred during migration. - */ - public boolean isWarning() { - return severity == WARNING; - } - - /** - * The migration was not required. - */ - public boolean isNotNeeded() { - return severity == NOT_NEEDED; - } - /** - * The migration was not possible. - */ - public boolean isNotPossible() { - return severity == NOT_POSSIBLE; - } - /** - * Returns the severity. - * @return int - */ - public int getSeverity() { - return severity; - } - - /** - * Sets the severity. - * @param severity The severity to set - */ - public void setSeverity(int severity) { - this.severity = severity; - } - - public J2EEStatus[] getChildren() { - return EmptyStatusArray; - } - - public boolean isMultiStatus() { - return false; - } - public XMLResource getResource() { - return resource; - } - public EObject getTargetObject() { - return targetObject; - } - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("MigrationStatus "); //$NON-NLS-1$ - if (severity == COMPLETED_OK) { - buf.append("Completed OK"); //$NON-NLS-1$ - } else if (severity == ERROR) { - buf.append("ERROR"); //$NON-NLS-1$ - } else if (severity == WARNING) { - buf.append("WARNING"); //$NON-NLS-1$ - } else if (severity == NOT_NEEDED) { - buf.append("Not Needed"); //$NON-NLS-1$ - } else if (severity == NOT_POSSIBLE) { - buf.append("Not Possible"); //$NON-NLS-1$ - } else { - buf.append("severity="); //$NON-NLS-1$ - buf.append(severity); - } - buf.append(' '); - buf.append(message); - return buf.toString(); - } - - /** - * Append the paramater to this status, and return the resultant status; - * clients must be careful to set their cached status to the return value, - * as it may be a new instance. - */ - public J2EEStatus append(J2EEStatus aStatus) { - if (aStatus == null) - return this; - J2EEMultiStatus multi = new J2EEMultiStatus(); - multi.merge(this); - multi.merge(aStatus); - return multi; - } -} - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEVersionConstants.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEVersionConstants.java deleted file mode 100644 index b96cc1f60..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEVersionConstants.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 16, 2003 - * - */ -package org.eclipse.jst.j2ee.internal; - -/** - * These constants are used with the XMLResource - */ -public interface J2EEVersionConstants { - - public int UNKNOWN = -1; - public int EJB_TYPE = 0; - public int APPLICATION_TYPE = 1; - public int CONNECTOR_TYPE = 2; - public int APPLICATION_CLIENT_TYPE = 3; - public int WEB_TYPE = 4; - - public int J2EE_1_2_ID = 12; - public int J2EE_1_3_ID = 13; - public int J2EE_1_4_ID = 14; - public int JEE_5_0_ID = 50; - public int EJB_1_0_ID = 10; - public int EJB_1_1_ID = 11; - public int EJB_2_0_ID = 20; - public int EJB_2_1_ID = 21; - public int EJB_3_0_ID = 30; - public int WEB_2_2_ID = 22; - public int WEB_2_3_ID = 23; - public int WEB_2_4_ID = 24; - public int WEB_2_5_ID = 25; - public int TAGLIB_1_1_ID = 11; - public int TAGLIB_1_2_ID = 12; - public int TAGLIB_2_0_ID = 20; - public int JSP_1_1_ID = 11; - public int JSP_1_2_ID = 12; - public int JSP_2_0_ID = 20; - public int SERVLET_2_2 = 22; - public int SERVLET_2_3 = 23; - public int SERVLET_2_4 = 24; - public int SERVLET_2_5 = 25; - public int JCA_1_0_ID = 10; - public int JCA_1_5_ID = 15; - public int WEBSERVICES_1_0_ID = 10; - public int WEBSERVICES_1_1_ID = 11; - public String J2EE_1_4_TEXT = "1.4"; //$NON-NLS-1$ - - - - public int VERSION_1_0 = 10; - public int VERSION_1_1 = 11; - public int VERSION_1_2 = 12; - public int VERSION_1_3 = 13; - public int VERSION_1_4 = 14; - public int VERSION_1_5 = 15; - public int VERSION_2_0 = 20; - public int VERSION_2_1 = 21; - public int VERSION_2_2 = 22; - public int VERSION_2_3 = 23; - public int VERSION_2_4 = 24; - public int VERSION_2_5 = 25; - public int VERSION_3_0 = 30; - public int VERSION_5_0 = 50; - - public String VERSION_1_0_TEXT = "1.0"; //$NON-NLS-1$ - public String VERSION_1_1_TEXT = "1.1"; //$NON-NLS-1$ - public String VERSION_1_2_TEXT = "1.2"; //$NON-NLS-1$ - public String VERSION_1_3_TEXT = "1.3"; //$NON-NLS-1$ - public String VERSION_1_4_TEXT = "1.4"; //$NON-NLS-1$ - public String VERSION_1_5_TEXT = "1.5"; //$NON-NLS-1$ - public String VERSION_2_0_TEXT = "2.0"; //$NON-NLS-1$ - public String VERSION_2_1_TEXT = "2.1"; //$NON-NLS-1$ - public String VERSION_2_2_TEXT = "2.2"; //$NON-NLS-1$ - public String VERSION_2_3_TEXT = "2.3"; //$NON-NLS-1$ - public String VERSION_2_4_TEXT = "2.4"; //$NON-NLS-1$ - public String VERSION_2_5_TEXT = "2.5"; //$NON-NLS-1$ - public String VERSION_3_0_TEXT = "3.0"; //$NON-NLS-1$ - public String VERSION_5_0_TEXT = "5.0"; //$NON-NLS-1$ - public String VERSION_5_TEXT = "5"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/MOFJ2EEResourceHandler.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/MOFJ2EEResourceHandler.java deleted file mode 100644 index 41d839a6d..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/MOFJ2EEResourceHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal; - -import org.eclipse.osgi.util.NLS; - -public final class MOFJ2EEResourceHandler extends NLS { - - private static final String BUNDLE_NAME = "mofj2ee";//$NON-NLS-1$ - - private MOFJ2EEResourceHandler() { - // Do not instantiate - } - - public static String Stack_trace_of_nested_exce; - public static String ERROR; - public static String WARNING; - public static String INFO; - public static String DEFAULT_COMPLETED_STATUS_MSG; - public static String DEFAULT_NOT_NEEDED_STATUS_MSG; - public static String DEFAULT_NOT_POSSIBLE_STATUS_MSG; - public static String DEFAULT_ERROR_STATUS_MSG; - public static String REMOVED_LOCAL_CLIENT_MSG; - public static String REMOVED_ACCESS_INTENTS_MSG; - public static String REMOVED_ISOLATION_LEVELS_MSG; - public static String CONVERTED_FINDER_MSG; - public static String UNNAMED_EJB; - public static String CONVERTED_QUERY_DESCRIPTION; - public static String MIGRATED_DEFAULT_DATASOURCE_JAR_MSG; - public static String MIGRATED_DEFAULT_DATASOURCE_MSG; - public static String J2EE_VERSION_NULL_ERROR; - public static String J2EE_VERSION_PROXY_ERROR; - - static { - NLS.initializeMessages(BUNDLE_NAME, MOFJ2EEResourceHandler.class); - } - - public static String getString(String key, Object[] args) { - return NLS.bind(key, args); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/WrappedException.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/WrappedException.java deleted file mode 100644 index 5c021002f..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/WrappedException.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal; - - - -/** - * Base exception class for non-runtime exceptions, where a caught exception - * causes this exception to be thrown - */ -public abstract class WrappedException extends Exception implements IWrappedException { - /** The exception which necessitated this exception */ - protected Exception nestedException; - -public WrappedException() { - super(); -} -public WrappedException(Exception e) { - super(); - setNestedException(e); -} -public WrappedException(String s) { - super(s); -} -public WrappedException(String s, Exception e) { - super(s); - setNestedException(e); -} -/** - * Return the messages from this and all nested exceptions, in order from outermost to innermost - */ -public java.lang.String[] getAllMessages() { - return ExceptionHelper.getAllMessages(this); -} -/** - * Return the messages from this and all nested exceptions, in order from outermost to innermost, - * concatenated as one - */ -public java.lang.String getConcatenatedMessages() { - return ExceptionHelper.getConcatenatedMessages(this); -} -public java.lang.Exception getNestedException() { - return nestedException; -} -/** - * Added to provide compatibility for the Java 1.4.2 addition of - * <code>Throwable.getCause()</code>. - */ -public java.lang.Throwable getCause() { - return getNestedException(); -} -/** - * Print out a stack trace to the system err. - */ -public void printStackTrace() { - printStackTrace(System.err); -} -/** -* Prints the exception to System.err. -* If we have a nested exception, print its stack. -*/ -public void printStackTrace(java.io.PrintStream s) { - if (nestedException != null) { - s.println(this); - s.println(MOFJ2EEResourceHandler.Stack_trace_of_nested_exce); // = "Stack trace of nested exception:" - nestedException.printStackTrace(s); - } else { - super.printStackTrace(s); - } -} -/** -* Prints the exception to System.err. -* If we have a nested exception, print its stack. -*/ -public void printStackTrace(java.io.PrintWriter s) { - if (nestedException != null) { - s.println(this); - s.println(MOFJ2EEResourceHandler.Stack_trace_of_nested_exce); // = "Stack trace of nested exception:" - nestedException.printStackTrace(s); - } else { - super.printStackTrace(s); - } -} -public void setNestedException(java.lang.Exception newNestedException) { - nestedException = newNestedException; - initCause(newNestedException); -} -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/WrappedRuntimeException.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/WrappedRuntimeException.java deleted file mode 100644 index 0f3a1ad74..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/WrappedRuntimeException.java +++ /dev/null @@ -1,105 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal; - - - - - -public class WrappedRuntimeException extends RuntimeException implements IWrappedException { - /** - * - */ - private static final long serialVersionUID = -8926753082721271021L; - /** The exception which necessitated this runtime exception, if one exists */ - protected Exception nestedException; -public WrappedRuntimeException() { - super(); -} -public WrappedRuntimeException(Exception e) { - super(); - setNestedException(e); -} -public WrappedRuntimeException(String s) { - super(s); -} -public WrappedRuntimeException(String s, Exception e) { - super(s); - setNestedException(e); -} -/** - * Return the messages from this and all nested exceptions, in order from outermost to innermost - */ -public java.lang.String[] getAllMessages() { - return ExceptionHelper.getAllMessages(this); -} -/** - * Return the messages from this and all nested exceptions, in order from outermost to innermost, - * concatenated as one - */ -public java.lang.String getConcatenatedMessages() { - return ExceptionHelper.getConcatenatedMessages(this); -} -/** - * @return java.lang.Exception - */ -public java.lang.Exception getNestedException() { - return nestedException; -} -/** - * Added to provide compatibility for the Java 1.4.2 addition of - * <code>Throwable.getCause()</code>. - * @return The nested exception held by the receiver. - */ -public java.lang.Throwable getCause() { - return getNestedException(); -} -/** - * Print out a stack trace to the system err. - */ -public void printStackTrace() { - printStackTrace(System.err); -} -/** -* Prints the exception to System.err. -* If we have a nested exception, print its stack. -*/ -public void printStackTrace(java.io.PrintStream s) { - if (nestedException != null) { - s.println(this); - s.println(MOFJ2EEResourceHandler.Stack_trace_of_nested_exce); // = "Stack trace of nested exception:" - nestedException.printStackTrace(s); - } else { - super.printStackTrace(s); - } -} -/** -* Prints the exception to System.err. -* If we have a nested exception, print its stack. -*/ -public void printStackTrace(java.io.PrintWriter s) { - if (nestedException != null) { - s.println(this); - s.println(MOFJ2EEResourceHandler.Stack_trace_of_nested_exce); // = "Stack trace of nested exception:" - nestedException.printStackTrace(s); - } else { - super.printStackTrace(s); - } -} -/** - * @param newNestedException java.lang.Exception - */ -public void setNestedException(java.lang.Exception newNestedException) { - nestedException = newNestedException; -} -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/J2EEVersionResource.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/J2EEVersionResource.java deleted file mode 100644 index b791f56dc..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/J2EEVersionResource.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Common Interface used to check version of J2EE model resources - */ -package org.eclipse.jst.j2ee.internal.common; - -/** - * @author cbridgha - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -public interface J2EEVersionResource { - public int getJ2EEVersionID(); - public int getModuleVersionID(); - public int getVersionID(); -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/J2EEXMIResource.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/J2EEXMIResource.java deleted file mode 100644 index 600158abe..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/J2EEXMIResource.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.common; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.wst.common.internal.emf.resource.CompatibilityXMIResourceImpl; - - -/** - * @deprecated No longer required - change to extend CompatibilityXMIResourceImpl - */ -public class J2EEXMIResource extends CompatibilityXMIResourceImpl implements J2EEVersionResource{ - - /** - * Constructor for J2EEXMIResource. - */ - public J2EEXMIResource() { - super(); - } - - /** - * Constructor for J2EEXMIResource. - * @param uri - */ - public J2EEXMIResource(URI uri) { - super(uri); - } - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.common.J2EEVersionResource#getJ2EEVersionID() - */ - public int getJ2EEVersionID() { - // TODO Auto-generated method stub - return J2EEVersionConstants.J2EE_1_3_ID; - } - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.common.J2EEVersionResource#getModuleVersionID() - */ - public int getModuleVersionID() { - // TODO Auto-generated method stub - return 0; - } - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.common.J2EEVersionResource#getVersionID() - */ - public int getVersionID() { - // TODO Auto-generated method stub - return 0; - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/J2EEXMIResourceFactory.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/J2EEXMIResourceFactory.java deleted file mode 100644 index c3562d208..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/J2EEXMIResourceFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.common; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jst.j2ee.common.internal.impl.J2EEResourceFactoryRegistry; -import org.eclipse.wst.common.internal.emf.resource.CompatibilityResourceFactory; - - - - -/** - * @author nssheth - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class J2EEXMIResourceFactory extends CompatibilityResourceFactory { - - public static J2EEXMIResourceFactory INSTANCE = new J2EEXMIResourceFactory(); - - public static void register() { - J2EEResourceFactoryRegistry.INSTANCE.getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, INSTANCE); - } - - /** - * Constructor for J2EEXMIResourceFactory. - */ - public J2EEXMIResourceFactory() { - super(); - } - - /** - * @see org.eclipse.emf.ecore.resource.Resource.Factory#createResource(URI) - */ - public Resource createResource(URI uri) { - J2EEXMIResource resource = new J2EEXMIResource(uri); - return resource; - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/XMLResource.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/XMLResource.java deleted file mode 100644 index d0cb95b29..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/common/XMLResource.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.common; - -import org.eclipse.jst.j2ee.application.Application; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.wst.common.internal.emf.resource.TranslatorResource; - - -public interface XMLResource extends TranslatorResource, J2EEVersionConstants { - public static final int APP_CLIENT_TYPE = 1; - public static final int APPLICATION_TYPE = 2; - public static final int EJB_TYPE = 3; - public static final int WEB_APP_TYPE = 4; - public static final int RAR_TYPE = 5; - public static final int WEB_SERVICES_CLIENT_TYPE = 6; - - public static final String DELETED_ERROR_MSG = "This resource has been deleted and can no longer be used."; /** - * Is this a resource loaded as an alternate deployment descriptor? - */ - boolean isAlt(); - public int getJ2EEVersionID(); - public int getModuleVersionID(); - public void setJ2EEVersionID(int id); - public void setModuleVersionID(int id); - /** - * Used only if this resource is an alt; return the application which declares it - */ - Application getApplication(); - - void setApplication(Application newApplication); - /** - * @deprecated use {@link #getVersionID()} - * @see J2EEVersionConstants - */ - boolean isJ2EE1_3(); - - /** - * Returns the type of this J2EE XMLResource. - * You can use this method instead of using instanceof. - * @see XMLResource#APP_CLIENT_TYPE - * @see XMLResource#APPLICATION_TYPE - * @see XMLResource#EJB_TYPE - * @see XMLResource#WEB_APP_TYPE - * @see XMLResource#RAR_TYPE - */ - int getType(); - /** - * Is this a resource loaded as an alternate deployment descriptor? - */ - void setIsAlt(boolean isAlternateDD); - /** - * @deprecated use {@link TranslatorResource#setVersionID(int)}, - * {@link TranslatorResource#setDoctypeValues(String, String)} - * Sets the system id of the XML document. - * @see J2EEVersionConstants - */ - void setSystemId(String id); - /** - * @deprecated use {@link TranslatorResource#setVersionID(int)}, - * {@link TranslatorResource#setDoctypeValues(String, String)} - * Sets the public id of the XML document. - * @see J2EEVersionConstants - */ - void setPublicId(String id); - - //The following methods are to support ReferencedResource without having an actual - //This may be just a subset of what is available in ReferencedResource - void saveIfNecessary() throws Exception; - void releaseFromWrite(); - void releaseFromRead(); - void preDelete(); - boolean isSharedForWrite(); - boolean isShared(); - boolean isReadOnly(); - boolean isNew(); - void accessForWrite(); - void accessForRead(); - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/application/ApplicationTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/application/ApplicationTranslator.java deleted file mode 100644 index 6385efc2e..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/application/ApplicationTranslator.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 1, 2003 - * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.model.translator.application; - -import org.eclipse.jst.j2ee.application.ApplicationPackage; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.xml.EarDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.RootTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author dfholttp - * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ApplicationTranslator extends RootTranslator implements EarDeploymentDescriptorXmlMapperI, J2EEConstants { - public static ApplicationTranslator INSTANCE = new ApplicationTranslator(); - private static Translator[] children13; - private static Translator[] children14; - private static ApplicationPackage APPLICATION_PKG = ApplicationPackage.eINSTANCE; - private static CommonPackage COMMON_PKG = CommonPackage.eINSTANCE; - - public ApplicationTranslator() { - super(APPLICATION, ApplicationPackage.eINSTANCE.getApplication()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - switch (versionID) { - case (J2EE_1_2_ID) : - case (J2EE_1_3_ID) : - if (children13 == null) - children13 = create13Children(); - return children13; - default : - if (children14 == null) - children14 = create14Children(); - return children14; - } - } - - protected Translator[] create13Children() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(ICON+"/"+SMALL_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon()), //$NON-NLS-1$ - new Translator(ICON+"/"+LARGE_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon()), //$NON-NLS-1$ - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName()), - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - new ModuleTranslator(), - CommonTranslators.createSecurityRoleTranslator13(APPLICATION_PKG.getApplication_SecurityRoles()), - }; - } - - protected Translator[] create14Children() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(VERSION, APPLICATION_PKG.getApplication_Version(), DOM_ATTRIBUTE), - new ConstantAttributeTranslator(XML_NS, J2EE_NS_URL), - new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL), - new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, J2EE_NS_URL+' '+APPLICATION_SCHEMA_LOC_1_4), - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - new ModuleTranslator(), - CommonTranslators.createSecurityRoleTranslator14(APPLICATION_PKG.getApplication_SecurityRoles()), - }; - - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/application/ModuleTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/application/ModuleTranslator.java deleted file mode 100644 index 1ffd1e923..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/application/ModuleTranslator.java +++ /dev/null @@ -1,144 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 1, 2003 - * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.model.translator.application; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.application.ApplicationFactory; -import org.eclipse.jst.j2ee.application.ApplicationPackage; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.xml.EarDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.ReadAheadHelper; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class ModuleTranslator extends Translator implements EarDeploymentDescriptorXmlMapperI { - private static final ApplicationPackage APPLICATION_PKG = ApplicationPackage.eINSTANCE; - - private static final Translator ALT_DD_TRANSLATOR = createAltDDTranslator(); - private static final Translator[] WEB_TRANSLATORS = createWebModuleTranslators(); - private static final Translator[] EJB_TRANSLATORS = createEJBModuleTranslators(); - private static final Translator[] JAVA_TRANSLATORS = createJavaModuleTranslators(); - private static final Translator[] CONNECTOR_TRANSLATORS = createConnectorModuleTranslators(); - //private static final - - /** - * @param domNameAndPath - * @param eClass - */ - public ModuleTranslator() { - super(MODULE, APPLICATION_PKG.getApplication_Modules()); - addReadAheadHelper(new ReadAheadHelper(MODULE, new String[] { EJB, JAVA, WEB, CONNECTOR }, null)); - } - - /** - * @return - */ - private static Translator[] createConnectorModuleTranslators() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(CONNECTOR, APPLICATION_PKG.getModule_Uri()), - ALT_DD_TRANSLATOR, - // CommonTranslators.createDeploymentExtensionTranslator(APPLICATION_PKG.getModule_Extensions()) - }; - } - - /** - * @return - */ - private static Translator[] createJavaModuleTranslators() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(JAVA, APPLICATION_PKG.getModule_Uri()), - ALT_DD_TRANSLATOR, - // CommonTranslators.createDeploymentExtensionTranslator(APPLICATION_PKG.getModule_Extensions()) - }; - } - - /** - * @return - */ - private static Translator[] createEJBModuleTranslators() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(EJB, APPLICATION_PKG.getModule_Uri()), - ALT_DD_TRANSLATOR, - // CommonTranslators.createDeploymentExtensionTranslator(APPLICATION_PKG.getModule_Extensions()) - }; - } - - /** - * @return - */ - private static Translator[] createWebModuleTranslators() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(WEB + "/" + WEB_URI, APPLICATION_PKG.getModule_Uri()), //$NON-NLS-1$ - new Translator(WEB + "/" + CONTEXT_ROOT, APPLICATION_PKG.getWebModule_ContextRoot()), //$NON-NLS-1$ - ALT_DD_TRANSLATOR, - // CommonTranslators.createDeploymentExtensionTranslator(APPLICATION_PKG.getModule_Extensions()) - }; - - } - - private static Translator createAltDDTranslator() { - return new Translator(ALT_DD, ApplicationPackage.eINSTANCE.getModule_AltDD()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - if (o == null) - return CommonTranslators.EMPTY_CHILDREN; - else if (((Module) o).isEjbModule()) - return EJB_TRANSLATORS; - else if (((Module) o).isConnectorModule()) - return CONNECTOR_TRANSLATORS; - else if (((Module) o).isWebModule()) - return WEB_TRANSLATORS; - else if (((Module) o).isJavaModule()) - return JAVA_TRANSLATORS; - else - throw new IllegalStateException("Internal error: Module Type excepted"); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - ApplicationFactory fact = ApplicationFactory.eINSTANCE; - if (EJB.equals(readAheadName)) - return fact.createEjbModule(); - else if (WEB.equals(readAheadName)) - return fact.createWebModule(); - else if (JAVA.equals(readAheadName)) - return fact.createJavaClientModule(); - else if (CONNECTOR.equals(readAheadName)) - return fact.createConnectorModule(); - else - return fact.createModule(); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#isManagedByParent() - */ - public boolean isManagedByParent() { - return false; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/client/ApplicationClientTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/client/ApplicationClientTranslator.java deleted file mode 100644 index 76f1f6e3c..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/client/ApplicationClientTranslator.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.model.translator.client; - -import org.eclipse.jst.j2ee.client.ClientPackage; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.model.translator.common.EnvEntryTranslator; -import org.eclipse.jst.j2ee.internal.model.translator.common.JavaClassTranslator; -import org.eclipse.jst.j2ee.internal.xml.DeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.RootTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class ApplicationClientTranslator extends RootTranslator implements DeploymentDescriptorXmlMapperI, J2EEConstants { - public static ApplicationClientTranslator INSTANCE = new ApplicationClientTranslator(); - public static final String CALLBACK_HANDLER = "callback-handler"; //$NON-NLS-1$ - public static final String APPLICATION_CLIENT = "application-client"; //$NON-NLS-1$ - private static CommonPackage COMMON_PKG = CommonPackage.eINSTANCE; - private static Translator[] children13; - private static Translator[] children14; - - protected ApplicationClientTranslator() { - super(APPLICATION_CLIENT, ClientPackage.eINSTANCE.getApplicationClient()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - switch (versionID) { - case (J2EE_1_2_ID) : - case (J2EE_1_3_ID) : - if (children13 == null) - children13 = create13Children(); - return children13; - default : - if (children14 == null) - children14 = create14Children(); - return children14; - } - } - - protected Translator[] create13Children() { - ClientPackage ePackageClient=ClientPackage.eINSTANCE; - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(SMALL_ICON_PATH, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon()), - new Translator(LARGE_ICON_PATH, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon()), - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName()), - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - new EnvEntryTranslator(ePackageClient.getApplicationClient_EnvironmentProps(), true, false), - CommonTranslators.createEJBRefTranslator13(ePackageClient.getApplicationClient_EjbReferences()), - CommonTranslators.createResourceRefTranslator13(ePackageClient.getApplicationClient_ResourceRefs()), - //J2EE 1.3 - CommonTranslators.createResourceEnvRefTranslator13(ePackageClient.getApplicationClient_ResourceEnvRefs()), - new JavaClassTranslator(CALLBACK_HANDLER, ePackageClient.getApplicationClient_CallbackHandler()), - }; - } - - protected Translator[] create14Children() { - ClientPackage ePackageClient=ClientPackage.eINSTANCE; - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(VERSION, ePackageClient.getApplicationClient_Version(), DOM_ATTRIBUTE), - new ConstantAttributeTranslator(XML_NS, J2EE_NS_URL), - new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL), - new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, J2EE_NS_URL+' '+APP_CLIENT_SCHEMA_LOC_1_4), - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - new EnvEntryTranslator(ePackageClient.getApplicationClient_EnvironmentProps(), true, true), - CommonTranslators.createEJBRefTranslator14(ePackageClient.getApplicationClient_EjbReferences()), - CommonTranslators.createServiceRefGroupTranslator(ePackageClient.getApplicationClient_ServiceRefs()), - CommonTranslators.createResourceRefTranslator14(ePackageClient.getApplicationClient_ResourceRefs()), - CommonTranslators.createResourceEnvRefTranslator14(ePackageClient.getApplicationClient_ResourceEnvRefs()), - CommonTranslators.createMessageDestinationRefTranslator(ePackageClient.getApplicationClient_MessageDestinationRefs()), - new JavaClassTranslator(CALLBACK_HANDLER, ePackageClient.getApplicationClient_CallbackHandler()), - CommonTranslators.createMessageDestinationTranslator(ePackageClient.getApplicationClient_MessageDestinations()), - // CommonTranslators.createDeploymentExtensionTranslator(ePackageClient.getApplicationClient_DeploymentExtensions()) - }; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/BooleanTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/BooleanTranslator.java deleted file mode 100644 index dbef4c7e5..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/BooleanTranslator.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 21, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.model.translator.common; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author administrator - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class BooleanTranslator extends Translator { - - - /** - * @param domNameAndPath - * @param aFeature - */ - public BooleanTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature, BOOLEAN_LOWERCASE); - } - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#convertStringToValue(java.lang.String, org.eclipse.emf.ecore.EObject) - */ - public Object convertStringToValue(String strValue, EObject owner) { - if (strValue == null) - return Boolean.FALSE; - else if (strValue.toUpperCase().equals("1") || strValue.toUpperCase().equals("YES")) //$NON-NLS-1$ //$NON-NLS-2$ - return Boolean.TRUE; - else - return Boolean.valueOf(strValue); - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/CommonTranslators.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/CommonTranslators.java deleted file mode 100644 index f2f723359..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/CommonTranslators.java +++ /dev/null @@ -1,423 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 20, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.common; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.xml.DeploymentDescriptorXmlMapperI; -import org.eclipse.jst.j2ee.webservice.wsclient.Webservice_clientPackage; -import org.eclipse.wst.common.internal.emf.resource.DependencyTranslator; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * A static helper for creating Generic common J2EE translators - */ -public class CommonTranslators implements DeploymentDescriptorXmlMapperI { - - private static CommonPackage COMMON_PKG = CommonPackage.eINSTANCE; - private static Webservice_clientPackage WEBSERVICE_PKG = Webservice_clientPackage.eINSTANCE; - public static final Translator[] EMPTY_CHILDREN = new Translator[] {}; - private static final Translator EJB_REF_NAME_TRANSLATOR = new Translator(EJB_REF_NAME, COMMON_PKG.getEjbRef_Name()); - private static final Translator EJB_REF_TYPE_TRANSLATOR = new Translator(EJB_REF_TYPE, COMMON_PKG.getEjbRef_Type()); //Enumeration - private static final Translator EJB_LINK_TRANSLATOR = new Translator(EJB_LINK, COMMON_PKG.getEjbRef_Link()); - - private static final Translator RES_REF_NAME_TRANSLATOR = new Translator(RES_REF_NAME, COMMON_PKG.getResourceRef_Name()); - private static final Translator RES_TYPE_TRANSLATOR = new Translator(RES_TYPE, COMMON_PKG.getResourceRef_Type()); - private static final Translator RES_AUTH_TRANSLATOR = new ResAuthTranslator(); - private static final Translator RES_SHARING_SCOPE_TRANSLATOR = new Translator(RES_SHARING_SCOPE, COMMON_PKG.getResourceRef_ResSharingScope()); - - private static final Translator RES_ENV_REF_NAME_TRANSLATOR = new Translator(RESOURCE_ENV_REF_NAME, COMMON_PKG.getResourceEnvRef_Name()); - private static final Translator RES_ENV_REF_TYPE_TRANSLATOR = new JavaClassTranslator(RESOURCE_ENV_REF_TYPE, COMMON_PKG.getResourceEnvRef_Type()); - - private static final Translator SEC_REF_ROLE_NAME_TRANSALTOR = new Translator(ROLE_NAME, COMMON_PKG.getSecurityRoleRef_Name()); - private static final Translator SEC_REF_ROLE_LINK_TRANSLATOR = new Translator(ROLE_LINK, COMMON_PKG.getSecurityRoleRef_Link()); - - private static final Translator RUNAS_ROLE_NAME_TRANSLATOR = new DependencyTranslator(ROLE_NAME, COMMON_PKG.getIdentity_RoleName(), COMMON_PKG.getRunAsSpecifiedIdentity_Identity()); - - private static final Translator SECURITY_ROLE_NAME_TRANSLATOR = new Translator(ROLE_NAME, COMMON_PKG.getSecurityRole_RoleName()); - - public static final Translator DESCRIPTIONS_TRANSLATOR = createDescriptionTranslator(COMMON_PKG.getDescriptionGroup_Descriptions()); - public static final Translator DISPLAYNAMES_TRANSLATOR = createDisplayNameTranslator(COMMON_PKG.getDescriptionGroup_DisplayNames()); - public static final Translator ICONS_TRANSLATOR = createIconTranslator(); - - //The Official Concept of JNDIEnvRefGroup FOR J2EE 1.4 - public static final Translator JNDI_REF_GROUP_ENV_ENTRY_1_4 = new EnvEntryTranslator(COMMON_PKG.getJNDIEnvRefsGroup_EnvironmentProperties(), true, true); - public static final Translator JNDI_REF_GROUP_EJB_REF_1_4 = CommonTranslators.createEJBRefTranslator14(COMMON_PKG.getJNDIEnvRefsGroup_EjbRefs()); - public static final Translator JNDI_REF_GROUP_EJB_LOCAL_REF_1_4 = CommonTranslators.createEJBLocalRefTranslator14(COMMON_PKG.getJNDIEnvRefsGroup_EjbLocalRefs()); - public static final Translator JNDI_REF_GROUP_SERVICE_REF_1_4 = CommonTranslators.createServiceRefGroupTranslator(COMMON_PKG.getJNDIEnvRefsGroup_ServiceRefs()); - public static final Translator JNDI_REF_GROUP_RESOURCE_REF_1_4 = CommonTranslators.createResourceRefTranslator14(COMMON_PKG.getJNDIEnvRefsGroup_ResourceRefs()); - public static final Translator JNDI_REF_GROUP_RESOURCE_ENV_REF_1_4 = CommonTranslators.createResourceEnvRefTranslator14(COMMON_PKG.getJNDIEnvRefsGroup_ResourceEnvRefs()); - public static final Translator JNDI_REF_GROUP_MESSAGE_DEST_REF_1_4 = CommonTranslators.createMessageDestinationRefTranslator(COMMON_PKG.getJNDIEnvRefsGroup_MessageDestinationRefs()); - - //The unofficial concept of JNDIEnvRefGroup FOR J2EE 1.3 - public static final Translator JNDI_REF_GROUP_ENV_ENTRY_1_3 = new EnvEntryTranslator(COMMON_PKG.getJNDIEnvRefsGroup_EnvironmentProperties(), true, false); - public static final Translator JNDI_REF_GROUP_EJB_REF_1_3 = CommonTranslators.createEJBRefTranslator13(COMMON_PKG.getJNDIEnvRefsGroup_EjbRefs()); - public static final Translator JNDI_REF_GROUP_EJB_LOCAL_REF_1_3 = CommonTranslators.createEJBLocalRefTranslator13(COMMON_PKG.getJNDIEnvRefsGroup_EjbLocalRefs()); - public static final Translator JNDI_REF_GROUP_RESOURCE_REF_1_3 = CommonTranslators.createResourceRefTranslator13(COMMON_PKG.getJNDIEnvRefsGroup_ResourceRefs()); - public static final Translator JNDI_REF_GROUP_RESOURCE_ENV_REF_1_3 = CommonTranslators.createResourceEnvRefTranslator13(COMMON_PKG.getJNDIEnvRefsGroup_ResourceEnvRefs()); - - public static final Translator LISTENER_CLASS_TRANSLATOR = new JavaClassTranslator(LISTENER_CLASS, COMMON_PKG.getListener_ListenerClass()); - - private CommonTranslators() { - super(); - } - - public static Translator createSecurityRoleRefTranslator13(EStructuralFeature feature) { - - GenericTranslator result = new GenericTranslator(SECURITY_ROLE_REF, feature); - result.setChildren(new Translator[] { - new Translator(DESCRIPTION, COMMON_PKG.getSecurityRoleRef_Description()), - SEC_REF_ROLE_NAME_TRANSALTOR, - SEC_REF_ROLE_LINK_TRANSLATOR - }); - return result; - } - - public static Translator createSecurityRoleRefTranslator14(EStructuralFeature feature) { - - GenericTranslator result = new GenericTranslator(SECURITY_ROLE_REF, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createDescriptionTranslator(COMMON_PKG.getSecurityRoleRef_Descriptions()), - SEC_REF_ROLE_NAME_TRANSALTOR, - SEC_REF_ROLE_LINK_TRANSLATOR - }); - return result; - } - - public static Translator createResourceEnvRefTranslator13(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(RESOURCE_ENV_REF, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getResourceEnvRef_Description()), - RES_ENV_REF_NAME_TRANSLATOR, - RES_ENV_REF_TYPE_TRANSLATOR - }); - return result; - } - - public static Translator createResourceEnvRefTranslator14(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(RESOURCE_ENV_REF, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createDescriptionTranslator(COMMON_PKG.getResourceEnvRef_Descriptions()), - RES_ENV_REF_NAME_TRANSLATOR, - RES_ENV_REF_TYPE_TRANSLATOR, - //J2EE1.4 Added - // createDeploymentExtensionTranslator(COMMON_PKG.getResourceEnvRef_Extensions()) - }); - return result; - } - - public static Translator createResourceRefTranslator13(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(RESOURCE_REF, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getResourceRef_Description()), - RES_REF_NAME_TRANSLATOR, - RES_TYPE_TRANSLATOR, - RES_AUTH_TRANSLATOR, - //EJB 2.0 Added - RES_SHARING_SCOPE_TRANSLATOR, - }); - return result; - } - - public static Translator createResourceRefTranslator14(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(RESOURCE_REF, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createDescriptionTranslator(COMMON_PKG.getResourceRef_Descriptions()), - RES_REF_NAME_TRANSLATOR, - RES_TYPE_TRANSLATOR, - RES_AUTH_TRANSLATOR, - //EJB 2.0 Added - RES_SHARING_SCOPE_TRANSLATOR, - - //J2EE1.4 Added - // createDeploymentExtensionTranslator(COMMON_PKG.getResourceRef_Extensions()) - }); - return result; - } - - public static Translator createSecurityRoleTranslator13(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(SECURITY_ROLE, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getSecurityRole_Description()), - SECURITY_ROLE_NAME_TRANSLATOR - }); - return result; - } - - public static Translator createSecurityRoleTranslator14(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(SECURITY_ROLE, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createDescriptionTranslator(COMMON_PKG.getSecurityRole_Descriptions()), - SECURITY_ROLE_NAME_TRANSLATOR - }); - return result; - } - - public static Translator createEJBRefTranslator13(EStructuralFeature feature) { - return createEJBRefTranslator13(feature, false); - } - - public static Translator createEJBLocalRefTranslator13(EStructuralFeature feature) { - return createEJBRefTranslator13(feature, true); - } - private static Translator createEJBRefTranslator13(EStructuralFeature feature, boolean local) { - String nodeName = local ? EJB_LOCAL_REF : EJB_REF; - String homeTag = local ? LOCAL_HOME : HOME; - String remoteTag = local ? LOCAL : REMOTE; - EStructuralFeature homeFeature = local ? COMMON_PKG.getEJBLocalRef_LocalHome() : COMMON_PKG.getEjbRef_Home(); - EStructuralFeature remoteFeature = local ? COMMON_PKG.getEJBLocalRef_Local() : COMMON_PKG.getEjbRef_Remote(); - - GenericTranslator result = new GenericTranslator(nodeName, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getEjbRef_Description()), - EJB_REF_NAME_TRANSLATOR, - EJB_REF_TYPE_TRANSLATOR, - new Translator(homeTag, homeFeature), - new Translator(remoteTag, remoteFeature), - EJB_LINK_TRANSLATOR - }); - return result; - } - - public static Translator createEJBRefTranslator14(EStructuralFeature feature) { - return createEJBRefTranslator14(feature, false); - } - - public static Translator createEJBLocalRefTranslator14(EStructuralFeature feature) { - return createEJBRefTranslator14(feature, true); - } - private static Translator createEJBRefTranslator14(EStructuralFeature feature, boolean local) { - String nodeName = local ? EJB_LOCAL_REF : EJB_REF; - String homeTag = local ? LOCAL_HOME : HOME; - String remoteTag = local ? LOCAL : REMOTE; - EStructuralFeature homeFeature = local ? COMMON_PKG.getEJBLocalRef_LocalHome() : COMMON_PKG.getEjbRef_Home(); - EStructuralFeature remoteFeature = local ? COMMON_PKG.getEJBLocalRef_Local() : COMMON_PKG.getEjbRef_Remote(); - - GenericTranslator result = new GenericTranslator(nodeName, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createDescriptionTranslator(COMMON_PKG.getEjbRef_Descriptions()), - EJB_REF_NAME_TRANSLATOR, - EJB_REF_TYPE_TRANSLATOR, - new Translator(homeTag, homeFeature), - new Translator(remoteTag, remoteFeature), - EJB_LINK_TRANSLATOR, - // createDeploymentExtensionTranslator(COMMON_PKG.getEjbRef_Extensions()) - }); - return result; - } - - - public static Translator createRunAsTranslator13(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(RUN_AS, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getSecurityIdentity_Description()), - //new DependencyTranslator(DES,) - RUNAS_ROLE_NAME_TRANSLATOR - }); - return result; - } - - - public static Translator createRunAsTranslator14(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(RUN_AS, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createDescriptionTranslator(COMMON_PKG.getSecurityIdentity_Descriptions()), - RUNAS_ROLE_NAME_TRANSLATOR - }); - return result; - } - - - - public static Translator createMessageDestinationRefTranslator(EStructuralFeature feature){ - GenericTranslator result = new GenericTranslator(MESSAGE_DEST_REF,feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createDescriptionTranslator(COMMON_PKG.getMessageDestinationRef_Descriptions()), - new Translator(MESSAGE_DEST_REF_NAME,COMMON_PKG.getMessageDestinationRef_Name()), - new Translator(MESSAGE_DEST_TYPE,COMMON_PKG.getMessageDestinationRef_Type()), - new Translator(MESSAGE_DEST_USAGE,COMMON_PKG.getMessageDestinationRef_Usage()), - new Translator(MESSAGE_DEST_LINK,COMMON_PKG.getMessageDestinationRef_Link()), - //createDeploymentExtensionTranslator(COMMON_PKG.getMessageDestinationRef_Extensions()) - }); - - return result; - } - - public static Translator createMessageDestinationTranslator(EStructuralFeature feature){ - GenericTranslator result = new GenericTranslator(MESSAGE_DEST,feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - DESCRIPTIONS_TRANSLATOR, - DISPLAYNAMES_TRANSLATOR, - ICONS_TRANSLATOR, - new Translator(MESSAGE_DEST_NAME,COMMON_PKG.getMessageDestination_Name()), - //createDeploymentExtensionTranslator(COMMON_PKG.getMessageDestination_Extensions()) - }); - - return result; - } - - /** - * This model was model from Websphere Webservices - * @param reference - * @return - */ - public static Translator createServiceRefGroupTranslator(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(SERVICE_REF, feature); - result.setChildren( new Translator[] { - IDTranslator.INSTANCE, - DESCRIPTIONS_TRANSLATOR, - DISPLAYNAMES_TRANSLATOR, - ICONS_TRANSLATOR, - new Translator(SERVICE_REF_NAME, WEBSERVICE_PKG.getServiceRef_ServiceRefName()), - new JavaClassTranslator(SERVICE_INTERFACE, WEBSERVICE_PKG.getServiceRef_ServiceInterface()), - new Translator(WSDL_FILE, WEBSERVICE_PKG.getServiceRef_WsdlFile()), - new Translator(JAXRPC_MAPPING_FILE, WEBSERVICE_PKG.getServiceRef_JaxrpcMappingFile()), - createQNameTranslator(SERVICE_QNAME, WEBSERVICE_PKG.getServiceRef_ServiceQname()), - createPortComponentRefTranslator(), - createServiceRefHandlerTranslator(), - }); - - - return result; - } - - public static Translator createQNameTranslator(String domName, EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(domName, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(Translator.TEXT_ATTRIBUTE_VALUE, CommonPackage.eINSTANCE.getQName_CombinedQName()) - }); - return result; - } - - /** - * This model was model from Websphere Webservices - * @return - */ - public static Translator createServiceRefHandlerTranslator() { - GenericTranslator result = new GenericTranslator(HANDLER, WEBSERVICE_PKG.getServiceRef_Handlers()); - result.setChildren(new Translator[]{ - IDTranslator.INSTANCE, - DESCRIPTIONS_TRANSLATOR, - DISPLAYNAMES_TRANSLATOR, - ICONS_TRANSLATOR, - new Translator(HANDLER_NAME, WEBSERVICE_PKG.getHandler_HandlerName()), - new JavaClassTranslator(HANDLER_CLASS, WEBSERVICE_PKG.getHandler_HandlerClass()), - createParamValueType(HANDLER_INIT_PARAM, WEBSERVICE_PKG.getHandler_InitParams()), - createQNameTranslator(SOAP_HEADER, WEBSERVICE_PKG.getHandler_SoapHeaders()), - new Translator(SOAP_ROLE, WEBSERVICE_PKG.getHandler_SoapRoles()), - new Translator(PORT_NAME, WEBSERVICE_PKG.getHandler_PortNames()) - }); - - return result; - } - - /** - * @return - */ - public static Translator createPortComponentRefTranslator() { - GenericTranslator result = new GenericTranslator(PORT_COMPONENT_REF, WEBSERVICE_PKG.getServiceRef_PortComponentRefs()); - result.setChildren( new Translator[]{ - IDTranslator.INSTANCE, - new JavaClassTranslator(SERVICE_ENPOINT_INTERFACE, WEBSERVICE_PKG.getPortComponentRef_ServiceEndpointInterface()), - new Translator(PORT_COMPONENT_LINK , WEBSERVICE_PKG.getPortComponentRef_PortComponentLink()) - }); - return result; - } - - /** - * @return - */ - public static Translator createDescriptionTranslator(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(DESCRIPTION, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(LANG, COMMON_PKG.getDescription_Lang(), Translator.DOM_ATTRIBUTE), - new Translator(Translator.TEXT_ATTRIBUTE_VALUE, COMMON_PKG.getDescription_Value()) - }); - return result; - } - - /** - * @return - */ - public static Translator createDisplayNameTranslator(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(DISPLAY_NAME, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(LANG, COMMON_PKG.getDisplayName_Lang(), Translator.DOM_ATTRIBUTE), - new Translator(Translator.TEXT_ATTRIBUTE_VALUE, COMMON_PKG.getDisplayName_Value()) - }); - return result; - } - - - /** - * @return - */ - public static Translator createIconTranslator() { - GenericTranslator result = new GenericTranslator(ICON, COMMON_PKG.getDescriptionGroup_Icons()); - result.setChildren(new Translator[] { - new Translator(LANG, COMMON_PKG.getIconType_Lang(), Translator.DOM_ATTRIBUTE), - IDTranslator.INSTANCE, - new Translator(SMALL_ICON, COMMON_PKG.getIconType_SmallIcon()), - new Translator(LARGE_ICON, COMMON_PKG.getIconType_LargeIcon()) - }); - return result; - } - -// public static Translator createDeploymentExtensionTranslator(EStructuralFeature feature) { -// return createDeploymentExtensionTranslator(DEPLOY_EXT, feature); -// } -// -// public static Translator createDeploymentExtensionTranslator(String domName, EStructuralFeature feature) { -// GenericTranslator result = new GenericTranslator(domName, feature); -// result.setChildren(new Translator[] { -// new Translator(NAMESPACE, COMMON_PKG.getDeploymentExtension_Namespace(), Translator.DOM_ATTRIBUTE), -// new Translator(MUSTUNDERSTAND, COMMON_PKG.getDeploymentExtension_MustUnderstand(), Translator.DOM_ATTRIBUTE), -// IDTranslator.INSTANCE, -// Translator.createParentAndTextAttributeTranslator(EXT_ELEMENT, COMMON_PKG.getDeploymentExtension_ExtensionElements(), COMMON_PKG.getExtensibleType_Value()) -// }); -// return result; -// } - - public static Translator createParamValueType(String domName, EStructuralFeature feature){ - GenericTranslator result = new GenericTranslator(domName, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createDescriptionTranslator(COMMON_PKG.getParamValue_Descriptions()), - new Translator(PARAM_NAME, COMMON_PKG.getParamValue_Name()), - new Translator(PARAM_VALUE, COMMON_PKG.getParamValue_Value()), - }); - return result; - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/EnvEntryTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/EnvEntryTranslator.java deleted file mode 100644 index cf6ec6206..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/EnvEntryTranslator.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.model.translator.common; - - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.xml.DeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class EnvEntryTranslator extends Translator implements DeploymentDescriptorXmlMapperI { - private boolean isJ2EE14; - private static Translator[] children; - private static Translator[] reorderedChildren; - //Hacks because of inconsistencies in the servlet spec - boolean typeBeforeValue = true; - /** - * Constructor for EnvEntryTranslator. - * @param domNameAndPath - * @param aFeature - */ - public EnvEntryTranslator(EStructuralFeature aFeature, boolean writeTypeBeforeValue, boolean isJ2EE14) { - super(ENV_ENTRY, aFeature); - typeBeforeValue = writeTypeBeforeValue; - this.isJ2EE14 = isJ2EE14; - } - - /** - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren() - */ - public Translator[] getChildren(Object obj, int versionID) { - //Hava to you create a different one each time - children = createChildren(); - setReorderedChildren(); - - if (typeBeforeValue) - return children; - - return reorderedChildren; - } - - protected Translator[] createChildren() { - CommonPackage ePackageCommon = CommonPackage.eINSTANCE; - Translator descriptionTranslator; - if (isJ2EE14) - descriptionTranslator = CommonTranslators.createDescriptionTranslator(ePackageCommon.getEnvEntry_Descriptions()); - else - descriptionTranslator = new Translator(DESCRIPTION, ePackageCommon.getEnvEntry_Description()); - - return new Translator[] { - IDTranslator.INSTANCE, - descriptionTranslator, - new Translator(ENV_ENTRY_NAME, ePackageCommon.getEnvEntry_Name()), - new EnvEntryTypeTranslator(), - new Translator(ENV_ENTRY_VALUE, ePackageCommon.getEnvEntry_Value()) - }; - } - - protected void setReorderedChildren() { - reorderedChildren = new Translator[children.length]; - System.arraycopy(children, 0, reorderedChildren, 0, children.length); - Translator temp = reorderedChildren[3]; - reorderedChildren[3] = reorderedChildren[4]; - reorderedChildren[4] = temp; - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/EnvEntryTypeTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/EnvEntryTypeTranslator.java deleted file mode 100644 index afecd56ad..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/EnvEntryTypeTranslator.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.model.translator.common; - -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.xml.DeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class EnvEntryTypeTranslator extends Translator implements DeploymentDescriptorXmlMapperI { - private static final String JAVA_LANG= "java.lang."; //$NON-NLS-1$ - private static final int SUBSTRING_LENGTH = JAVA_LANG.length(); - public EnvEntryTypeTranslator() { - super(ENV_ENTRY_TYPE, CommonPackage.eINSTANCE.getEnvEntry_Type()); - } - - /** - * @see com.ibm.etools.emf2xml.impl.Translator#convertStringToValue(String) - */ - public Object convertStringToValue(String strValue, EObject owner) { - if (strValue != null && strValue.startsWith(JAVA_LANG)) - return super.convertStringToValue(strValue.substring(SUBSTRING_LENGTH), owner); - - return null; - } - - /** - * @see com.ibm.etools.emf2xml.impl.Translator#convertValueToString(Object) - */ - public String convertValueToString(Object value, EObject owner) { - if (value != null) - return JAVA_LANG + ((Enumerator)value).getName(); - return null; - } - - - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/JavaClassTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/JavaClassTranslator.java deleted file mode 100644 index e8d24f9fb..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/JavaClassTranslator.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.model.translator.common; - -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.jem.java.JavaClass; -import org.eclipse.jem.java.JavaRefFactory; -import org.eclipse.wst.common.internal.emf.resource.Translator; -import org.eclipse.wst.common.internal.emf.resource.TranslatorPath; - -public class JavaClassTranslator extends Translator { - - /** - * Constructor for JavaClassTranslator. - * @param domNameAndPath - * @param aFeature - */ - public JavaClassTranslator(String domNameAndPath, EStructuralFeature aFeature) { - super(domNameAndPath, aFeature); - } - - /** - * Constructor for JavaClassTranslator. - * @param domNameAndPath - * @param aFeature - * @param path - */ - public JavaClassTranslator(String domNameAndPath, EStructuralFeature aFeature, TranslatorPath path) { - super(domNameAndPath, aFeature, path); - } - - /** - * Constructor for JavaClassTranslator. - * @param domNameAndPath - * @param aFeature - * @param paths - */ - public JavaClassTranslator(String domNameAndPath, EStructuralFeature aFeature, TranslatorPath[] paths) { - super(domNameAndPath, aFeature, paths); - } - - /** - * Constructor for JavaClassTranslator. - * @param domNameAndPath - * @param aFeature - * @param style - */ - public JavaClassTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) { - super(domNameAndPath, aFeature, style); - } - - public Object convertStringToValue(String nodeName, String readAheadName, String value, Notifier owner) { - Object result = null; - if (value != null) { - result = convertStringToValue(value, (EObject) owner); - } - - return result; - } - - /** - * @see com.ibm.etools.emf2xml.impl.Translator#convertStringToValue(String) - */ - public Object convertStringToValue(String strValue, EObject owner) { - if (strValue != null) { - String qualifiedName = removePreceedingAndTrailingPeriods(strValue.trim()); - if (owner != null) { - Resource ownerRes = owner.eResource(); - if (ownerRes != null) { - ResourceSet rs = ownerRes.getResourceSet(); - if (rs != null) { - //Try to reflect the type directly. If nothing is returned - //or an error occurs, return a proxy. - Object javaClass = null; - try { - javaClass = JavaRefFactory.eINSTANCE.reflectType(qualifiedName, rs); - } catch (Exception e) { - //Ignore - } - if (javaClass != null) - return javaClass; - } - } - } - return JavaRefFactory.eINSTANCE.createClassRef(qualifiedName); - } - return null; - } - private String removePreceedingAndTrailingPeriods(String qualifiedName) { - char[] characters = qualifiedName.toCharArray(); - int startIndex = 0; - for (; startIndex < characters.length && characters[startIndex] == '.'; startIndex++); - int qualifiedNameEnd = qualifiedName.length() - 1; - int endIndex = qualifiedNameEnd; - for (; endIndex > -1 && characters[endIndex] == '.'; endIndex--) - if (startIndex == 0 && endIndex == qualifiedNameEnd) - return qualifiedName; - return qualifiedName.substring(startIndex, endIndex + 1); - } - - /** - * @see com.ibm.etools.emf2xml.impl.Translator#convertValueToString(Object) - */ - public String convertValueToString(Object value, EObject owner) { - if (value != null) - return ((JavaClass) value).getQualifiedName(); - return null; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/ResAuthTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/ResAuthTranslator.java deleted file mode 100644 index fdf8b9898..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/common/ResAuthTranslator.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 30, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.common; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.ResAuthTypeBase; -import org.eclipse.jst.j2ee.common.ResourceRef; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.xml.DeploymentDescriptorXmlMapperI; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.wst.common.internal.emf.resource.Translator; -/** - * @author schacher - */ -public class ResAuthTranslator extends Translator implements DeploymentDescriptorXmlMapperI { - - private static final String CONTAINER_AUTH = "CONTAINER"; //$NON-NLS-1$ - private static final String SERVLET_AUTH = "SERVLET"; //$NON-NLS-1$ - public ResAuthTranslator() { - super(RES_AUTH, CommonPackage.eINSTANCE.getResourceRef_Auth()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#convertStringToValue(java.lang.String, org.eclipse.emf.ecore.EObject) - */ - public Object convertStringToValue(String strValue, EObject owner) { - if (isWeb((ResourceRef)owner)) - return convertWebStringToValue(strValue, owner); - - return super.convertStringToValue(strValue, owner); - } - - /** - * @param strValue - * @param owner - * @return - */ - private Object convertWebStringToValue(String strValue, EObject owner) { - if (SERVLET_AUTH.equals(strValue)) - return ResAuthTypeBase.APPLICATION_LITERAL; - else if (CONTAINER_AUTH.equals(strValue)) - return ResAuthTypeBase.CONTAINER_LITERAL; - else - return super.convertStringToValue(strValue, owner); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#convertValueToString(java.lang.Object, org.eclipse.emf.ecore.EObject) - */ - public String convertValueToString(Object value, EObject owner) { - if (isWeb22(((ResourceRef)owner))) - return convertWebValueToString(value, owner); - - return super.convertValueToString(value, owner); - } - - /** - * @param value - * @param owner - */ - private String convertWebValueToString(Object value, EObject owner) { - if (ResAuthTypeBase.APPLICATION_LITERAL == value) - return SERVLET_AUTH; - else if (ResAuthTypeBase.CONTAINER_LITERAL == value) - return CONTAINER_AUTH; - else - return super.convertValueToString(value, owner); - } - - protected boolean isWeb(ResourceRef ref) { - EObject owner = ref.eContainer(); - return (owner instanceof WebApp); - } - protected boolean isWeb22(ResourceRef ref) { - return isWeb(ref) && ((WebApp)ref.eContainer()).getVersionID() <= J2EEVersionConstants.WEB_2_2_ID; - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/connector/ConnectorTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/connector/ConnectorTranslator.java deleted file mode 100644 index 82616b81e..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/connector/ConnectorTranslator.java +++ /dev/null @@ -1,300 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.model.translator.connector; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.model.translator.common.BooleanTranslator; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.xml.RarDeploymentDescriptorXmlMapperI; -import org.eclipse.jst.j2ee.jca.JcaPackage; -import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.RootTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - - -public class ConnectorTranslator extends RootTranslator implements RarDeploymentDescriptorXmlMapperI, J2EEConstants { - public static ConnectorTranslator INSTANCE = new ConnectorTranslator(); - public static final String CONNECTOR = "connector"; //$NON-NLS-1$ - private static JcaPackage CONNECTOR_PKG = JcaPackage.eINSTANCE; - private static CommonPackage COMMON_PKG = CommonPackage.eINSTANCE; - private static Translator[] children13; - private static Translator[] children14; - - private static final Translator VENDOR_NAME_TRANSLATOR = new Translator(VENDOR_NAME, CONNECTOR_PKG.getConnector_VendorName()); - private static final Translator EIS_TYPE_TRANSLATOR = new Translator(EIS_TYPE, CONNECTOR_PKG.getConnector_EisType()); - - private static final Translator CONFIG_PROPERTY_NAME_TRANSLATOR= new Translator(CONFIG_PROPERTY_NAME, CONNECTOR_PKG.getConfigProperty_Name()); - private static final Translator CONFIG_PROPERTY_TYPE_TRANSLATOR= new Translator(CONFIG_PROPERTY_TYPE, CONNECTOR_PKG.getConfigProperty_Type()); - private static final Translator CONFIG_PROPERTY_VALUE_TRANSLATOR= new Translator(CONFIG_PROPERTY_VALUE, CONNECTOR_PKG.getConfigProperty_Value()); - - private static final Translator SECURITY_PERMISSION_SPEC_TRANSLATOR = new Translator(SECURITY_PERMISSION_SPEC, CONNECTOR_PKG.getSecurityPermission_Specification()); - - private static final Translator AUTH_MECH_TYPE_TRANSLATOR = new Translator(AUTH_MECH_TYPE, CONNECTOR_PKG.getAuthenticationMechanism_AuthenticationMechanismType()); - private static final Translator CREDENTIAL_INTERFACE_TRANSLATOR = new Translator(CREDENTIAL_INTERFACE, CONNECTOR_PKG.getAuthenticationMechanism_CredentialInterface()); - - private static final BooleanTranslator LICENSE_REQUIRED_TRANSLATOR = new BooleanTranslator(LICENSE_REQUIRED, CONNECTOR_PKG.getLicense_Required()); - - public ConnectorTranslator() { - super(CONNECTOR, JcaPackage.eINSTANCE.getConnector()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - switch (versionID) { - case (J2EE_1_2_ID) : - case (J2EE_1_3_ID) : - if (children13 == null) - children13 = create13Children(); - return children13; - default : - if (children14 == null) - children14 = create14Children(); - return children14; - } - } - - protected Translator[] create13Children() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName() ), - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - new Translator(ICON+"/"+SMALL_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon() ), //$NON-NLS-1$ - new Translator(ICON+"/"+LARGE_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon() ), //$NON-NLS-1$ - VENDOR_NAME_TRANSLATOR, - new Translator(SPEC_VERSION, CONNECTOR_PKG.getConnector_SpecVersion() ), - EIS_TYPE_TRANSLATOR, - new Translator(VERSION, CONNECTOR_PKG.getConnector_Version() ), - createLicenseTranslator13(), - createResourceAdapterTranslator13() - }; - } - - protected Translator[] create14Children() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(VERSION, CONNECTOR_PKG.getConnector_SpecVersion(), DOM_ATTRIBUTE), - new ConstantAttributeTranslator(XML_NS, J2EE_NS_URL), - new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL), - new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, J2EE_NS_URL+' '+CONNECTOR_SCHEMA_LOC_1_5), - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - VENDOR_NAME_TRANSLATOR, - EIS_TYPE_TRANSLATOR, - new Translator(RESOURCEADAPTER_VERSION, CONNECTOR_PKG.getConnector_Version()), - createLicenseTranslator14(), - createResourceAdapterTranslator14(), - }; - } - - private Translator createResourceAdapterTranslator14() { - GenericTranslator result = new GenericTranslator(RESOURCEADAPTER, CONNECTOR_PKG.getConnector_ResourceAdapter()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(RESOURCEADAPTER_CLASS,CONNECTOR_PKG.getResourceAdapter_ResourceAdapterClass()), - createConfigurationPropertyTranslator14(CONNECTOR_PKG.getResourceAdapter_ConfigProperties()), - createOutboundTranslator(), - createInboundTranslator(), - createAdminObjectTranslator(), - createSecurityPermissionsTranslator() - }); - return result; - } - - private Translator createOutboundTranslator() { - GenericTranslator result = new GenericTranslator(OUTBOUND_RESOURCEADAPTER, CONNECTOR_PKG.getResourceAdapter_OutboundResourceAdapter()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createConnectionDefinationTranslator(), - new Translator(TRANSACTION_SUPPORT, CONNECTOR_PKG.getOutboundResourceAdapter_TransactionSupport()), - createAuthMechanismTranslator14(CONNECTOR_PKG.getOutboundResourceAdapter_AuthenticationMechanisms()), - new BooleanTranslator(REAUTHENTICATION_SUPPORT, CONNECTOR_PKG.getOutboundResourceAdapter_ReauthenticationSupport()), - }); - return result; - } - - private Translator createInboundTranslator() { - GenericTranslator result = new GenericTranslator(INBOUND_RESOURCEADAPTER, CONNECTOR_PKG.getResourceAdapter_InboundResourceAdapter()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createMessageAdapterTranslator() - }); - - return result; - } - - private Translator createMessageAdapterTranslator() { - GenericTranslator result = new GenericTranslator(MESSAGEADAPTER, CONNECTOR_PKG.getInboundResourceAdapter_MessageAdapter()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createMessageListenerTranslator(), - }); - - return result; - } - - private Translator createMessageListenerTranslator() { - GenericTranslator result = new GenericTranslator(MESSAGELISTENER, CONNECTOR_PKG.getMessageAdapter_MessageListeners()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(MESSAGELISTENER_TYPE, CONNECTOR_PKG.getMessageListener_MessageListenerType()), - createActivationSpecTranslator() - }); - return result; - } - - private Translator createActivationSpecTranslator() { - GenericTranslator result = new GenericTranslator(ACTIVATIONSPEC, CONNECTOR_PKG.getMessageListener_ActivationSpec()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(ACTIVATIONSPEC_CLASS, CONNECTOR_PKG.getActivationSpec_ActivationSpecClass()), - createRequiredConfigPropertyTranslator() - }); - return result; - } - - private Translator createRequiredConfigPropertyTranslator() { - GenericTranslator result = new GenericTranslator(REQUIRED_CONFIG_PROPERTY, CONNECTOR_PKG.getActivationSpec_RequiredConfigProperties()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(CONNECTOR_PKG.getRequiredConfigPropertyType_Descriptions()), - new Translator(CONFIG_PROPERTY_NAME, CONNECTOR_PKG.getRequiredConfigPropertyType_Name()) - }); - return result; - } - - private Translator createAdminObjectTranslator() { - GenericTranslator result = new GenericTranslator(ADMINOBJECT, CONNECTOR_PKG.getResourceAdapter_AdminObjects()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(ADMINOBJECT_INTERFACE, CONNECTOR_PKG.getAdminObject_AdminObjectInterface()), - new Translator(ADMINOBJECT_CLASS, CONNECTOR_PKG.getAdminObject_AdminObjectClass()), - createConfigurationPropertyTranslator14(CONNECTOR_PKG.getAdminObject_ConfigProperties()) - - }); - return result; - } - - private Translator createConnectionDefinationTranslator() { - GenericTranslator result = new GenericTranslator(CONNECTION_DEFINITION, CONNECTOR_PKG.getOutboundResourceAdapter_ConnectionDefinitions()); - result.setChildren(new Translator[] { - new Translator(MANAGEDCONNECTIONFACTORY_CLASS, CONNECTOR_PKG.getConnectionDefinition_ManagedConnectionFactoryClass()), - createConfigurationPropertyTranslator14(CONNECTOR_PKG.getConnectionDefinition_ConfigProperties()), - new Translator(CONNECTIONFACTORY_INTERFACE, CONNECTOR_PKG.getConnectionDefinition_ConnectionFactoryInterface()), - new Translator(CONNECTIONFACTORY_IMPL_CLASS, CONNECTOR_PKG.getConnectionDefinition_ConnectionFactoryImplClass()), - new Translator(CONNECTION_INTERFACE, CONNECTOR_PKG.getConnectionDefinition_ConnectionInterface()), - new Translator(CONNECTION_IMPL_CLASS, CONNECTOR_PKG.getConnectionDefinition_ConnectionImplClass()), - }); - return result; - } - - public Translator createResourceAdapterTranslator13() { - GenericTranslator result = new GenericTranslator(RESOURCEADAPTER, CONNECTOR_PKG.getConnector_ResourceAdapter()); - result.setChildren(new Translator[] { - new Translator(MANAGEDCONNECTIONFACTORY_CLASS, CONNECTOR_PKG.getResourceAdapter_ManagedConnectionFactoryClass() ), - new Translator(CONNECTIONFACTORY_INTERFACE, CONNECTOR_PKG.getResourceAdapter_ConnectionFactoryInterface() ), - new Translator(CONNECTIONFACTORY_IMPL_CLASS, CONNECTOR_PKG.getResourceAdapter_ConnectionFactoryImplClass() ), - new Translator(CONNECTION_INTERFACE, CONNECTOR_PKG.getResourceAdapter_ConnectionInterface()), - new Translator(CONNECTION_IMPL_CLASS, CONNECTOR_PKG.getResourceAdapter_ConnectionImplClass()), - new Translator(TRANSACTION_SUPPORT, CONNECTOR_PKG.getResourceAdapter_TransactionSupport() ), - createConfigurationPropertyTranslator13(CONNECTOR_PKG.getResourceAdapter_ConfigProperties()), - createAuthMechanismTranslator13(CONNECTOR_PKG.getResourceAdapter_AuthenticationMechanisms()), - new BooleanTranslator(REAUTHENTICATION_SUPPORT, CONNECTOR_PKG.getResourceAdapter_ReauthenticationSupport()), - createSecurityPermissionsTranslator() - - - }); - return result; - } - - public Translator createSecurityPermissionsTranslator() { - GenericTranslator result = new GenericTranslator(SECURITY_PERMISSION, CONNECTOR_PKG.getResourceAdapter_SecurityPermissions()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, CONNECTOR_PKG.getSecurityPermission_Description()), - SECURITY_PERMISSION_SPEC_TRANSLATOR - }); - return result; - } - - public Translator createAuthMechanismTranslator13(EStructuralFeature afeature) { - GenericTranslator result = new GenericTranslator(AUTH_MECHANISM, afeature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, CONNECTOR_PKG.getAuthenticationMechanism_Description()), - AUTH_MECH_TYPE_TRANSLATOR, - CREDENTIAL_INTERFACE_TRANSLATOR - }); - return result; - } - - public Translator createAuthMechanismTranslator14(EStructuralFeature afeature) { - GenericTranslator result = new GenericTranslator(AUTH_MECHANISM, afeature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(CONNECTOR_PKG.getAuthenticationMechanism_Descriptions()), - AUTH_MECH_TYPE_TRANSLATOR, - CREDENTIAL_INTERFACE_TRANSLATOR - }); - return result; - } - - - public Translator createConfigurationPropertyTranslator13(EStructuralFeature afeature) { - GenericTranslator result = new GenericTranslator(CONFIG_PROPERTY, afeature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, CONNECTOR_PKG.getConfigProperty_Description()), - CONFIG_PROPERTY_NAME_TRANSLATOR, - CONFIG_PROPERTY_TYPE_TRANSLATOR, - CONFIG_PROPERTY_VALUE_TRANSLATOR - }); - return result; - } - - public Translator createConfigurationPropertyTranslator14(EStructuralFeature afeature) { - GenericTranslator result = new GenericTranslator(CONFIG_PROPERTY, afeature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(CONNECTOR_PKG.getConfigProperty_Descriptions()), - CONFIG_PROPERTY_NAME_TRANSLATOR, - CONFIG_PROPERTY_TYPE_TRANSLATOR, - CONFIG_PROPERTY_VALUE_TRANSLATOR - }); - return result; - } - - public Translator createLicenseTranslator13() { - GenericTranslator result = new GenericTranslator(LICENSE, CONNECTOR_PKG.getConnector_License()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, CONNECTOR_PKG.getLicense_Description()), - LICENSE_REQUIRED_TRANSLATOR - }); - return result; - } - - public Translator createLicenseTranslator14() { - GenericTranslator result = new GenericTranslator(LICENSE, CONNECTOR_PKG.getConnector_License()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(CONNECTOR_PKG.getLicense_Descriptions()), - LICENSE_REQUIRED_TRANSLATOR - }); - return result; - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/AbstractEJBTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/AbstractEJBTranslator.java deleted file mode 100644 index 896d4acf8..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/AbstractEJBTranslator.java +++ /dev/null @@ -1,146 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 31, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.model.translator.common.JavaClassTranslator; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author schacher - */ -public abstract class AbstractEJBTranslator extends Translator implements EjbDeploymentDescriptorXmlMapperI, J2EEVersionConstants { - protected static final EjbPackage EJB_PKG = EjbPackage.eINSTANCE; - protected static final CommonPackage COMMON_PKG = CommonPackage.eINSTANCE; - - - /** - * @param domNameAndPath - * @param aFeature - */ - public AbstractEJBTranslator(String domNameAndPath) { - super(domNameAndPath, EJB_PKG.getEJBJar_EnterpriseBeans()); - } - - - protected Translator[] create13Children() { - Translator[] start = getCommonBeginMaps13(); - Translator[] middle = getSpecificMaps(J2EE_1_3_ID); - Translator[] end = getEndMaps13(); - return (Translator[]) concat(start, concat(middle, end)); - } - - protected Translator[] create14Children() { - Translator[] start = getCommonBeginMaps14(); - Translator[] middle = getSpecificMaps(J2EE_1_4_ID); - Translator[] end = getEndMaps14(); - //Translator[] deploymentExt = getDeploymentExtensionMaps(); - return (Translator[]) concat(start, concat(middle, end)); - } - - protected Translator[] getCommonBeginMaps13() { - - Translator[] beginMaps = new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName()), - new Translator(SMALL_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon()), - new Translator(LARGE_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon()), - new Translator(EJB_NAME, EJB_PKG.getEnterpriseBean_Name()) - }; - - if (usesHomeRemoteAttributes()) - return (Translator[])concat(concat(beginMaps, getHomeRemoteMaps()), getEJBClassMap()); - return (Translator[])concat(beginMaps, getEJBClassMap()); - } - - - protected Translator[] getCommonBeginMaps14() { - - Translator[] beginMaps = new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - new Translator(EJB_NAME, EJB_PKG.getEnterpriseBean_Name()) - }; - if (usesHomeRemoteAttributes()) - return (Translator[])concat(concat(beginMaps, getHomeRemoteMaps()), getEJBClassMap()); - return (Translator[])concat(beginMaps, getEJBClassMap()); - } - - protected Translator[] getHomeRemoteMaps() { - return new Translator[] { - new JavaClassTranslator(HOME, EJB_PKG.getEnterpriseBean_HomeInterface()), - new JavaClassTranslator(REMOTE, EJB_PKG.getEnterpriseBean_RemoteInterface()), - //Begin EJB 2.0 - new JavaClassTranslator(LOCAL_HOME, EJB_PKG.getEnterpriseBean_LocalHomeInterface()), - new JavaClassTranslator(LOCAL, EJB_PKG.getEnterpriseBean_LocalInterface()) - //End EJB 2.0 - }; - } - - protected Translator[] getEJBClassMap() { - return new Translator[] { - new JavaClassTranslator(EJB_CLASS, EJB_PKG.getEnterpriseBean_EjbClass()) - }; - } - - protected boolean usesHomeRemoteAttributes() { - return true; - } - - - protected Translator[] getEndMaps13() { - return new Translator[] { - CommonTranslators.JNDI_REF_GROUP_ENV_ENTRY_1_3, - CommonTranslators.JNDI_REF_GROUP_EJB_REF_1_3, - CommonTranslators.JNDI_REF_GROUP_EJB_LOCAL_REF_1_3, - CommonTranslators.createSecurityRoleRefTranslator13(EJB_PKG.getEnterpriseBean_SecurityRoleRefs()), - new SecurityIdentityTranslator(), - CommonTranslators.JNDI_REF_GROUP_RESOURCE_REF_1_3, - CommonTranslators.JNDI_REF_GROUP_RESOURCE_ENV_REF_1_3 - }; - - } - - protected Translator[] getEndMaps14() { - return new Translator[] { - CommonTranslators.JNDI_REF_GROUP_ENV_ENTRY_1_4, - CommonTranslators.JNDI_REF_GROUP_EJB_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_EJB_LOCAL_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_SERVICE_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_RESOURCE_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_RESOURCE_ENV_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_MESSAGE_DEST_REF_1_4, - CommonTranslators.createSecurityRoleRefTranslator14(EJB_PKG.getEnterpriseBean_SecurityRoleRefs()), - new SecurityIdentityTranslator(), - }; - - } - - protected abstract Translator[] getSpecificMaps(int versionID); - -// protected Translator[] getDeploymentExtensionMaps(){ -// return new Translator[] { -// CommonTranslators.createDeploymentExtensionTranslator(EJB_PKG.getEnterpriseBean_Extensions()) -// }; -// } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/AcknowledgeModeTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/AcknowledgeModeTranslator.java deleted file mode 100644 index c8fef2562..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/AcknowledgeModeTranslator.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 31, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.ejb.AcknowledgeMode; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author schacher - */ -public class AcknowledgeModeTranslator extends Translator implements EjbDeploymentDescriptorXmlMapperI { - - public static final String AUTO_ACKNOWLEDGE = "Auto-acknowledge"; //$NON-NLS-1$ - public static final String DUPS_OK_ACKNOWLEDGE = "Dups-ok-acknowledge"; //$NON-NLS-1$ - /** - * @param domNameAndPath - * @param aFeature - */ - public AcknowledgeModeTranslator() { - super(ACKNOWLEDGE_MODE, EjbPackage.eINSTANCE.getMessageDriven_AcknowledgeMode()); - } - - - public Object convertStringToValue(String strValue, EObject owner) { - if (AUTO_ACKNOWLEDGE.equalsIgnoreCase(strValue)) - return AcknowledgeMode.AUTO_ACKNOWLEDGE_LITERAL; - else if (DUPS_OK_ACKNOWLEDGE.equalsIgnoreCase(strValue)) - return AcknowledgeMode.DUPS_OK_ACKNOWLEDGE_LITERAL; - else - return super.convertStringToValue(strValue, owner); - } - - public String convertValueToString(Object value, EObject owner) { - if (AcknowledgeMode.AUTO_ACKNOWLEDGE_LITERAL.equals(value)) - return AUTO_ACKNOWLEDGE; - else if (AcknowledgeMode.DUPS_OK_ACKNOWLEDGE_LITERAL.equals(value)) - return DUPS_OK_ACKNOWLEDGE; - else - return super.convertValueToString(value, owner); - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/CMPFieldTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/CMPFieldTranslator.java deleted file mode 100644 index 7861a6fe2..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/CMPFieldTranslator.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 2, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.jst.j2ee.ejb.CMPAttribute; -import org.eclipse.jst.j2ee.ejb.ContainerManagedEntity; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author administrator - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CMPFieldTranslator extends Translator implements EjbDeploymentDescriptorXmlMapperI { - public static EjbPackage EJB_PKG = EjbPackage.eINSTANCE; - public static Translator[] children; - public CMPFieldTranslator(){ - super(CMP_FIELD, EJB_PKG.getContainerManagedEntity_PersistentAttributes()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren() - */ - protected Translator[] getChildren() { - if (children == null) - children = createChildren(); - return children; - } - - protected Translator[] createChildren(){ - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION,EJB_PKG.getCMPAttribute_Description()), - new Translator(FIELD_NAME, EcorePackage.eINSTANCE.getENamedElement_Name()) - }; - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getMOFChildren(org.eclipse.emf.ecore.EObject) - */ - public List getMOFChildren(EObject mofObject) { - switch(((ContainerManagedEntity)mofObject).getVersionID()) { - - case J2EEVersionConstants.EJB_1_0_ID: - case J2EEVersionConstants.EJB_1_1_ID: - - return super.getMOFChildren(mofObject); - - case J2EEVersionConstants.EJB_2_0_ID: - case J2EEVersionConstants.EJB_2_1_ID: default: - - return get20CMPAttributes((ContainerManagedEntity)mofObject); - } - } - - public List get20CMPAttributes(ContainerManagedEntity cmp) { - List allAttributes, removed, result; - removed = null; - allAttributes = cmp.getPersistentAttributes(); - int size = allAttributes.size(); - CMPAttribute att = null; - for (int i = 0; i < size; i++) { - att = (CMPAttribute) allAttributes.get(i); - if (att.isDerived()) { - if (removed == null) - removed = new ArrayList(); - removed.add(att); - } - } - if (removed != null) { - result = new ArrayList(size); - result.addAll(allAttributes); - result.removeAll(removed); - } else - result = allAttributes; - return result; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/CMPVersionTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/CMPVersionTranslator.java deleted file mode 100644 index f1743cd16..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/CMPVersionTranslator.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 3, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.ejb.ContainerManagedEntity; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author schacher - */ -public class CMPVersionTranslator extends Translator implements EjbDeploymentDescriptorXmlMapperI { - - /** - * @param domNameAndPath - * @param eClass - */ - public CMPVersionTranslator() { - super(CMP_VERSION, EjbPackage.eINSTANCE.getContainerManagedEntity_Version()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getMOFValue(org.eclipse.emf.ecore.EObject) - */ - public Object getMOFValue(EObject mofObject) { - EJBJar parent = ((ContainerManagedEntity)mofObject).getEjbJar(); - if (parent.getVersionID() >= J2EEVersionConstants.EJB_2_0_ID) - return super.getMOFValue(mofObject); - return null; - } - - - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/ContainerManagedEntityTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/ContainerManagedEntityTranslator.java deleted file mode 100644 index ce47a35e9..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/ContainerManagedEntityTranslator.java +++ /dev/null @@ -1,447 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 31, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.ejb.EjbFactory; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author schacher - */ -public class ContainerManagedEntityTranslator extends EntityTranslator { - - private static Translator[] children13; - private static Translator[] children14; - /** - * @param domNameAndPath - * @param aFeature - */ - public ContainerManagedEntityTranslator() { - super(); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - return EjbFactory.eINSTANCE.createContainerManagedEntity(); - } - //TODO Uncomment all commented code and fix - /* - protected String extractStringValue(MapInfo map, EObject mofObject) { - if (map.getDOMName().equals(PRIMKEY_FIELD)) { - CMPAttribute attr = getContainerManagedEntity().getPrimaryKeyAttribute(); - return attr == null ? getSpecifiedPrimKeyFieldName() : attr.getName(); - } else - return super.extractStringValue(map, mofObject); - - } - - protected String getSpecifiedPrimKeyFieldName() { - return CMPSpecAdapter.getSpecifiedPrimKeyFieldName(getContainerManagedEntity()); - } - */ - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - switch (versionID) { - case (J2EE_1_2_ID) : - case (J2EE_1_3_ID) : - if (children13 == null) - children13 = create13Children(); - return children13; - default : - if (children14 == null) - children14 = create14Children(); - return children14; - } - } - - protected String getPersistenceType() { - return CONTAINER; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.internal.model.translator.ejb.EntityTranslator#getSpecificMaps() - */ - protected Translator[] getSpecificMaps(int versionID) { - Translator[] cmpTranslators = new Translator[] { - //Begin EJB 2.0 added - new CMPVersionTranslator(), - new Translator(ABSTRACT_SCHEMA_NAME, EJB_PKG.getContainerManagedEntity_AbstractSchemaName()), - //End EJB 2.0 added - - new CMPFieldTranslator(), - new PrimKeyFieldTranslator(), - }; - return (Translator[]) concat(super.getSpecificMaps(versionID), cmpTranslators); - } - - - protected Translator[] getEndMaps13() { - //Added for EJB 2.0 - Translator[] queryT = new Translator[] { - createQueryTranslators() - }; - return (Translator[]) concat(super.getEndMaps13(), queryT); - } - - protected Translator[] getEndMaps14() { - //Added for EJB 2.0 - Translator[] queryT = new Translator[] { - createQueryTranslators() - }; - return (Translator[]) concat(super.getEndMaps14(), queryT); - } - - public static Translator createQueryTranslators() { - GenericTranslator result = new GenericTranslator(QUERY, EJB_PKG.getContainerManagedEntity_Queries()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, EJB_PKG.getQuery_Description()), - createQueryMethodTranslators(), - new Translator(RESULT_TYPE_MAPPING, EJB_PKG.getQuery_ReturnTypeMapping()), - new Translator(EJB_QL, EJB_PKG.getQuery_EjbQL()) - }); - return result; - } - - public static Translator createQueryMethodTranslators() { - GenericTranslator result = new GenericTranslator(QUERY_METHOD, EJB_PKG.getQuery_QueryMethod()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(METHOD_NAME, EJB_PKG.getMethodElement_Name()), - new MethodParamsTranslator(EJB_PKG.getMethodElement_Parms()) - }); - return result; - } - - /* - protected void primUpdateDOMFeature(MapInfo map, Node node, EObject mofObject) { - if (map == noFeaturePrimKeyMapInfo) - return; - if (map.getDOMName().equals(CMP_VERSION)) { - updateDOMCmpVersionIfNecessary(map, node, mofObject); - return; - } - super.primUpdateDOMFeature(map, node, mofObject); - //If the primary key class has changed, this will impact the primary key field - if (map.getDOMName().equals(PRIM_KEY_CLASS)) { - String specifiedPrimKeyField = CMPSpecAdapter.getSpecifiedPrimKeyFieldName(getContainerManagedEntity()); - try { - super.primUpdateDOMFeature(noFeaturePrimKeyMapInfo, node, mofObject); - } finally { - CMPSpecAdapter.setPrimKeyFieldFromXml(specifiedPrimKeyField, getContainerManagedEntity()); - } - } - } - - - protected void updateDOMCmpVersionIfNecessary(MapInfo map, Node node, EObject mofObject) { - if (!(mofObject instanceof ContainerManagedEntity)) - return; - - EJBJar parent = ((ContainerManagedEntity)mofObject).getEjbJar(); - if (parent.isVersion2_0Descriptor()) - super.primUpdateDOMFeature(map, node, mofObject); - } - protected void primUpdateDOMMultiFeature(MapInfo map, Node node, EObject mofObject) { - if (map == featurePrimKeyMapInfo) - super.primUpdateDOMFeature(noFeaturePrimKeyMapInfo, node, mofObject); - else - super.primUpdateDOMMultiFeature(map, node, mofObject); - } - protected boolean primUpdateMOFFeature(MapInfo map, Node node, EObject mofObject) { - boolean hasChanged = super.primUpdateMOFFeature(map, node, mofObject); - //If the key class has changed, from the xml side, then we need to make sure we stamp the primkey field - //as being specified from xml, since we will not automatically remove that node - if (map.getDOMName().equals(PRIM_KEY_CLASS)) { - updateXmlKeyField(noFeaturePrimKeyMapInfo, node); - if (hasChanged) - updateMOFPrimKeyFieldFeature(featurePrimKeyMapInfo, getNode(), true); - } - return hasChanged; - } - protected void primUpdateMOFMultiFeature(MapInfo map, Node node, EObject mofObject) { - if (map == noFeaturePrimKeyMapInfo) - return; - if (map.getDOMName().equals(PRIMKEY_FIELD)) { - updateMOFPrimKeyFieldFeature(map, node, false); - } else if (map.getDOMName().equals(CMP_FIELD)) { - //cache the old list of cmp attributes before update - List cmpAttributesListCOPY = new ArrayList(); - cmpAttributesListCOPY.addAll(getContainerManagedEntity().getPersistentAttributes()); - - //do the update - super.primUpdateMOFMultiFeature(map, node, mofObject); - - List newCmpAttributeList = getContainerManagedEntity().getPersistentAttributes(); - //key the cmp attribute list and the key attribute list. - performKeySynchronization(cmpAttributesListCOPY, newCmpAttributeList); - } else - super.primUpdateMOFMultiFeature(map, node, mofObject); - } - /** - * Method that synchronizies the list of cmp attributes that are keys with the key attribute list. - * When keys are added and deleted from the cmp attribute list. - * - * @param List cmpAttributesListCOPY - Copy of the cmp attribute list before any attributes where added - * or removed. - * @param List newCmpAttributeList - List of cmp attributes after a modification has occured. - */ - /* - protected void performKeySynchronization( List cmpAttributesListCOPY, List newCmpAttributeList ) { - if( cmpAttributesListCOPY != null && newCmpAttributeList != null ) { - - //add and removes keys based on what the adapters give back - - List addedCmpAttributeList = getCmpAttributesDeltaList( cmpAttributesListCOPY, newCmpAttributeList ); - if( addedCmpAttributeList != null && !addedCmpAttributeList.isEmpty() ) { - //determine if any of the added attributes are keys, if so get a list of them. - List addedKeyAttributeList = getKeyAttributesFromList( addedCmpAttributeList, getContainerManagedEntity().getPrimaryKey() ); - //now, add the keys to the list. - addKeysToKeyAttributeList( addedKeyAttributeList, getContainerManagedEntity() ); - }// if - - List subtractedCmpAttributeList = getCmpAttributesDeltaList( newCmpAttributeList, cmpAttributesListCOPY ); - if( subtractedCmpAttributeList != null && !subtractedCmpAttributeList.isEmpty() ) { - //determine if any of the subtracted attributes are keys, if so get a list of them. - List subtractedKeyAttributeList = getKeyAttributesFromList( subtractedCmpAttributeList, getContainerManagedEntity().getPrimaryKey() ); - //now, subtract the keys from the list. - removeKeysFromKeyAttributeList( subtractedKeyAttributeList, getContainerManagedEntity() ); - }// if - - }// if - }// performKeySynchronization - - /** - * Remove a bunch of keys from the current key attribute list. - * - * @param List subtractedKeyAttributeList - The list of keys to subtract from the key attributes list. - * @param ContainerManagedEntity cmp - The current container managed entity. - */ - - /* - public static void removeKeysFromKeyAttributeList( List subtractedKeyAttributeList, ContainerManagedEntity cmp ) { - if( subtractedKeyAttributeList != null && !subtractedKeyAttributeList.isEmpty() ) { - //Subtract the key attributes from the container managed entity - Iterator kli = subtractedKeyAttributeList.iterator(); - - while( kli.hasNext() ) { - CMPAttribute cmpAttribute = (CMPAttribute)kli.next(); - String cmpAttributeName = cmpAttribute.getName(); - if( cmpAttributeName != null ) { - if( cmp != null && cmp.getKeyAttributes() != null ) { - List keyAttributeList = cmp.getKeyAttributes(); - keyAttributeList.remove( cmpAttribute ); - }// if - }// if - }// while - }// if - }// performKeySynchronization - - /** - * Adds a bunch of keys to the current key attribute list. - * - * @param List addedCmpAttributeList - The list of keys to add to the key attributes list. - * @param ContainerManagedEntity cmp - The current container managed entity. - */ - - /* - public static void addKeysToKeyAttributeList( List addedKeyAttributeList, ContainerManagedEntity cmp ) { - if( addedKeyAttributeList != null && !addedKeyAttributeList.isEmpty() ) { - //Add the key attributes to the container managed entity - Iterator kli = addedKeyAttributeList.iterator(); - - while( kli.hasNext() ) { - CMPAttribute cmpAttribute = (CMPAttribute)kli.next(); - String cmpAttributeName = cmpAttribute.getName(); - if( cmpAttributeName != null ) { - if( cmp != null && cmp.getKeyAttributes() != null ) - cmp.addKeyAttributeName( cmpAttributeName ); - }// if - }// while - }// if - }// addKeysToKeyAttributeList - - /** - * Gets the key attributes contained in the list. - * - * @param List attributeList - List of attributes. - * @param JavaClass primaryKey - The primary key of the cmp. - * @return List - */ - - /* - public static List getKeyAttributesFromList( List attributeList, JavaClass primaryKey ) { - if (primaryKey == null || attributeList == null || attributeList.isEmpty()) - return Collections.EMPTY_LIST; - - List foundKeyAttributeList = new ArrayList(); - Iterator it = attributeList.iterator(); - while( it.hasNext() ) { - CMPAttribute cmpAttr = (CMPAttribute)it.next(); - if( cmpAttr != null ) { - String cmpAttributeName = cmpAttr.getName(); - if (cmpAttributeName != null) { - Field keyField = primaryKey.getField(cmpAttributeName); - if (keyField != null) - foundKeyAttributeList.add(cmpAttr); - }// if - } //if - }// while - return foundKeyAttributeList; - }// getKeyAttributesFromList - - /** - * Gets the delta elements of two lists - * - * @param List firstList - The list that is being compared too. - * @param List secondList - The list to check the difference of. - * @return List - */ - - /* - protected List getCmpAttributesDeltaList( List firstList, List secondList ) { - List diffAttributeList = new ArrayList(); - - if( firstList != null && secondList != null ) { - Iterator it = secondList.iterator(); - while( it.hasNext() ) { - CMPAttribute cmpAttribute = (CMPAttribute)it.next(); - if( cmpAttribute != null && !firstList.contains( cmpAttribute ) ) { - diffAttributeList.add( cmpAttribute ); - }// if - }// while - return diffAttributeList; - }// if - return java.util.Collections.EMPTY_LIST; - }// getCmpAttributesDeltaList - - protected void updateMOFPrimKeyFieldFeature(MapInfo map, Node node, boolean force) { - Resource res = getEObject().eResource(); - boolean modFlag = res == null ? false : res.isModified(); - String keyField = getDOMText(map, node); - //Determine if the prim-key field has changed. If so, then recompute the keys; otherwise leave - //it alone - if (keyField != null) - keyField = keyField.trim(); - CMPAttribute existingKeyAtt = getContainerManagedEntity().getPrimaryKeyAttribute(); - String existingKeyField = existingKeyAtt == null ? null : existingKeyAtt.getName(); - if (!force - && ((keyField == null && existingKeyField == null) - || (keyField != null && keyField.equals(existingKeyField)) - || (existingKeyField != null && existingKeyField.equals(keyField)))) - return; - - try { - getContainerManagedEntity().clearKeyAttributes(); //necessary to clear reflected flag - CMPAttribute keyAtt = null; - CMPSpecAdapter.setPrimKeyFieldFromXml(keyField, getContainerManagedEntity()); - if (keyField != null) { - keyAtt = getContainerManagedEntity().addKeyAttributeName(keyField, false); - if (keyAtt != null) { - //This is an invalid state. - String className = getContainerManagedEntity().getPrimaryKeyName(); - JavaClass ref = null; - if (className != null) - ref = JavaClassImpl.createClassRef(className); - keyAtt.setEType(ref); - } - } else { - //Hack to force the UI to refresh - EList keys = getContainerManagedEntity().getKeyAttributes(); - if (!keys.isEmpty()) - keys.set(0, keys.get(0)); - } - } finally { - if (res != null && res.isTrackingModification()) - res.setModified(modFlag); - } - } - protected void updateXmlKeyField(MapInfo map, Node node) { - String keyField = getDOMText(map, node); - CMPSpecAdapter.setPrimKeyFieldFromXml(keyField, getContainerManagedEntity()); - } - - /** - * @see AbstractDOMNodeAdapter#getMOFChildren(EObject, MapInfo) - */ - /* - protected List getMOFChildren(EObject mofObject, MapInfo map) { - if (getContainerManagedEntity().isVersion2_X() && CMP_FIELD.equals(map.getDOMName())) - return get20CMPAttributes((ContainerManagedEntity)mofObject); - else - return super.getMOFChildren(mofObject, map); - } - - /** - * Method get20CMPAttributes. - * @param containerManagedEntity - * @return List - */ - - /* - private List get20CMPAttributes(ContainerManagedEntity cmp) { - List allAttributes, removed, result; - removed = null; - allAttributes = cmp.getPersistentAttributes(); - int size = allAttributes.size(); - CMPAttribute att = null; - for (int i = 0; i < size; i++) { - att = (CMPAttribute) allAttributes.get(i); - if (att.isDerived()) { - if (removed == null) - removed = new ArrayList(); - removed.add(att); - } - } - if (removed != null) { - result = new ArrayList(size); - result.addAll(allAttributes); - result.removeAll(removed); - } else - result = allAttributes; - return result; - } - - /** - * @see com.ibm.etools.mof2dom.AbstractDOMNodeAdapter#notifyChanged(new ENotificationImpl((InternalEObject)Notifier, int,(EStructuralFeature) EObject, Object, Object, int)) - */ - - /* - public void notifyChanged(Notification notification) { - if (notification.getEventType() == ContainerManagedEntity.DERIVED_FLAG_CHANGE) - updateDOMFeature(getMap(CMP_FIELD), getNode(), getEObject()); - else - super.notifyChanged(notification); - } - - private MapInfo getMap(String aNodeName) { - for (int i = 0; i < fMaps.length; i++) { - if (aNodeName.equals(fMaps[i].getDOMName())) - return fMaps[i]; - } - return null; - } - */ - } - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/EJBJarTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/EJBJarTranslator.java deleted file mode 100644 index 49afd53cc..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/EJBJarTranslator.java +++ /dev/null @@ -1,426 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 27, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.model.translator.common.JavaClassTranslator; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.RootTranslator; -import org.eclipse.wst.common.internal.emf.resource.SourceLinkTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; -import org.eclipse.wst.common.internal.emf.resource.TranslatorPath; - -/** - * @author schacher - */ -public class EJBJarTranslator extends RootTranslator implements EjbDeploymentDescriptorXmlMapperI, J2EEConstants { - private static final EjbPackage EJB_PKG = EjbPackage.eINSTANCE; - private static CommonPackage COMMON_PKG = CommonPackage.eINSTANCE; - public static EJBJarTranslator INSTANCE = new EJBJarTranslator(); - private static Translator[] children13; - private static Translator[] children14; - - public static TranslatorPath ENTERPRISE_BEAN_NAME_TRANSLATOR_PATH = - new TranslatorPath( - new Translator[] { - new Translator(EJB_JAR, ROOT_FEATURE), - new Translator(EnterpriseBeansTranslator.ENTERPRISE_BEANS_PATH, EJB_PKG.getEJBJar_EnterpriseBeans()), - new Translator(EJB_NAME, EJB_PKG.getEnterpriseBean_Name())}); - - - private static final Translator CMR_FIELD_NAME_TRANSLATOR = new Translator(CMR_FIELD_NAME, EcorePackage.eINSTANCE.getENamedElement_Name()); - private static final Translator CMR_FIELD_TYPE_TRANSLATOR = new JavaClassTranslator(CMR_FIELD_TYPE, EJB_PKG.getCMRField_CollectionType()); - private static final Translator ROLE_SOURCE_EJB_NAME_SOURCELINK_TRANSLATOR = new SourceLinkTranslator(EJB_NAME, EJB_PKG.getRoleSource_EntityBean(), ENTERPRISE_BEAN_NAME_TRANSLATOR_PATH); - private static final Translator EJB_RELATIONSHIP_ROLE_NAME_TRANSLATOR = new Translator(EJB_RELATIONSHIP_ROLE_NAME, EJB_PKG.getEJBRelationshipRole_RoleName()); - private static final Translator MULTIPLICITY_TRANSLATOR = new MultiplicityTranslator(); - private static final Translator CASCADE_DELETE_TRANSLATOR = new Translator(CASCADE_DELETE, EJB_PKG.getEJBRelationshipRole_CascadeDelete(), Translator.EMPTY_TAG); - private static final Translator EJB_RELATION_NAME_TRANSLATOR = new Translator(EJB_RELATION_NAME, EJB_PKG.getEJBRelation_Name()); - private static final Translator UNCHECKED_TRANSLATOR = new Translator(UNCHECKED, EJB_PKG.getMethodPermission_Unchecked(), Translator.EMPTY_TAG); - private static final Translator METHOD_PERMISSION_ROLE_NAME_SOURCELINK_TRANSLATOR = new SourceLinkTranslator(ROLE_NAME,EJB_PKG.getMethodPermission_Roles(),new TranslatorPath( - new Translator[] { - new Translator(ASSEMBLY_DESCRIPTOR, CONTAINER_FEATURE), - new Translator(SECURITY_ROLE, EJB_PKG.getAssemblyDescriptor_SecurityRoles()), - new Translator(ROLE_NAME, CommonPackage.eINSTANCE.getSecurityRole_RoleName()) - })); - private static final Translator SEC_ROLE_NAME_TRANSLATOR = new Translator(ROLE_NAME, CommonPackage.eINSTANCE.getSecurityRole_RoleName(), new TranslatorPath( - new Translator[] { - new Translator(ASSEMBLY_DESCRIPTOR, CONTAINER_FEATURE), - new Translator(METHOD_PERMISSION, EJB_PKG.getAssemblyDescriptor_MethodPermissions()), - new Translator(SECURITY_ROLE, EJB_PKG.getMethodPermission_Roles()), - new Translator(ROLE_NAME, CommonPackage.eINSTANCE.getSecurityRole_RoleName()) - })); - - private static final Translator TRANS_ATTRIBUTE_TRANSLATOR = new Translator(TRANS_ATTRIBUTE, EJB_PKG.getMethodTransaction_TransactionAttribute()); - private static final Translator METHOD_ELEMENT_EJB_NAME_SOURCELINK_TRANSLATOR = new SourceLinkTranslator(EJB_NAME, EJB_PKG.getMethodElement_EnterpriseBean(), EJBJarTranslator.ENTERPRISE_BEAN_NAME_TRANSLATOR_PATH); - private static final Translator METHOD_NAME_TRANSLATOR = new Translator(METHOD_NAME, EJB_PKG.getMethodElement_Name()); - private static final Translator METHOD_PARAM_TRANSLATOR = new MethodParamsTranslator(EJB_PKG.getMethodElement_Parms()); - private static final Translator METHOD_ELEMENT_KIND_TRANSLATOR = new MethodElementKindTranslator(); - - public EJBJarTranslator() { - super(EJB_JAR, EJB_PKG.getEJBJar()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - switch (versionID) { - case (J2EE_1_2_ID) : - case (J2EE_1_3_ID) : - if (children13 == null) - children13 = create13Children(); - return children13; - default : - if (children14 == null) - children14 = create14Children(); - return children14; - } - } - - protected Translator[] create13Children() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName()), - new Translator(SMALL_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon()), - new Translator(LARGE_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon()), - new EnterpriseBeansTranslator(), - createRelationshipsTranslator13(), - createAssemblyDescriptorTranslator13(), - new Translator(EJB_CLIENT_JAR, EJB_PKG.getEJBJar_EjbClientJar()), - }; - } - - protected Translator[] create14Children() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(VERSION, EJB_PKG.getEJBJar_Version(), DOM_ATTRIBUTE), - new ConstantAttributeTranslator(XML_NS, J2EE_NS_URL), - new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL), - new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, J2EE_NS_URL+' '+EJB_JAR_SCHEMA_LOC_2_1), - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - new EnterpriseBeansTranslator(), - createRelationshipsTranslator14(), - createAssemblyDescriptorTranslator14(), - new Translator(EJB_CLIENT_JAR, EJB_PKG.getEJBJar_EjbClientJar()), - // CommonTranslators.createDeploymentExtensionTranslator(EJB_PKG.getEJBJar_Extensions()) - }; - } - - public static Translator createRelationshipsTranslator13() { - GenericTranslator result = new GenericTranslator(RELATIONSHIPS, EJB_PKG.getEJBJar_RelationshipList()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, EJB_PKG.getRelationships_Description()), - createEJBRelationsTranslator13(), - }); - return result; - } - - private static Translator createEJBRelationsTranslator13() { - GenericTranslator result = new GenericTranslator(EJB_RELATION, EJB_PKG.getRelationships_EjbRelations()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, EJB_PKG.getEJBRelation_Description()), - EJB_RELATION_NAME_TRANSLATOR, - createEJBRelationshipRoleTranslator13(), - }); - return result; - } - - private static Translator createEJBRelationshipRoleTranslator13() { - GenericTranslator result = new GenericTranslator(EJB_RELATIONSHIP_ROLE, EJB_PKG.getEJBRelation_RelationshipRoles()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, EJB_PKG.getEJBRelationshipRole_Description()), - EJB_RELATIONSHIP_ROLE_NAME_TRANSLATOR, - MULTIPLICITY_TRANSLATOR, - CASCADE_DELETE_TRANSLATOR, - createRelationshipRoleSourceTranslator13(), - createCMRFieldTranslator13(), - }); - return result; - } - - private static Translator createRelationshipRoleSourceTranslator13() { - GenericTranslator result = new GenericTranslator(RELATIONSHIP_ROLE_SOURCE, EJB_PKG.getEJBRelationshipRole_Source()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, EJB_PKG.getRoleSource_Description()), - ROLE_SOURCE_EJB_NAME_SOURCELINK_TRANSLATOR, - }); - return result; - } - - private static Translator createCMRFieldTranslator13() { - GenericTranslator result = new GenericTranslator(CMR_FIELD, EJB_PKG.getEJBRelationshipRole_CmrField()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, EJB_PKG.getCMPAttribute_Description()), - CMR_FIELD_NAME_TRANSLATOR, - CMR_FIELD_TYPE_TRANSLATOR - }); - return result; - } - - - /** - * J2EE 1.4 Relationship - * - */ - public static Translator createRelationshipsTranslator14() { - GenericTranslator result = new GenericTranslator(RELATIONSHIPS, EJB_PKG.getEJBJar_RelationshipList()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(EJB_PKG.getRelationships_Descriptions()), - createEJBRelationsTranslator14(), - // CommonTranslators.createDeploymentExtensionTranslator(EJB_PKG.getRelationships_Extensions()) - }); - return result; - } - - private static Translator createEJBRelationsTranslator14() { - GenericTranslator result = new GenericTranslator(EJB_RELATION, EJB_PKG.getRelationships_EjbRelations()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(EJB_PKG.getEJBRelation_Descriptions()), - EJB_RELATION_NAME_TRANSLATOR, - createEJBRelationshipRoleTranslator14(), - // CommonTranslators.createDeploymentExtensionTranslator(EJB_PKG.getEJBRelation_Extensions()) - }); - return result; - } - - private static Translator createEJBRelationshipRoleTranslator14() { - GenericTranslator result = new GenericTranslator(EJB_RELATIONSHIP_ROLE, EJB_PKG.getEJBRelation_RelationshipRoles()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(EJB_PKG.getEJBRelationshipRole_Descriptions()), - EJB_RELATIONSHIP_ROLE_NAME_TRANSLATOR, - MULTIPLICITY_TRANSLATOR, - CASCADE_DELETE_TRANSLATOR, - createRelationshipRoleSourceTranslator14(), - createCMRFieldTranslator14(), - // CommonTranslators.createDeploymentExtensionTranslator(EJB_PKG.getEJBRelationshipRole_Extensions()) - }); - return result; - } - - private static Translator createRelationshipRoleSourceTranslator14() { - GenericTranslator result = new GenericTranslator(RELATIONSHIP_ROLE_SOURCE, EJB_PKG.getEJBRelationshipRole_Source()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(EJB_PKG.getRoleSource_Descriptions()), - ROLE_SOURCE_EJB_NAME_SOURCELINK_TRANSLATOR - }); - return result; - } - - private static Translator createCMRFieldTranslator14() { - GenericTranslator result = new GenericTranslator(CMR_FIELD, EJB_PKG.getEJBRelationshipRole_CmrField()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(EJB_PKG.getCMPAttribute_Descriptions()), - CMR_FIELD_NAME_TRANSLATOR, - CMR_FIELD_TYPE_TRANSLATOR, - // CommonTranslators.createDeploymentExtensionTranslator(EJB_PKG.getCMPAttribute_Extensions()) - }); - return result; - } - - /* - * <= J2EE 1.3 Assembly Descriptor - */ - public static Translator createAssemblyDescriptorTranslator13() { - GenericTranslator result = new GenericTranslator(ASSEMBLY_DESCRIPTOR, EJB_PKG.getEJBJar_AssemblyDescriptor()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - createSecurityRoleTranslator13(), - createMethodPermissionTranslator13(), - createMethodTransactionTranslator13(), - createExcludesListTranslator13(), - }); - return result; - } - - public static Translator createMethodPermissionTranslator13() { - GenericTranslator result = new GenericTranslator(METHOD_PERMISSION, EJB_PKG.getAssemblyDescriptor_MethodPermissions()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, EJB_PKG.getMethodPermission_Description()), - UNCHECKED_TRANSLATOR, - METHOD_PERMISSION_ROLE_NAME_SOURCELINK_TRANSLATOR, - createMethodElementTranslators13(EJB_PKG.getMethodPermission_MethodElements()) - }); - - return result; - } - - //TODO: NEED TO FIGURE OUT SECURITY PATH - public static Translator createSecurityRoleTranslator13() { - GenericTranslator result = new GenericTranslator(SECURITY_ROLE, EJB_PKG.getAssemblyDescriptor_SecurityRoles()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, CommonPackage.eINSTANCE.getSecurityRole_Description()), - SEC_ROLE_NAME_TRANSLATOR - }); - - return result; - } - - public static Translator createMethodTransactionTranslator13() { - GenericTranslator result = new GenericTranslator(CONTAINER_TRANSACTION, EJB_PKG.getAssemblyDescriptor_MethodTransactions()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, EJB_PKG.getMethodTransaction_Description()), - createMethodElementTranslators13(EJB_PKG.getMethodTransaction_MethodElements()), - TRANS_ATTRIBUTE_TRANSLATOR - }); - - return result; - } - - public static Translator createExcludesListTranslator13() { - GenericTranslator result = new GenericTranslator(EXCLUDE_LIST, EJB_PKG.getAssemblyDescriptor_ExcludeList()); - result.setChildren( new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, EJB_PKG.getExcludeList_Description()), - createMethodElementTranslators13(EJB_PKG.getExcludeList_MethodElements()) - }); - return result; - } - - public static Translator createMethodElementTranslators13(EStructuralFeature eFeature) { - GenericTranslator result = new GenericTranslator(METHOD, eFeature); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, EJB_PKG.getMethodElement_Description()), - METHOD_ELEMENT_EJB_NAME_SOURCELINK_TRANSLATOR, - METHOD_ELEMENT_KIND_TRANSLATOR, - METHOD_NAME_TRANSLATOR, - METHOD_PARAM_TRANSLATOR - }); - return result; - } - - - /* - * J2EE 1.4 Assembly Descriptor - */ - public static Translator createAssemblyDescriptorTranslator14() { - GenericTranslator result = new GenericTranslator(ASSEMBLY_DESCRIPTOR, EJB_PKG.getEJBJar_AssemblyDescriptor()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - createSecurityRoleTranslator14(), - createMethodPermissionTranslator14(), - createMethodTransactionTranslator14(), - CommonTranslators.createMessageDestinationTranslator(EJB_PKG.getAssemblyDescriptor_MessageDestinations()), - createExcludesListTranslator14(), - // CommonTranslators.createDeploymentExtensionTranslator(EJB_PKG.getAssemblyDescriptor_Extensions()) - }); - return result; - } - - public static Translator createMethodPermissionTranslator14() { - GenericTranslator result = new GenericTranslator(METHOD_PERMISSION, EJB_PKG.getAssemblyDescriptor_MethodPermissions()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(EJB_PKG.getMethodPermission_Descriptions()), - UNCHECKED_TRANSLATOR, - METHOD_PERMISSION_ROLE_NAME_SOURCELINK_TRANSLATOR, - createMethodElementTranslators14(EJB_PKG.getMethodPermission_MethodElements()) - }); - - return result; - } - - //TODO: NEED TO FIGURE OUT SECURITY PATH - public static Translator createSecurityRoleTranslator14() { - GenericTranslator result = new GenericTranslator(SECURITY_ROLE, EJB_PKG.getAssemblyDescriptor_SecurityRoles()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(CommonPackage.eINSTANCE.getSecurityRole_Descriptions()), - SEC_ROLE_NAME_TRANSLATOR - }); - - return result; - } - - public static Translator createMethodTransactionTranslator14() { - GenericTranslator result = new GenericTranslator(CONTAINER_TRANSACTION, EJB_PKG.getAssemblyDescriptor_MethodTransactions()); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(EJB_PKG.getMethodTransaction_Descriptions()), - createMethodElementTranslators14(EJB_PKG.getMethodTransaction_MethodElements()), - TRANS_ATTRIBUTE_TRANSLATOR - }); - - return result; - } - - public static Translator createExcludesListTranslator14() { - GenericTranslator result = new GenericTranslator(EXCLUDE_LIST, EJB_PKG.getAssemblyDescriptor_ExcludeList()); - result.setChildren( new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(EJB_PKG.getExcludeList_Descriptions()), - createMethodElementTranslators14(EJB_PKG.getExcludeList_MethodElements()) - }); - return result; - } - - public static Translator createMethodElementTranslators14(EStructuralFeature eFeature) { - GenericTranslator result = new GenericTranslator(METHOD, eFeature); - result.setChildren( - new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createDescriptionTranslator(EJB_PKG.getMethodElement_Descriptions()), - METHOD_ELEMENT_EJB_NAME_SOURCELINK_TRANSLATOR, - METHOD_ELEMENT_KIND_TRANSLATOR, - METHOD_NAME_TRANSLATOR, - METHOD_PARAM_TRANSLATOR - }); - return result; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/EnterpriseBeansTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/EnterpriseBeansTranslator.java deleted file mode 100644 index eba27c161..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/EnterpriseBeansTranslator.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 27, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.MultiObjectTranslator; -import org.eclipse.wst.common.internal.emf.resource.ReadAheadHelper; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author schacher - */ -public class EnterpriseBeansTranslator extends MultiObjectTranslator implements EjbDeploymentDescriptorXmlMapperI { - public static final String ENTERPRISE_BEANS_PATH = ENTERPRISE_BEANS+'/'+ENTITY+','+SESSION+','+MESSAGE_DRIVEN; - private static final EjbPackage EJB_PKG = EjbPackage.eINSTANCE; - private static final SessionTranslator SESSION_TRANSLATOR = new SessionTranslator(); - private static final EntityTranslator BMP_TRANSLATOR = new EntityTranslator(); - private static final ContainerManagedEntityTranslator CMP_TRANSLATOR= new ContainerManagedEntityTranslator(); - private static final MessageDrivenTranslator MESSAGE_DRIVEN_TRANSLATOR = new MessageDrivenTranslator(); - private static Map delegates; - static { - delegates = new HashMap(7); - delegates.put(SESSION, SESSION_TRANSLATOR); - delegates.put(BEAN, BMP_TRANSLATOR); - delegates.put(CONTAINER, CMP_TRANSLATOR); - delegates.put(MESSAGE_DRIVEN, MESSAGE_DRIVEN_TRANSLATOR); - } - - /** - * @param domNameAndPath - * @param eClass - */ - public EnterpriseBeansTranslator() { - super(ENTERPRISE_BEANS_PATH, EJB_PKG.getEJBJar_EnterpriseBeans()); - addReadAheadHelper(new ReadAheadHelper(ENTITY, new String[] {BEAN, CONTAINER}, PERSISTENCE_TYPE )); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.MultiObjectTranslator#getDelegateFor(org.eclipse.emf.ecore.EObject) - */ - public Translator getDelegateFor(EObject o) { - switch (o.eClass().getClassifierID()) { - case EjbPackage.SESSION : - return SESSION_TRANSLATOR; - case EjbPackage.ENTITY: - return BMP_TRANSLATOR; - case EjbPackage.CONTAINER_MANAGED_ENTITY: - return CMP_TRANSLATOR; - case EjbPackage.MESSAGE_DRIVEN: - return MESSAGE_DRIVEN_TRANSLATOR; - } - throw new IllegalStateException("Bean type delegate expected"); //$NON-NLS-1$ - } - - public Translator getDelegateFor(String domName, String readAheadName) { - Translator result = null; - if (readAheadName != null) - result = (Translator) delegates.get(readAheadName); - else - result = (Translator) delegates.get(domName); - - if (result == null) - throw new IllegalStateException("Bean type delegate expected"); //$NON-NLS-1$ - - return result; - } - - - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/EntityTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/EntityTranslator.java deleted file mode 100644 index ef05ac4a9..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/EntityTranslator.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 31, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jst.j2ee.ejb.EjbFactory; -import org.eclipse.jst.j2ee.internal.model.translator.common.BooleanTranslator; -import org.eclipse.jst.j2ee.internal.model.translator.common.JavaClassTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author schacher - */ -public class EntityTranslator extends AbstractEJBTranslator { - - private static Translator[] children13; - private static Translator[] children14; - - private class PersistenceTypeTranslator extends Translator { - - public PersistenceTypeTranslator() { - super(PERSISTENCE_TYPE, (EStructuralFeature) null); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#extractStringValue(org.eclipse.emf.ecore.EObject) - */ - public String extractStringValue(EObject emfObject) { - return getPersistenceType(); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#convertValueToString(java.lang.Object, org.eclipse.emf.ecore.EObject) - */ - public String convertValueToString(Object value, EObject owner) { - return getPersistenceType(); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getMOFChildren(org.eclipse.emf.ecore.EObject) - */ - public List getMOFChildren(EObject mofObject) { - return Collections.singletonList(getPersistenceType()); - } - - - } - - protected String getPersistenceType() { - return BEAN; - } - /** - * @param domNameAndPath - * @param aFeature - */ - public EntityTranslator() { - super(ENTERPRISE_BEANS + '/' + ENTITY); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.internal.model.translator.ejb.AbstractEJBTranslator#getSpecificMaps() - */ - protected Translator[] getSpecificMaps(int versionID) { - Translator reentrantTranslator = null; - switch (versionID) { - case J2EE_1_2_ID : - case J2EE_1_3_ID : - reentrantTranslator = new Translator(REENTRANT, EJB_PKG.getEntity_Reentrant(), UNSET_IF_NULL); - break; - case J2EE_1_4_ID : - reentrantTranslator = new BooleanTranslator(REENTRANT, EJB_PKG.getEntity_Reentrant()); - default : - break; - } - return new Translator[] { new PersistenceTypeTranslator(), new JavaClassTranslator(PRIM_KEY_CLASS, EJB_PKG.getEntity_PrimaryKey()), reentrantTranslator }; - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - return EjbFactory.eINSTANCE.createEntity(); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - switch (versionID) { - case (J2EE_1_2_ID) : - case (J2EE_1_3_ID) : - if (children13 == null) - children13 = create13Children(); - return children13; - default : - if (children14 == null) - children14 = create14Children(); - return children14; - } - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MessageDrivenDestinationTypeTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MessageDrivenDestinationTypeTranslator.java deleted file mode 100644 index 724902835..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MessageDrivenDestinationTypeTranslator.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 3, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author administrator - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class MessageDrivenDestinationTypeTranslator extends Translator implements EjbDeploymentDescriptorXmlMapperI { - protected static final EjbPackage EJB_PKG = EjbPackage.eINSTANCE; - public static final String JAVAX_JMS = "javax.jms."; //$NON-NLS-1$ - - - public MessageDrivenDestinationTypeTranslator() { - super(DESTINATION_TYPE, EJB_PKG.getMessageDrivenDestination_Type()); - } - - /** - * @see com.ibm.etools.emf2xml.impl.Translator#convertValueToString(java.lang.Object, org.eclipse.emf.ecore.EObject) - */ - public String convertValueToString(Object value, EObject owner) { - if (value != null){ - Enumerator enumerator = (Enumerator) value; - if (enumerator != null) - return JAVAX_JMS + enumerator.toString(); - } - return super.convertValueToString(value, owner); - } - - /** - * @see com.ibm.etools.emf2xml.impl.Translator#convertStringToValue(java.lang.String, org.eclipse.emf.ecore.EObject) - */ - public Object convertStringToValue(String strValue, EObject owner) { - String correct = strValue; - if (strValue != null) - correct = strValue.substring(JAVAX_JMS.length()); - return super.convertStringToValue(correct, owner); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MessageDrivenTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MessageDrivenTranslator.java deleted file mode 100644 index 8d9c762b7..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MessageDrivenTranslator.java +++ /dev/null @@ -1,179 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 31, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.ejb.EjbFactory; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.model.translator.common.JavaClassTranslator; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class MessageDrivenTranslator extends AbstractEJBTranslator { - private static Translator[] children13; - private static Translator[] children14; - - private static Translator TRANSACTION_TYPE_XLATOR = new Translator(TRANSACTION_TYPE, EJB_PKG.getMessageDriven_TransactionType()); - - /** - * @param domNameAndPath - * @param aFeature - */ - public MessageDrivenTranslator() { - super(ENTERPRISE_BEANS+'/'+MESSAGE_DRIVEN); - } - - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.internal.model.translator.ejb.AbstractEJBTranslator#getSpecificMaps() - */ - protected Translator[] getSpecificMaps(int versionID) { - switch (versionID) { - case J2EE_1_4_ID: - return getSpecificMaps14(); - default: - return getSpecificMaps13(); - } - } - - protected Translator[] getSpecificMaps13() { - - return new Translator[] { - TRANSACTION_TYPE_XLATOR, - - //EJB 2.0 PATH - new Translator(MESSAGE_SELECTOR, EJB_PKG.getMessageDriven_MessageSelector()), - new AcknowledgeModeTranslator(), - createMessageDrivenDestinationTranslator(), - - }; - } - - protected Translator[] getSpecificMaps14() { - - return new Translator[] { - //EJB 2.1 Only - new JavaClassTranslator(MESSAGING_TYPE, EJB_PKG.getMessageDriven_MessagingType()), - //Both - TRANSACTION_TYPE_XLATOR, - //EJB 2.1 PATH - new JavaClassTranslator(MESSAGE_DEST_TYPE, EJB_PKG.getMessageDriven_MessageDestination()), - new Translator(MESSAGE_DEST_LINK, EJB_PKG.getMessageDriven_Link()), - createActivationConfigurationMaps(), - }; - } - - - /** - * @return - */ - private Translator createActivationConfigurationMaps() { - GenericTranslator result = new GenericTranslator(ACTIVATION_CONF, EJB_PKG.getMessageDriven_ActivationConfig()); - result.setChildren(new Translator[]{ - CommonTranslators.createDescriptionTranslator(EJB_PKG.getActivationConfig_Descriptions()), - createActivationConfigPropertiesMap(), - // CommonTranslators.createDeploymentExtensionTranslator(EJB_PKG.getActivationConfig_Extensions()) - }); - - return result; - } - - - /** - * @return - */ - private Translator createActivationConfigPropertiesMap() { - GenericTranslator result = new GenericTranslator(ACTIVATION_CONF_PROPERTY, EJB_PKG.getActivationConfig_ConfigProperties()); - result.setChildren(new Translator[] { - new Translator(ACTIVATION_CONF_PROPERTY_NAME, EJB_PKG.getActivationConfigProperty_Name()), - new Translator(ACTIVATION_CONF_PROPERTY_VALUE, EJB_PKG.getActivationConfigProperty_Value()) - }); - return result; - } - - - /** - * @return - */ - protected Translator createMessageDrivenDestinationTranslator() { - GenericTranslator result = new GenericTranslator(MESSAGE_DRIVEN_DESTINATION,EJB_PKG.getMessageDriven_Destination()); - result.setChildren( new Translator[]{ - new MessageDrivenDestinationTypeTranslator(), - new Translator(SUBSCRIPTION_DURABILITY, EJB_PKG.getMessageDrivenDestination_SubscriptionDurability()) - }); - return result; - } - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - switch (versionID) { - case (J2EE_1_2_ID) : - case (J2EE_1_3_ID) : - if (children13 == null) - children13 = create13Children(); - return children13; - default : - if (children14 == null) - children14 = create14Children(); - return children14; - } - } - - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - return EjbFactory.eINSTANCE.createMessageDriven(); - } - - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.internal.model.translator.ejb.AbstractEJBTranslator#getEndMaps13() - */ - protected Translator[] getEndMaps13() { - return new Translator[] { - CommonTranslators.JNDI_REF_GROUP_ENV_ENTRY_1_3, - CommonTranslators.JNDI_REF_GROUP_EJB_REF_1_3, - CommonTranslators.JNDI_REF_GROUP_EJB_LOCAL_REF_1_3, - new SecurityIdentityTranslator(), - CommonTranslators.JNDI_REF_GROUP_RESOURCE_REF_1_3, - CommonTranslators.JNDI_REF_GROUP_RESOURCE_ENV_REF_1_3 - }; - } - - protected Translator[] getEndMaps14() { - return new Translator[] { - CommonTranslators.JNDI_REF_GROUP_ENV_ENTRY_1_4, - CommonTranslators.JNDI_REF_GROUP_EJB_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_EJB_LOCAL_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_SERVICE_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_RESOURCE_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_RESOURCE_ENV_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_MESSAGE_DEST_REF_1_4, - new SecurityIdentityTranslator(), - }; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.internal.model.translator.ejb.AbstractEJBTranslator#usesHomeRemoteAttributes() - */ - protected boolean usesHomeRemoteAttributes() { - return false; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MethodElementKindTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MethodElementKindTranslator.java deleted file mode 100644 index 668735ab5..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MethodElementKindTranslator.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.ejb.MethodElement; -import org.eclipse.jst.j2ee.ejb.MethodElementKind; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class MethodElementKindTranslator extends Translator implements EjbDeploymentDescriptorXmlMapperI { - private static final EjbPackage EJB_PKG = EjbPackage.eINSTANCE; - /** - * @param domNameAndPath - * @param eClass - */ - public MethodElementKindTranslator(){ - super(METHOD_INTF, EJB_PKG.getMethodElement_Type()); - } - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#convertStringToValue(java.lang.String, org.eclipse.emf.ecore.EObject) - */ - public Object convertStringToValue(String strValue, EObject owner) { - Object obj = super.convertStringToValue(strValue, owner); - if(obj != null) - return obj; - String correct = strValue; - if (strValue.equalsIgnoreCase("HOME")) //$NON-NLS-1$ - correct = "Home"; //$NON-NLS-1$ - else if (strValue.equalsIgnoreCase("REMOTE")) //$NON-NLS-1$ - correct = "Remote"; //$NON-NLS-1$ - else if (strValue.equalsIgnoreCase("LOCALHOME")) //$NON-NLS-1$ - correct = "LocalHome"; //$NON-NLS-1$ - else if (strValue.equalsIgnoreCase("LOCAL")) //$NON-NLS-1$ - correct = "Local"; //$NON-NLS-1$ - return super.convertStringToValue(correct, owner); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#isSetMOFValue(org.eclipse.emf.ecore.EObject) - */ - public boolean isSetMOFValue(EObject emfObject) { - if (((MethodElement)emfObject).getType() == MethodElementKind.UNSPECIFIED_LITERAL) - return false; - return super.isSetMOFValue(emfObject); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getMOFChildren(org.eclipse.emf.ecore.EObject) - */ - public List getMOFChildren(EObject mofObject) { - List result = super.getMOFChildren(mofObject); - if(result != null && result.size() > 0) { - MethodElementKind methodIntf = (MethodElementKind) result.get(0); - if(methodIntf.getValue() == MethodElementKind.UNSPECIFIED) - result = Collections.EMPTY_LIST; - } - return result; - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MethodParamsTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MethodParamsTranslator.java deleted file mode 100644 index 988252fb8..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MethodParamsTranslator.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 2, 2003 - * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import java.util.List; - -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.ejb.MethodElement; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author dfholttp - * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class MethodParamsTranslator extends Translator implements EjbDeploymentDescriptorXmlMapperI{ - protected static final EjbPackage EJB_PKG = EjbPackage.eINSTANCE; - - //private EStructuralFeature eFeature; - - public MethodParamsTranslator(EStructuralFeature eFeature) { - super(METHOD_PARAMS+'/'+METHOD_PARAM , eFeature); - //this.eFeature = eFeature; - this.fStyle |= Translator.EMPTY_CONTENT_IS_SIGNIFICANT; - } - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#isMultiValued() - */ - public boolean isMultiValued() { - return true; - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getMOFChildren(org.eclipse.emf.ecore.EObject) - */ - public List getMOFChildren(EObject mofObject) { - return ((MethodElement)mofObject).getMethodParams(); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#setMOFValue(org.eclipse.emf.ecore.EObject, java.lang.Object) - */ - public void setMOFValue(EObject mofObject, Object value) { - List methodParams = ((MethodElement)mofObject).getMethodParams(); - - if(value == null || value.toString().length() == 0) { - if(methodParams == null || methodParams.size() == 0 ) { - setMOFValueFromEmptyDOMPath(mofObject); - } - } else { - ((MethodElement)mofObject).addMethodParams((String)value); - } - } - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#setMOFValue(org.eclipse.emf.common.notify.Notifier, java.lang.Object, int) - */ - public void setMOFValue(Notifier owner, Object value, int newIndex) { - ((MethodElement)owner).addMethodParams((String)value); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#clearList(org.eclipse.emf.ecore.EObject) - */ - public void clearList(EObject mofObject) { - ((MethodElement)mofObject).eUnset(feature); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#shouldRenderEmptyDOMPath(org.eclipse.emf.ecore.EObject) - */ - public boolean shouldRenderEmptyDOMPath(EObject eObject) { - MethodElement me = ((MethodElement)eObject); - return me.hasMethodParams() && me.getMethodParams().isEmpty(); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#setMOFValueFromEmptyDOMPath(org.eclipse.emf.ecore.EObject) - */ - public void setMOFValueFromEmptyDOMPath(EObject eObject) { - ((MethodElement)eObject).applyZeroParams(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MultiplicityTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MultiplicityTranslator.java deleted file mode 100644 index ddd1b5bf3..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/MultiplicityTranslator.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 2, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author administrator - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class MultiplicityTranslator extends Translator implements EjbDeploymentDescriptorXmlMapperI{ - - public MultiplicityTranslator(){ - super(MULTIPLICITY,EjbPackage.eINSTANCE.getEJBRelationshipRole_Multiplicity()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#convertStringToValue(java.lang.String, org.eclipse.emf.ecore.EObject) - */ - public Object convertStringToValue(String strValue, EObject owner) { - String correct = strValue; - if (strValue.toUpperCase().equals("ONE")) //$NON-NLS-1$ - correct = "One"; //$NON-NLS-1$ - else if (strValue.toUpperCase().equals("MANY")) //$NON-NLS-1$ - correct = "Many"; //$NON-NLS-1$ - - return super.convertStringToValue(correct, owner); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/PrimKeyFieldTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/PrimKeyFieldTranslator.java deleted file mode 100644 index 20d3124e6..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/PrimKeyFieldTranslator.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 3, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.jst.j2ee.ejb.ContainerManagedEntity; -import org.eclipse.jst.j2ee.ejb.EjbFactory; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.SourceLinkTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; -import org.eclipse.wst.common.internal.emf.resource.TranslatorPath; - -/** - * @author jlanuti - */ -public class PrimKeyFieldTranslator extends SourceLinkTranslator implements EjbDeploymentDescriptorXmlMapperI { - - /** - * @param domNameAndPath - * @param eClass - * @param TranslatorPath - */ - public PrimKeyFieldTranslator() { - super(PRIMKEY_FIELD, EjbPackage.eINSTANCE.getContainerManagedEntity_PrimKeyField(),new TranslatorPath( - new Translator[] { - new Translator(CMP_FIELD, EjbPackage.eINSTANCE.getContainerManagedEntity_PersistentAttributes()), - new Translator(FIELD_NAME, EcorePackage.eINSTANCE.getENamedElement_Name()) - })); - } - - protected String getSpecifiedPrimKeyFieldName(ContainerManagedEntity cmp) { - return cmp.getPrimKeyField().getName(); - } - - /** - * @see com.ibm.etools.emf2xml.impl.Translator#convertStringToValue(java.lang.String, org.eclipse.emf.ecore.EObject) - */ - public Object convertStringToValue(String strValue, EObject owner) { - // try and convert the string to a cmp attribute, otherwise create a proxy - Object result = super.convertStringToValue(strValue, owner); - if (result == null || result == strValue /*reference check is valid here*/) { - result = EjbFactory.eINSTANCE.createCMPAttribute(); - if (strValue == null) strValue = "";//$NON-NLS-1$ - ((InternalEObject)result).eSetProxyURI(URI.createURI(strValue)); - } - return result; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/SecurityIdentityTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/SecurityIdentityTranslator.java deleted file mode 100644 index c219b7700..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/SecurityIdentityTranslator.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 1, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.common.RunAsSpecifiedIdentity; -import org.eclipse.jst.j2ee.common.SecurityIdentity; -import org.eclipse.jst.j2ee.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.xml.EjbDeploymentDescriptorXmlMapperI; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.ReadAheadHelper; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author schacher - */ -public class SecurityIdentityTranslator extends Translator implements EjbDeploymentDescriptorXmlMapperI { - private static final CommonPackage COMMON_PKG = CommonPackage.eINSTANCE; - - private static final Translator[] RUN_AS_TRANSLATORS = createRunAsTranslators(); - - private static final Translator[] USE_CALLER_TRANSLATORS = createUseCallerTranslators(); - - - private static Translator[] createRunAsTranslators() { - GenericTranslator runAsTranslator = new GenericTranslator(RUN_AS, COMMON_PKG.getRunAsSpecifiedIdentity_Identity()); - runAsTranslator.setChildren(new Translator[] { - new Translator(DESCRIPTION, COMMON_PKG.getIdentity_Description()), - new Translator(ROLE_NAME, COMMON_PKG.getIdentity_RoleName()) - }); - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getSecurityIdentity_Description()), - runAsTranslator - }; - } - - private static Translator[] createUseCallerTranslators() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getSecurityIdentity_Description()), - new Translator(USE_CALLER_IDENTITY, null, EMPTY_TAG) - }; - } - - /** - * @param domNameAndPath - * @param aFeature - */ - public SecurityIdentityTranslator() { - super(SECURITY_IDENTITY, EjbPackage.eINSTANCE.getEnterpriseBean_SecurityIdentity()); - addReadAheadHelper(new ReadAheadHelper(SECURITY_IDENTITY, new String[] {RUN_AS, USE_CALLER_IDENTITY}, null)); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - if (o == null) - return CommonTranslators.EMPTY_CHILDREN; - if (((SecurityIdentity)o).isRunAsSpecifiedIdentity()) - return RUN_AS_TRANSLATORS; - else if (((SecurityIdentity)o).isUseCallerIdentity()) - return USE_CALLER_TRANSLATORS; - else - throw new IllegalStateException("Internal error: Security Identity Type expected"); //$NON-NLS-1$ - } - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - CommonFactory fact = CommonFactory.eINSTANCE; - if (RUN_AS.equals(readAheadName)) { - RunAsSpecifiedIdentity result = fact.createRunAsSpecifiedIdentity(); - result.setIdentity(fact.createIdentity()); - return result; - } else if (USE_CALLER_IDENTITY.equals(readAheadName)) - return fact.createUseCallerIdentity(); - else - return null; - } - - public boolean isManagedByParent() { - return false; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/SessionTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/SessionTranslator.java deleted file mode 100644 index 853d4c372..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/ejb/SessionTranslator.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 31, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.ejb; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.ejb.EjbFactory; -import org.eclipse.jst.j2ee.internal.model.translator.common.JavaClassTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author schacher - */ -public class SessionTranslator extends AbstractEJBTranslator { - - private static Translator[] children13; - private static Translator[] children14; - /** - * @param domNameAndPath - * @param aFeature - */ - public SessionTranslator() { - super(ENTERPRISE_BEANS+'/'+SESSION); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.internal.model.translator.ejb.AbstractEJBTranslator#getSpecificMaps() - */ - protected Translator[] getSpecificMaps(int versionID) { - return new Translator[] { - new Translator(SESSION_TYPE, EJB_PKG.getSession_SessionType(), UNSET_IF_NULL), //Enumeration - new Translator(TRANSACTION_TYPE, EJB_PKG.getSession_TransactionType(), UNSET_IF_NULL) //Enumeration - }; - } - - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.internal.internal.model.translator.ejb.AbstractEJBTranslator#getEJBClassMap() - * - * Support 1.4 and 1.3 - */ - protected Translator[] getEJBClassMap() { - return new Translator[] { - //J2EE 1.4 - new JavaClassTranslator(SERVICE_ENDPOINT,EJB_PKG.getSession_ServiceEndpoint()), - //J2EE 1.3 - new JavaClassTranslator(EJB_CLASS, EJB_PKG.getEnterpriseBean_EjbClass()) - }; - - } - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - return EjbFactory.eINSTANCE.createSession(); - } - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - switch (versionID) { - case (J2EE_1_2_ID) : - case (J2EE_1_3_ID) : - if (children13 == null) - children13 = create13Children(); - return children13; - default : - if (children14 == null) - children14 = create14Children(); - return children14; - } - } - - - - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webapplication/ErrorPageTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webapplication/ErrorPageTranslator.java deleted file mode 100644 index 45c05770f..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webapplication/ErrorPageTranslator.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 21, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.webapplication; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.model.translator.common.JavaClassTranslator; -import org.eclipse.jst.j2ee.internal.xml.WarDeploymentDescriptorXmlMapperI; -import org.eclipse.jst.j2ee.webapplication.ErrorPage; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; -import org.eclipse.jst.j2ee.webapplication.WebapplicationPackage; -import org.eclipse.wst.common.internal.emf.resource.ReadAheadHelper; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author schacher - */ -public class ErrorPageTranslator extends Translator implements WarDeploymentDescriptorXmlMapperI { - private static Translator[] ERROR_CODE_XLATORS = new Translator[] { - new Translator(ERROR_CODE, WebapplicationPackage.eINSTANCE.getErrorCodeErrorPage_ErrorCode()), - new Translator(LOCATION, WebapplicationPackage.eINSTANCE.getErrorPage_Location()) - }; - private static Translator[] EXCEPTION_TYPE_XLATORS = new Translator[] { - new JavaClassTranslator(EXCEPTION_TYPE, WebapplicationPackage.eINSTANCE.getExceptionTypeErrorPage_ExceptionType()), - new Translator(LOCATION, WebapplicationPackage.eINSTANCE.getErrorPage_Location()) - }; - - public ErrorPageTranslator() { - super(ERROR_PAGE, WebapplicationPackage.eINSTANCE.getWebApp_ErrorPages()); - addReadAheadHelper(new ReadAheadHelper(ERROR_PAGE, new String[] {ERROR_CODE, EXCEPTION_TYPE}, null)); - - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - WebapplicationFactory fact = WebapplicationPackage.eINSTANCE.getWebapplicationFactory(); - if (ERROR_CODE.equals(readAheadName)) - return fact.createErrorCodeErrorPage(); - else if (EXCEPTION_TYPE.equals(readAheadName)) - return fact.createExceptionTypeErrorPage(); - else - return null; - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - if (o == null) - return CommonTranslators.EMPTY_CHILDREN; - if (((ErrorPage)o).isErrorCode()) - return ERROR_CODE_XLATORS; - else if (((ErrorPage)o).isExceptionType()) - return EXCEPTION_TYPE_XLATORS; - else - throw new IllegalStateException("Internal error: ErrorCode expected"); //$NON-NLS-1$ - } - - public boolean isManagedByParent() { - return false; - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webapplication/WebAppTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webapplication/WebAppTranslator.java deleted file mode 100644 index 08426d30e..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webapplication/WebAppTranslator.java +++ /dev/null @@ -1,549 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 18, 2003 - */ -package org.eclipse.jst.j2ee.internal.model.translator.webapplication; - - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.model.translator.common.BooleanTranslator; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.model.translator.common.EnvEntryTranslator; -import org.eclipse.jst.j2ee.internal.model.translator.common.JavaClassTranslator; -import org.eclipse.jst.j2ee.internal.xml.WarDeploymentDescriptorXmlMapperI; -import org.eclipse.jst.j2ee.jsp.JspPackage; -import org.eclipse.jst.j2ee.webapplication.WebapplicationPackage; -import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.RootTranslator; -import org.eclipse.wst.common.internal.emf.resource.SourceLinkTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; -import org.eclipse.wst.common.internal.emf.resource.TranslatorPath; - - -/** - * @author schacher - * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class WebAppTranslator extends RootTranslator implements WarDeploymentDescriptorXmlMapperI, J2EEConstants { - private static WebapplicationPackage WEBAPP_PKG = WebapplicationPackage.eINSTANCE; - private static CommonPackage COMMON_PKG = CommonPackage.eINSTANCE; - private static JspPackage JSP_PKG = JspPackage.eINSTANCE; - public static WebAppTranslator INSTANCE = new WebAppTranslator(); - private static Translator[] children13; - private static Translator[] children14; - - private static final Translator SERVLET_MAPPING_TRANSLATOR = createServletMappingTranslator(); - private static final Translator SESSION_CONFIG_TRANSLATOR = createSessionConfigTranslator(); - private static final Translator WELCOMEFILE_TRANSLATOR = createFileListTranslator(); - private static final Translator MIME_MAPPING_TRANSLATOR = createMimeMappingTranslator(); - private static final Translator ERROR_PAGE_TRANSLATOR = new ErrorPageTranslator(); - private static final Translator LOGIN_CONFIG_TRANSLATOR = createLoginConfigTranslator(); - private static final Translator DISTRIBUTABLE_TRANSLATOR = new Translator(DISTRIBUTABLE, WEBAPP_PKG.getWebApp_Distributable(), EMPTY_TAG); - - private static final Translator WEB_RESOURCE_NAME_TRANSLATOR = new Translator(WEB_RESOURCE_NAME, WEBAPP_PKG.getWebResourceCollection_WebResourceName()); - private static final Translator URL_PATTERN_TRANSLATOR = new Translator(URL_PATTERN, WEBAPP_PKG.getWebResourceCollection_UrlPattern()); - private static final Translator HTTP_METHOD_TRANSLATOR = new Translator(HTTP_METHOD, WEBAPP_PKG.getWebResourceCollection_HttpMethod()); - - private static final Translator ROLE_NAME_TRANSLATOR = new Translator(ROLE_NAME, WEBAPP_PKG.getAuthConstraint_Roles()); - private static final Translator TRANSPORT_GUARANTEE_TRANSLATOR = new Translator(TRANSPORT_GUARANTEE, WEBAPP_PKG.getUserDataConstraint_TransportGuarantee()); - - - protected WebAppTranslator() { - super(WEB_APP, WEBAPP_PKG.getWebApp()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - switch (versionID) { - case (J2EE_1_2_ID) : - case (J2EE_1_3_ID) : - if (children13 == null) - children13 = create13Children(); - return children13; - default : - if (children14 == null) - children14 = create14Children(); - return children14; - } - } - - - protected Translator[] create13Children() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(SMALL_ICON_PATH, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon()), - new Translator(LARGE_ICON_PATH, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon()), - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName()), - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - DISTRIBUTABLE_TRANSLATOR, - createContextParam13Translator(), - createFilter13Translator(), - createFilterMapping13Translator(), - createListener13Translator(), - createServlet13Translator(), - SERVLET_MAPPING_TRANSLATOR, - SESSION_CONFIG_TRANSLATOR, - MIME_MAPPING_TRANSLATOR, - WELCOMEFILE_TRANSLATOR, - ERROR_PAGE_TRANSLATOR, - createTagLibTranslator13(WEBAPP_PKG.getWebApp_TagLibs()), - CommonTranslators.JNDI_REF_GROUP_RESOURCE_ENV_REF_1_3, - CommonTranslators.JNDI_REF_GROUP_RESOURCE_REF_1_3, - createSecurityConstraintTranslator13(), - LOGIN_CONFIG_TRANSLATOR, - CommonTranslators.createSecurityRoleTranslator13(WEBAPP_PKG.getWebApp_SecurityRoles()), - new EnvEntryTranslator(COMMON_PKG.getJNDIEnvRefsGroup_EnvironmentProperties(), false, false), - CommonTranslators.JNDI_REF_GROUP_EJB_REF_1_3, - CommonTranslators.JNDI_REF_GROUP_EJB_LOCAL_REF_1_3 - }; - } - - - protected Translator[] create14Children() { - Translator[] begin = new Translator[] { - IDTranslator.INSTANCE, - new Translator(VERSION, WEBAPP_PKG.getWebApp_Version(), DOM_ATTRIBUTE), - new ConstantAttributeTranslator(XML_NS, J2EE_NS_URL), - new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL), - new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, J2EE_NS_URL+' '+WEB_APP_SCHEMA_LOC_2_4), - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - DISTRIBUTABLE_TRANSLATOR, - CommonTranslators.createParamValueType(CONTEXT_PARAM, WEBAPP_PKG.getWebApp_ContextParams()), - createFilter14Translator(), - createFilterMapping14Translator(), - createListener14Translator(), - createServlet14Translator(), - SERVLET_MAPPING_TRANSLATOR, - SESSION_CONFIG_TRANSLATOR, - MIME_MAPPING_TRANSLATOR, - WELCOMEFILE_TRANSLATOR, - ERROR_PAGE_TRANSLATOR, - createJSPConfigTranslators(), - createSecurityConstraintTranslators14(), - LOGIN_CONFIG_TRANSLATOR, - CommonTranslators.createSecurityRoleTranslator14(WEBAPP_PKG.getWebApp_SecurityRoles()) - }; - Translator[] end = new Translator[] { - CommonTranslators.createMessageDestinationTranslator(WEBAPP_PKG.getWebApp_MessageDestinations()), - createLocaleEncodingMappingListTranslator(), - // CommonTranslators.createDeploymentExtensionTranslator(WEBAPP_PKG.getWebApp_Extensions()) - }; - - - return (Translator[])concat(begin,concat(createJNDIEnvironmentRefsGroupTranslator(), end)); - } - - public static Translator createSecurityConstraintTranslators14() { - GenericTranslator result = new GenericTranslator(SECURITY_CONSTRAINT, WEBAPP_PKG.getWebApp_Constraints()); - result.setChildren(new Translator[] { - CommonTranslators.createDisplayNameTranslator(WEBAPP_PKG.getSecurityConstraint_DisplayNames()), - createWebResourceCollectionTranslator14(), - createAuthConstraintTranslator14(), - createUserDataConstraintTranslator14(), - }); - return result; - } - - private static Translator createWebResourceCollectionTranslator14() { - GenericTranslator result = new GenericTranslator(WEB_RESOURCE_COLLECTION, WEBAPP_PKG.getSecurityConstraint_WebResourceCollections()); - result.setChildren(new Translator[] { - WEB_RESOURCE_NAME_TRANSLATOR, - CommonTranslators.createDescriptionTranslator(WEBAPP_PKG.getWebResourceCollection_Descriptions()), - URL_PATTERN_TRANSLATOR, - HTTP_METHOD_TRANSLATOR - }); - return result; - } - - private static Translator createAuthConstraintTranslator14() { - GenericTranslator result = new GenericTranslator(AUTH_CONSTRAINT, WEBAPP_PKG.getSecurityConstraint_AuthConstraint()); - result.setChildren(new Translator[] { - CommonTranslators.createDescriptionTranslator(WEBAPP_PKG.getAuthConstraint_Descriptions()), - ROLE_NAME_TRANSLATOR - }); - return result; - } - - private static Translator createUserDataConstraintTranslator14() { - GenericTranslator result = new GenericTranslator(USER_DATA_CONSTRAINT, WEBAPP_PKG.getSecurityConstraint_UserDataConstraint()); - result.setChildren(new Translator[] { - CommonTranslators.createDescriptionTranslator(WEBAPP_PKG.getUserDataConstraint_Descriptions()), - TRANSPORT_GUARANTEE_TRANSLATOR - }); - return result; - } - - - private Translator createJSPConfigTranslators() { - GenericTranslator result = new GenericTranslator(JSP_CONFIG, WEBAPP_PKG.getWebApp_JspConfig()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createTagLibTranslator14(JSP_PKG.getJSPConfig_TagLibs()), - createJSPPropertyGroupTranslator() - }); - - return result; - } - - - /** - * @return - */ - private Translator createJSPPropertyGroupTranslator() { - GenericTranslator result = new GenericTranslator(JSP_PROPERTY_GROUP, JSP_PKG.getJSPConfig_PropertyGroups()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - new Translator(URL_PATTERN, JSP_PKG.getJSPPropertyGroup_UrlPattern()), - new BooleanTranslator(EL_IGNORED, JSP_PKG.getJSPPropertyGroup_ElIgnored()), - new Translator(PAGE_ENCODING, JSP_PKG.getJSPPropertyGroup_PageEncoding()), - new BooleanTranslator(SCRIPTING_INVALID, JSP_PKG.getJSPPropertyGroup_ScriptingInvalid()), - new BooleanTranslator(IS_XML,JSP_PKG.getJSPPropertyGroup_IsXML()), - new Translator(INCLUDE_PRELUDE, JSP_PKG.getJSPPropertyGroup_IncludePreludes()), - new Translator(INCLUDE_CODA, JSP_PKG.getJSPPropertyGroup_IncludeCodas()) - }); - return result; - } - - - private Translator createLocaleEncodingMappingListTranslator() { - GenericTranslator result = new GenericTranslator(LOCALE_ENCODING_MAPPING_LIST, WEBAPP_PKG.getWebApp_LocalEncodingMappingList()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - createLocaleEncodingMapping() - }); - return result; - - } - - - /** - * @return - */ - private Translator createLocaleEncodingMapping() { - GenericTranslator result = new GenericTranslator(LOCALE_ENCODING_MAPPING, WEBAPP_PKG.getLocalEncodingMappingList_LocalEncodingMappings()); - result.setChildren(new Translator[] { - new Translator(LOCALE, WEBAPP_PKG.getLocalEncodingMapping_Locale()), - new Translator(ENCODING, WEBAPP_PKG.getLocalEncodingMapping_Encoding()) - }); - return result; - - } - - - /** - * @return - */ - private Translator[] createJNDIEnvironmentRefsGroupTranslator() { - return new Translator[] { - CommonTranslators.JNDI_REF_GROUP_ENV_ENTRY_1_4, - CommonTranslators.JNDI_REF_GROUP_EJB_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_EJB_LOCAL_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_SERVICE_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_RESOURCE_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_RESOURCE_ENV_REF_1_4, - CommonTranslators.JNDI_REF_GROUP_MESSAGE_DEST_REF_1_4 - }; - } - - - /** - * @return - */ - private Translator createFilterMapping14Translator() { - Translator dispatcher = new Translator(DISPATCHER, WEBAPP_PKG.getFilterMapping_DispatcherType()); - return GenericTranslator.appendChild((GenericTranslator)createFilterMapping13Translator(),dispatcher); - } - - public static Translator createContextParam13Translator() { - GenericTranslator result = new GenericTranslator(CONTEXT_PARAM, WEBAPP_PKG.getWebApp_Contexts()); - result.setChildren(new Translator[] { - new Translator(PARAM_NAME, WEBAPP_PKG.getContextParam_ParamName()), - new Translator(PARAM_VALUE, WEBAPP_PKG.getContextParam_ParamValue()), - new Translator(DESCRIPTION, WEBAPP_PKG.getContextParam_Description()), - }); - return result; - } - - public static Translator createFilter13Translator() { - GenericTranslator result = new GenericTranslator(FILTER, WEBAPP_PKG.getWebApp_Filters()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(SMALL_ICON_PATH, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon()), - new Translator(LARGE_ICON_PATH, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon()), - new Translator(FILTER_NAME, WEBAPP_PKG.getFilter_Name(), - new TranslatorPath(new Translator[] { - new Translator(WEB_APP, Translator.CONTAINER_FEATURE), - new Translator(FILTER_MAPPING, WEBAPP_PKG.getWebApp_FilterMappings()), - })), - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName()), - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - new JavaClassTranslator(FILTER_CLASS, WEBAPP_PKG.getFilter_FilterClass()), - createInitParamTranslator(WEBAPP_PKG.getFilter_InitParams()) - }); - return result; - } - - - public static Translator createFilter14Translator() { - GenericTranslator result = new GenericTranslator(FILTER, WEBAPP_PKG.getWebApp_Filters()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - new Translator(FILTER_NAME, WEBAPP_PKG.getFilter_Name(), - //TODO: Make sure the path is still valid - new TranslatorPath(new Translator[] { - new Translator(WEB_APP, Translator.CONTAINER_FEATURE), - new Translator(FILTER_MAPPING, WEBAPP_PKG.getWebApp_FilterMappings()), - })), - new JavaClassTranslator(FILTER_CLASS, WEBAPP_PKG.getFilter_FilterClass()), - CommonTranslators.createParamValueType(INIT_PARAM,WEBAPP_PKG.getFilter_InitParamValues()) - }); - return result; - } - - public static Translator createFilterMapping13Translator() { - GenericTranslator result = new GenericTranslator(FILTER_MAPPING, WEBAPP_PKG.getWebApp_FilterMappings()); - result.setChildren(new Translator[] { - new SourceLinkTranslator(FILTER_NAME, WEBAPP_PKG.getFilterMapping_Filter(), - new TranslatorPath(new Translator[] { - new Translator(WEB_APP, Translator.CONTAINER_FEATURE), - new Translator(FILTER, WEBAPP_PKG.getWebApp_Filters()), - new Translator(FILTER_MAPPING, WEBAPP_PKG.getFilter_Name()) - })), - new Translator(URL_PATTERN, WEBAPP_PKG.getFilterMapping_UrlPattern()), - new SourceLinkTranslator(SERVLET_NAME, WEBAPP_PKG.getFilterMapping_Servlet(), - new TranslatorPath(new Translator[] { - new Translator(WEB_APP, Translator.CONTAINER_FEATURE), - new Translator(SERVLET, WEBAPP_PKG.getWebApp_Servlets()), - new Translator(SERVLET_NAME, WEBAPP_PKG.getServlet_ServletName()) - }), Translator.STRING_RESULT_OK), - }); - return result; - } - - public static Translator createInitParamTranslator(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(INIT_PARAM, feature); - result.setChildren(new Translator[] { - new Translator(PARAM_NAME, WEBAPP_PKG.getInitParam_ParamName()), - new Translator(PARAM_VALUE, WEBAPP_PKG.getInitParam_ParamValue()), - new Translator(DESCRIPTION, WEBAPP_PKG.getInitParam_Description()), - }); - return result; - } - - public static Translator createListener13Translator() { - GenericTranslator result = new GenericTranslator(LISTENER, WEBAPP_PKG.getWebApp_Listeners()); - result.setChildren(new Translator[] { - CommonTranslators.LISTENER_CLASS_TRANSLATOR - }); - return result; - } - - public static Translator createListener14Translator() { - GenericTranslator result = new GenericTranslator(LISTENER, WEBAPP_PKG.getWebApp_Listeners()); - result.setChildren(new Translator[] { - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - CommonTranslators.LISTENER_CLASS_TRANSLATOR - }); - return result; - } - - public static Translator createServlet13Translator() { - GenericTranslator result = new GenericTranslator(SERVLET, WEBAPP_PKG.getWebApp_Servlets()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(SMALL_ICON_PATH, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon()), - new Translator(LARGE_ICON_PATH, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon()), - new Translator(SERVLET_NAME, WEBAPP_PKG.getServlet_ServletName(), - new TranslatorPath[] { - new TranslatorPath(new Translator[] { - new Translator(WEB_APP, WEBAPP_PKG.getServlet_WebApp()), - new Translator(SERVLET_MAPPING, WEBAPP_PKG.getWebApp_ServletMappings()), - }), - new TranslatorPath(new Translator[] { - new Translator(WEB_APP, WEBAPP_PKG.getServlet_WebApp()), - new Translator(FILTER_MAPPING, WEBAPP_PKG.getWebApp_FilterMappings()), - }), - }), - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName()), - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - new WebTypeTranslator(), //servlet-class or jsp-file - createInitParamTranslator(WEBAPP_PKG.getServlet_Params()), - new Translator(LOAD_ON_STARTUP, WEBAPP_PKG.getServlet_LoadOnStartup()), - CommonTranslators.createRunAsTranslator13(WEBAPP_PKG.getServlet_RunAs()), - CommonTranslators.createSecurityRoleRefTranslator13(WEBAPP_PKG.getServlet_SecurityRoleRefs()) - }); - return result; - } - - public static Translator createServlet14Translator() { - GenericTranslator result = new GenericTranslator(SERVLET, WEBAPP_PKG.getWebApp_Servlets()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - new Translator(SERVLET_NAME, WEBAPP_PKG.getServlet_ServletName(), - new TranslatorPath[] { - new TranslatorPath(new Translator[] { - new Translator(WEB_APP, WEBAPP_PKG.getServlet_WebApp()), - new Translator(SERVLET_MAPPING, WEBAPP_PKG.getWebApp_ServletMappings()), - }), - new TranslatorPath(new Translator[] { - new Translator(WEB_APP, WEBAPP_PKG.getServlet_WebApp()), - new Translator(FILTER_MAPPING, WEBAPP_PKG.getWebApp_FilterMappings()), - }), - }), - new WebTypeTranslator(), //servlet-class or jsp-file - CommonTranslators.createParamValueType(INIT_PARAM,WEBAPP_PKG.getServlet_InitParams()), - new Translator(LOAD_ON_STARTUP, WEBAPP_PKG.getServlet_LoadOnStartup()), - CommonTranslators.createRunAsTranslator14(WEBAPP_PKG.getServlet_RunAs()), - CommonTranslators.createSecurityRoleRefTranslator14(WEBAPP_PKG.getServlet_SecurityRoleRefs()), - // CommonTranslators.createDeploymentExtensionTranslator(WEBAPP_PKG.getServlet_Extensions()) - }); - return result; - } - - public static Translator createServletMappingTranslator() { - GenericTranslator result = new GenericTranslator(SERVLET_MAPPING, WEBAPP_PKG.getWebApp_ServletMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new SourceLinkTranslator(SERVLET_NAME, WEBAPP_PKG.getServletMapping_Servlet(), - new TranslatorPath(new Translator[] { - new Translator(WEB_APP, CONTAINER_FEATURE), - new Translator(SERVLET, WEBAPP_PKG.getWebApp_Servlets()), - new Translator(SERVLET_NAME, WEBAPP_PKG.getServlet_ServletName()) - })), - new Translator(URL_PATTERN, WEBAPP_PKG.getServletMapping_UrlPattern()) - }); - return result; - } - - public static Translator createSessionConfigTranslator() { - GenericTranslator result = new GenericTranslator(SESSION_CONFIG, WEBAPP_PKG.getWebApp_SessionConfig()); - result.setChildren(new Translator[] { - new Translator(SESSION_TIMEOUT, WebapplicationPackage.eINSTANCE.getSessionConfig_SessionTimeout()), - }); - return result; - } - - public static Translator createMimeMappingTranslator() { - GenericTranslator result = new GenericTranslator(MIME_MAPPING, WEBAPP_PKG.getWebApp_MimeMappings()); - result.setChildren(new Translator[] { - new Translator(EXTENSION, WEBAPP_PKG.getMimeMapping_Extension()), - new Translator(MIME_TYPE, WEBAPP_PKG.getMimeMapping_MimeType()), - - }); - return result; - } - - public static Translator createFileListTranslator() { - GenericTranslator result = new GenericTranslator(WELCOME_FILE_LIST, WEBAPP_PKG.getWebApp_FileList()); - result.setChildren(new Translator[] { - createParentAndTextAttributeTranslator(WELCOME_FILE, WEBAPP_PKG.getWelcomeFileList_File(), WEBAPP_PKG.getWelcomeFile_WelcomeFile()) - }); - return result; - } - - public static Translator createTagLibTranslator14(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(TAGLIB, feature); - result.setChildren(new Translator[] { - new Translator(TAGLIB_URI, JSP_PKG.getTagLibRefType_TaglibURI()), - new Translator(TAGLIB_LOCATION, JSP_PKG.getTagLibRefType_TaglibLocation()) - }); - return result; - } - public static Translator createTagLibTranslator13(EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(TAGLIB, feature); - result.setChildren(new Translator[] { - new Translator(TAGLIB_URI, WEBAPP_PKG.getTagLibRef_TaglibURI()), - new Translator(TAGLIB_LOCATION, WEBAPP_PKG.getTagLibRef_TaglibLocation()) - }); - return result; - } - public static Translator createSecurityConstraintTranslator13() { - GenericTranslator result = new GenericTranslator(SECURITY_CONSTRAINT, WEBAPP_PKG.getWebApp_Constraints()); - result.setChildren(new Translator[] { - new Translator(DISPLAY_NAME, WEBAPP_PKG.getSecurityConstraint_DisplayName()), - createWebResourceCollectionTranslator13(), - createAuthConstraintTranslator13(), - createUserDataConstraintTranslator13(), - }); - return result; - } - - private static Translator createWebResourceCollectionTranslator13() { - GenericTranslator result = new GenericTranslator(WEB_RESOURCE_COLLECTION, WEBAPP_PKG.getSecurityConstraint_WebResourceCollections()); - result.setChildren(new Translator[] { - WEB_RESOURCE_NAME_TRANSLATOR, - new Translator(DESCRIPTION,WEBAPP_PKG.getWebResourceCollection_Description()), - URL_PATTERN_TRANSLATOR, - HTTP_METHOD_TRANSLATOR - }); - return result; - } - - private static Translator createAuthConstraintTranslator13() { - GenericTranslator result = new GenericTranslator(AUTH_CONSTRAINT, WEBAPP_PKG.getSecurityConstraint_AuthConstraint()); - result.setChildren(new Translator[] { - new Translator(DESCRIPTION, WEBAPP_PKG.getAuthConstraint_Description()), - ROLE_NAME_TRANSLATOR - }); - return result; - } - - private static Translator createUserDataConstraintTranslator13() { - GenericTranslator result = new GenericTranslator(USER_DATA_CONSTRAINT, WEBAPP_PKG.getSecurityConstraint_UserDataConstraint()); - result.setChildren(new Translator[] { - new Translator(DESCRIPTION, WEBAPP_PKG.getUserDataConstraint_Description()), - TRANSPORT_GUARANTEE_TRANSLATOR - }); - return result; - } - - public static Translator createLoginConfigTranslator() { - GenericTranslator result = new GenericTranslator(LOGIN_CONFIG, WEBAPP_PKG.getWebApp_LoginConfig()); - result.setChildren(new Translator[] { - new Translator(AUTH_METHOD, WEBAPP_PKG.getLoginConfig_AuthMethod(), Translator.ENUM_FEATURE_WITH_HYPHENS), - new Translator(REALM_NAME, WEBAPP_PKG.getLoginConfig_RealmName()), - createFormLoginConfigTranslator() - }); - return result; - } - - public static Translator createFormLoginConfigTranslator() { - GenericTranslator result = new GenericTranslator(FORM_LOGIN_CONFIG, WEBAPP_PKG.getLoginConfig_FormLoginConfig()); - result.setChildren(new Translator[] { - new Translator(FORM_LOGIN_PAGE, WEBAPP_PKG.getFormLoginConfig_FormLoginPage()), - new Translator(FORM_ERROR_PAGE, WEBAPP_PKG.getFormLoginConfig_FormErrorPage()), - }); - return result; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webapplication/WebTypeTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webapplication/WebTypeTranslator.java deleted file mode 100644 index 22027b2c8..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webapplication/WebTypeTranslator.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 20, 2003 - * - */ -package org.eclipse.jst.j2ee.internal.model.translator.webapplication; - - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.xml.WarDeploymentDescriptorXmlMapperI; -import org.eclipse.jst.j2ee.webapplication.WebType; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; -import org.eclipse.jst.j2ee.webapplication.WebapplicationPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -/** - * @author schacher - */ -public class WebTypeTranslator extends Translator implements WarDeploymentDescriptorXmlMapperI { - - private static Translator[] SERVLET_XLATORS = new Translator[] { - new Translator(TEXT_ATTRIBUTE_VALUE, WebapplicationPackage.eINSTANCE.getServletType_ClassName()) - }; - private static Translator[] JSP_XLATORS = new Translator[] { - new Translator(TEXT_ATTRIBUTE_VALUE, WebapplicationPackage.eINSTANCE.getJSPType_JspFile()) - }; - - public WebTypeTranslator() { - super(SERVLET_CLASS+','+JSP_FILE, WebapplicationPackage.eINSTANCE.getServlet_WebType()); - } - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - if (o == null) - return CommonTranslators.EMPTY_CHILDREN; - if (((WebType)o).isJspType()) - return JSP_XLATORS; - else if (((WebType)o).isServletType()) - return SERVLET_XLATORS; - else - throw new IllegalStateException("Internal error: Web Type expected"); //$NON-NLS-1$ - } - - - public String getDOMName(Object value) { - if (((WebType)value).isJspType()) - return JSP_FILE; - else if (((WebType)value).isServletType()) - return SERVLET_CLASS; - else - throw new IllegalStateException("Internal error: Web Type expected"); //$NON-NLS-1$ - } - - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - WebapplicationFactory fact = WebapplicationPackage.eINSTANCE.getWebapplicationFactory(); - if (SERVLET_CLASS.equals(nodeName)) - return fact.createServletType(); - else if (JSP_FILE.equals(nodeName)) - return fact.createJSPType(); - else - return null; - } - - public boolean isManagedByParent() { - return false; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/EJBLinkTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/EJBLinkTranslator.java deleted file mode 100644 index 8fe6d8d81..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/EJBLinkTranslator.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.model.translator.webservices; - - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.webservice.wsdd.WsddFactory; -import org.eclipse.jst.j2ee.webservice.wsdd.WsddPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - - - -public class EJBLinkTranslator extends Translator implements WsddXmlMapperI { - - private static Translator[] EJB_LINK_XLATORS = new Translator[] { - new Translator(TEXT_ATTRIBUTE_VALUE, WsddPackage.eINSTANCE.getEJBLink_EjbLink()) - }; - - public EJBLinkTranslator() { - super(EJB_LINK, WsddPackage.eINSTANCE.getServiceImplBean_EEJBLink()); - } - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - if (o == null) - return CommonTranslators.EMPTY_CHILDREN; - - return EJB_LINK_XLATORS; - } - - - public String getDOMName(Object value) { - return EJB_LINK; - } - - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - WsddFactory fact = WsddPackage.eINSTANCE.getWsddFactory(); - return fact.createEJBLink(); - - } - - public boolean isManagedByParent() { - return false; - } - -} - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/ElementNameTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/ElementNameTranslator.java deleted file mode 100644 index dd3913ecc..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/ElementNameTranslator.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.internal.model.translator.webservices; - - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.webservice.jaxrpcmap.JaxrpcmapFactory; -import org.eclipse.jst.j2ee.webservice.jaxrpcmap.JaxrpcmapPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class ElementNameTranslator extends Translator implements JaxrpcmapXmlMapperI { - - private static Translator[] ELEMENT_NAME_XLATORS = new Translator[] { - new Translator(TEXT_ATTRIBUTE_VALUE, JaxrpcmapPackage.eINSTANCE.getElementName_Text()) - }; - - public ElementNameTranslator() { - super(ELEMENT_NAME, JaxrpcmapPackage.eINSTANCE.getConstructorParameterOrder_ElementNames()); - } - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - if (o == null) - return CommonTranslators.EMPTY_CHILDREN; - - return ELEMENT_NAME_XLATORS; - } - - - public String getDOMName(Object value) { - return ELEMENT_NAME; - } - - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - JaxrpcmapFactory fact = JaxrpcmapPackage.eINSTANCE.getJaxrpcmapFactory(); - return fact.createElementName(); - - } - - public boolean isManagedByParent() { - return false; - } - -} - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/InterfaceMappingTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/InterfaceMappingTranslator.java deleted file mode 100644 index 15bd4a1f3..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/InterfaceMappingTranslator.java +++ /dev/null @@ -1,301 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.internal.model.translator.webservices; - - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.webservice.jaxrpcmap.JaxrpcmapFactory; -import org.eclipse.jst.j2ee.webservice.jaxrpcmap.JaxrpcmapPackage; -import org.eclipse.jst.j2ee.webservice.jaxrpcmap.ServiceEndpointInterfaceMapping; -import org.eclipse.jst.j2ee.webservice.jaxrpcmap.ServiceInterfaceMapping; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class InterfaceMappingTranslator extends Translator implements JaxrpcmapXmlMapperI { - - - private static Translator[] SERVICE_INTERFACE_10XLATORS = new Translator[] { - new Translator(SERVICE_INTERFACE, JaxrpcmapPackage.eINSTANCE.getServiceInterfaceMapping_ServiceInterface()), - create10WSDLServiceNameTranslator(), - createPortMappingTranslator() - }; - - private static Translator[] SERVICE_INTERFACE_11XLATORS = new Translator[] { - new Translator(SERVICE_INTERFACE, JaxrpcmapPackage.eINSTANCE.getServiceInterfaceMapping_ServiceInterface()), - CommonTranslators.createQNameTranslator(WSDL_SERVICE_NAME, JaxrpcmapPackage.eINSTANCE.getServiceInterfaceMapping_WsdlServiceName()), - createPortMappingTranslator() - }; - - private static Translator[] SEI_10XLATORS = new Translator[] { - new Translator(SERVICE_ENDPOINT_INTERFACE, JaxrpcmapPackage.eINSTANCE.getServiceEndpointInterfaceMapping_ServiceEndpointInterface()), - create10WSDLPortTypeTranslator(), - create10WSDLBindingTranslator(), - create10SEMethodMappingTranslator() - }; - - private static Translator[] SEI_11XLATORS = new Translator[] { - new Translator(SERVICE_ENDPOINT_INTERFACE, JaxrpcmapPackage.eINSTANCE.getServiceEndpointInterfaceMapping_ServiceEndpointInterface()), - CommonTranslators.createQNameTranslator(WSDL_PORT_TYPE, JaxrpcmapPackage.eINSTANCE.getServiceEndpointInterfaceMapping_WsdlPortType()), - CommonTranslators.createQNameTranslator(WSDL_BINDING, JaxrpcmapPackage.eINSTANCE.getServiceEndpointInterfaceMapping_WsdlBinding()), - create11SEMethodMappingTranslator() - }; - - public InterfaceMappingTranslator() { - super(SERVICE_INTERFACE_MAPPING+','+SERVICE_ENDPOINT_INTERFACE_MAPPING, JaxrpcmapPackage.eINSTANCE.getJavaWSDLMapping_InterfaceMappings()); - } - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - if (o == null) - return CommonTranslators.EMPTY_CHILDREN; - if (o instanceof ServiceInterfaceMapping) - return getServiceInterfaceTranslator(versionID); - else if (o instanceof ServiceEndpointInterfaceMapping) - return getSEITranslator(versionID); - else - throw new IllegalStateException("Internal error: InterfaceMapping expected"); //$NON-NLS-1$ - } - - - public String getDOMName(Object value) { - if (value instanceof ServiceInterfaceMapping) - return SERVICE_INTERFACE_MAPPING; - else if (value instanceof ServiceEndpointInterfaceMapping) - return SERVICE_ENDPOINT_INTERFACE_MAPPING; - else - throw new IllegalStateException("Internal error: InterfaceMapping expected"); //$NON-NLS-1$ - } - - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - JaxrpcmapFactory fact = JaxrpcmapPackage.eINSTANCE.getJaxrpcmapFactory(); - if (SERVICE_INTERFACE_MAPPING.equals(nodeName)) - return fact.createServiceInterfaceMapping(); - else if (SERVICE_ENDPOINT_INTERFACE_MAPPING.equals(nodeName)) - return fact.createServiceEndpointInterfaceMapping(); - else - return null; - } - - public boolean isManagedByParent() { - return false; - } - - private Translator[] getServiceInterfaceTranslator(int versionID) - { - switch (versionID) { - case J2EEVersionConstants.J2EE_1_2_ID : - case J2EEVersionConstants.J2EE_1_3_ID : - return SERVICE_INTERFACE_10XLATORS; - default : - return SERVICE_INTERFACE_11XLATORS; - } - - } - - private Translator[] getSEITranslator(int versionID) - { - switch (versionID) { - case J2EEVersionConstants.J2EE_1_2_ID : - case J2EEVersionConstants.J2EE_1_3_ID : - return SEI_10XLATORS; - default : - return SEI_11XLATORS; - } - - } - private static Translator create10WSDLServiceNameTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - CommonPackage commonPackage = CommonPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(WSDL_SERVICE_NAME, jaxrpcmapPackage.getServiceInterfaceMapping_WsdlServiceName()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(NAMESPACEURI, commonPackage.getQName_NamespaceURI()), - new Translator(LOCALPART, commonPackage.getQName_LocalPart()) - }); - return result; - } - - private static Translator createPortMappingTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(PORT_MAPPING, jaxrpcmapPackage.getServiceInterfaceMapping_PortMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(PORT_NAME, jaxrpcmapPackage.getPortMapping_PortName()), - new Translator(JAVA_PORT_NAME, jaxrpcmapPackage.getPortMapping_JavaPortName()) - }); - return result; - } - /* - private static Translator create10PortMappingTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(PORT_MAPPING, jaxrpcmapPackage.getServiceInterfaceMapping_PortMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(PORT_NAME, jaxrpcmapPackage.getPortMapping_PortName()), - new Translator(JAVA_PORT_NAME, jaxrpcmapPackage.getPortMapping_JavaPortName()) - }); - return result; - } - */ - - private static Translator create10WSDLPortTypeTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - CommonPackage commonPackage = CommonPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(WSDL_PORT_TYPE, jaxrpcmapPackage.getServiceEndpointInterfaceMapping_WsdlPortType()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(NAMESPACEURI, commonPackage.getQName_NamespaceURI()), - new Translator(LOCALPART, commonPackage.getQName_LocalPart()) - }); - return result; - } - - private static Translator create10WSDLBindingTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - CommonPackage commonPackage = CommonPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(WSDL_BINDING, jaxrpcmapPackage.getServiceEndpointInterfaceMapping_WsdlBinding()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(NAMESPACEURI, commonPackage.getQName_NamespaceURI()), - new Translator(LOCALPART, commonPackage.getQName_LocalPart()) - }); - return result; - } - - private static Translator create10SEMethodMappingTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(SERVICE_ENDPOINT_METHOD_MAPPING, jaxrpcmapPackage.getServiceEndpointInterfaceMapping_ServiceEndpointMethodMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(JAVA_METHOD_NAME, jaxrpcmapPackage.getServiceEndpointMethodMapping_JavaMethodName()), - new Translator(WSDL_OPERATION, jaxrpcmapPackage.getServiceEndpointMethodMapping_WsdlOperation()), - new Translator(WRAPPED_ELEMENT, jaxrpcmapPackage.getServiceEndpointMethodMapping_WrappedElement(), Translator.EMPTY_TAG), - create10MethodParamPartsMappingTranslator(), - create10WSDLReturnValueMappingTranslator() - }); - return result; - } - - private static Translator create11SEMethodMappingTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(SERVICE_ENDPOINT_METHOD_MAPPING, jaxrpcmapPackage.getServiceEndpointInterfaceMapping_ServiceEndpointMethodMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(JAVA_METHOD_NAME, jaxrpcmapPackage.getServiceEndpointMethodMapping_JavaMethodName()), - new Translator(WSDL_OPERATION, jaxrpcmapPackage.getServiceEndpointMethodMapping_WsdlOperation()), - new Translator(WRAPPED_ELEMENT, jaxrpcmapPackage.getServiceEndpointMethodMapping_WrappedElement(), Translator.EMPTY_TAG), - create11MethodParamPartsMappingTranslator(), - create11WSDLReturnValueMappingTranslator() - }); - return result; - } - - private static Translator create10MethodParamPartsMappingTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(METHOD_PARAM_PARTS_MAPPING, jaxrpcmapPackage.getServiceEndpointMethodMapping_MethodParamPartsMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(PARAM_POSITION, jaxrpcmapPackage.getMethodParamPartsMapping_ParamPosition()), - new Translator(PARAM_TYPE, jaxrpcmapPackage.getMethodParamPartsMapping_ParamType()), - create10WSDLMessageMappingTranslator() - }); - return result; - } - - private static Translator create11MethodParamPartsMappingTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(METHOD_PARAM_PARTS_MAPPING, jaxrpcmapPackage.getServiceEndpointMethodMapping_MethodParamPartsMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(PARAM_POSITION, jaxrpcmapPackage.getMethodParamPartsMapping_ParamPosition()), - new Translator(PARAM_TYPE, jaxrpcmapPackage.getMethodParamPartsMapping_ParamType()), - create11WSDLMessageMappingTranslator() - }); - return result; - } - - private static Translator create10WSDLMessageMappingTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(WSDL_MESSAGE_MAPPING, jaxrpcmapPackage.getMethodParamPartsMapping_WsdlMessageMapping()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - create10WSDLMessageTranslator(jaxrpcmapPackage.getWSDLMessageMapping_WsdlMessage()), - new Translator(WSDL_MESSAGE_PART_NAME, jaxrpcmapPackage.getWSDLMessageMapping_WsdlMessagePartName()), - new Translator(PARAMETER_MODE, jaxrpcmapPackage.getWSDLMessageMapping_ParameterMode()), - new Translator(SOAP_HEADER, jaxrpcmapPackage.getWSDLMessageMapping_SoapHeader(), Translator.EMPTY_TAG), - }); - return result; - } - - private static Translator create11WSDLMessageMappingTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(WSDL_MESSAGE_MAPPING, jaxrpcmapPackage.getMethodParamPartsMapping_WsdlMessageMapping()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.createQNameTranslator(WSDL_MESSAGE, jaxrpcmapPackage.getWSDLMessageMapping_WsdlMessage()), - new Translator(WSDL_MESSAGE_PART_NAME, jaxrpcmapPackage.getWSDLMessageMapping_WsdlMessagePartName()), - new Translator(PARAMETER_MODE, jaxrpcmapPackage.getWSDLMessageMapping_ParameterMode()), - new Translator(SOAP_HEADER, jaxrpcmapPackage.getWSDLMessageMapping_SoapHeader(), Translator.EMPTY_TAG), - }); - return result; - } - - private static Translator create10WSDLMessageTranslator(EStructuralFeature feature) { - //JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - CommonPackage commonPackage = CommonPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(WSDL_MESSAGE, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(NAMESPACEURI, commonPackage.getQName_NamespaceURI()), - new Translator(LOCALPART, commonPackage.getQName_LocalPart()) - }); - return result; - } - - private static Translator create10WSDLReturnValueMappingTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(WSDL_RETURN_VALUE_MAPPING, jaxrpcmapPackage.getServiceEndpointMethodMapping_WsdlReturnValueMapping()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(METHOD_RETURN_VALUE, jaxrpcmapPackage.getWSDLReturnValueMapping_MethodReturnValue()), - create10WSDLMessageTranslator(jaxrpcmapPackage.getWSDLReturnValueMapping_WsdlMessage()), - new Translator(WSDL_MESSAGE_PART_NAME, jaxrpcmapPackage.getWSDLReturnValueMapping_WsdlMessagePartName()) - }); - return result; - } - - private static Translator create11WSDLReturnValueMappingTranslator() { - JaxrpcmapPackage jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - GenericTranslator result = new GenericTranslator(WSDL_RETURN_VALUE_MAPPING, jaxrpcmapPackage.getServiceEndpointMethodMapping_WsdlReturnValueMapping()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(METHOD_RETURN_VALUE, jaxrpcmapPackage.getWSDLReturnValueMapping_MethodReturnValue()), - CommonTranslators.createQNameTranslator(WSDL_MESSAGE, jaxrpcmapPackage.getWSDLReturnValueMapping_WsdlMessage()), - new Translator(WSDL_MESSAGE_PART_NAME, jaxrpcmapPackage.getWSDLReturnValueMapping_WsdlMessagePartName()) - }); - return result; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/JaxrpcmapTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/JaxrpcmapTranslator.java deleted file mode 100644 index 2a383776e..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/JaxrpcmapTranslator.java +++ /dev/null @@ -1,225 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.internal.model.translator.webservices; - -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.webservice.internal.WebServiceConstants; -import org.eclipse.jst.j2ee.webservice.jaxrpcmap.JaxrpcmapPackage; -import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.RootTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - - - - -public class JaxrpcmapTranslator extends RootTranslator implements JaxrpcmapXmlMapperI, J2EEConstants{ - public static JaxrpcmapTranslator INSTANCE = new JaxrpcmapTranslator(); - private static Translator[] children10; - private static Translator[] children11; - private JaxrpcmapPackage jaxrpcmapPackage; - private CommonPackage commonPackage; - - - protected JaxrpcmapTranslator() { - super(JAVA_WSDL_MAPPING, JaxrpcmapPackage.eINSTANCE.getJavaWSDLMapping()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - jaxrpcmapPackage = JaxrpcmapPackage.eINSTANCE; - commonPackage = CommonPackage.eINSTANCE; - - switch (versionID) { - case (J2EE_1_2_ID) : - case (J2EE_1_3_ID) : - if (children10 == null) - { - children10 = create10Children(); - } - return children10; - default : - if (children11 == null) - { - children11 = create11Children(); - } - return children11; - } - } - - - protected Translator[] create10Children() { - - return new Translator[] { - IDTranslator.INSTANCE, - createPackageMappingTranslator(), - create10JavaXMLTypeMappingTranslator(), - create10ExceptionMappingTranslator(), - new InterfaceMappingTranslator() - }; - } - - protected Translator[] create11Children() { - - return new Translator[] { - IDTranslator.INSTANCE, - new ConstantAttributeTranslator(XML_NS, J2EE_NS_URL), - new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL), - new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, J2EE_NS_URL+' '+WebServiceConstants.JAXRPCMAP_SCHEMA_LOC), - new ConstantAttributeTranslator(VERSION, WebServiceConstants.WEBSERVICE_SCHEMA_VERSION), - createPackageMappingTranslator(), - create11JavaXMLTypeMappingTranslator(), - create11ExceptionMappingTranslator(), - new InterfaceMappingTranslator() - }; - } - - public Translator createPackageMappingTranslator() { - - GenericTranslator result = new GenericTranslator(PACKAGE_MAPPING, jaxrpcmapPackage.getJavaWSDLMapping_PackageMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(PACKAGE_TYPE, jaxrpcmapPackage.getPackageMapping_PackageType()), - new Translator(NAMESPACEURI, jaxrpcmapPackage.getPackageMapping_NamespaceURI()) - }); - return result; - } - - public Translator create10JavaXMLTypeMappingTranslator() { - - GenericTranslator result = new GenericTranslator(JAVA_XML_TYPE_MAPPING, jaxrpcmapPackage.getJavaWSDLMapping_JavaXMLTypeMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(CLASS_TYPE, jaxrpcmapPackage.getJavaXMLTypeMapping_ClassType()), - create10RootTypeQnameTranslator(), - new Translator(QNAME_SCOPE, jaxrpcmapPackage.getJavaXMLTypeMapping_QnameScope()), - create10VariableMappingTranslator() - }); - return result; - } - - public Translator create11JavaXMLTypeMappingTranslator() { - - GenericTranslator result = new GenericTranslator(JAVA_XML_TYPE_MAPPING, jaxrpcmapPackage.getJavaWSDLMapping_JavaXMLTypeMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(JAVA_TYPE, jaxrpcmapPackage.getJavaXMLTypeMapping_ClassType()), - new Translator(ANONYMOUS_TYPE_QNAME, jaxrpcmapPackage.getJavaXMLTypeMapping_AnonymousTypeQname()), - CommonTranslators.createQNameTranslator(ROOT_TYPE_QNAME, jaxrpcmapPackage.getJavaXMLTypeMapping_RootTypeQname()), - //create10RootTypeQnameTranslator(), //RootTypeQName is still going to work the old (1.3) way because of anonymous types. - new Translator(QNAME_SCOPE, jaxrpcmapPackage.getJavaXMLTypeMapping_QnameScope()), - create11VariableMappingTranslator() - }); - return result; - } - - public Translator create10ExceptionMappingTranslator() { - - GenericTranslator result = new GenericTranslator(EXCEPTION_MAPPING, jaxrpcmapPackage.getJavaWSDLMapping_ExceptionMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(EXCEPTION_TYPE, jaxrpcmapPackage.getExceptionMapping_ExceptionType()), - create10WSDLMessageTranslator(), - createConstructorParamOrderTranslator() - }); - return result; - } - - public Translator create11ExceptionMappingTranslator() { - - GenericTranslator result = new GenericTranslator(EXCEPTION_MAPPING, jaxrpcmapPackage.getJavaWSDLMapping_ExceptionMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(EXCEPTION_TYPE, jaxrpcmapPackage.getExceptionMapping_ExceptionType()), - CommonTranslators.createQNameTranslator(WSDL_MESSAGE, jaxrpcmapPackage.getExceptionMapping_WsdlMessage()), - new Translator(WSDL_MESSAGE_PART_NAME, jaxrpcmapPackage.getExceptionMapping_WsdlMessagePartName()), - createConstructorParamOrderTranslator() - }); - return result; - } - - public Translator createInterfaceMappingTranslator() { - - GenericTranslator result = new GenericTranslator(SERVICE_INTERFACE_MAPPING, jaxrpcmapPackage.getJavaWSDLMapping()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(PACKAGE_TYPE, jaxrpcmapPackage.getPackageMapping_PackageType()), - new Translator(NAMESPACEURI, jaxrpcmapPackage.getPackageMapping_NamespaceURI()) - }); - return result; - } - - - public Translator create10RootTypeQnameTranslator() { - - GenericTranslator result = new GenericTranslator(ROOT_TYPE_QNAME, jaxrpcmapPackage.getJavaXMLTypeMapping_RootTypeQname()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(NAMESPACEURI, commonPackage.getQName_NamespaceURI()), - new Translator(LOCALPART, commonPackage.getQName_LocalPart()) - }); - return result; - } - - public Translator create10VariableMappingTranslator() { - - GenericTranslator result = new GenericTranslator(VARIABLE_MAPPING, jaxrpcmapPackage.getJavaXMLTypeMapping_VariableMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(JAVA_VARIABLE_NAME, jaxrpcmapPackage.getVariableMapping_JavaVariableName()), - new Translator(DATA_MEMBER, jaxrpcmapPackage.getVariableMapping_DataMember(), Translator.EMPTY_TAG), - new Translator(XML_ELEMENT_NAME, jaxrpcmapPackage.getVariableMapping_XmlElementName()) - }); - return result; - } - - public Translator create11VariableMappingTranslator() { - - GenericTranslator result = new GenericTranslator(VARIABLE_MAPPING, jaxrpcmapPackage.getJavaXMLTypeMapping_VariableMappings()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(JAVA_VARIABLE_NAME, jaxrpcmapPackage.getVariableMapping_JavaVariableName()), - new Translator(DATA_MEMBER, jaxrpcmapPackage.getVariableMapping_DataMember(), Translator.EMPTY_TAG), - new Translator(XML_ATTRIBUTE_NAME, jaxrpcmapPackage.getVariableMapping_XmlAttributeName()), - new Translator(XML_ELEMENT_NAME, jaxrpcmapPackage.getVariableMapping_XmlElementName()), - new Translator(XML_WILDCARD, jaxrpcmapPackage.getVariableMapping_XmlWildcard(), Translator.EMPTY_TAG) - }); - return result; - } - - public Translator create10WSDLMessageTranslator() { - - GenericTranslator result = new GenericTranslator(WSDL_MESSAGE, jaxrpcmapPackage.getExceptionMapping_WsdlMessage()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(NAMESPACEURI, commonPackage.getQName_NamespaceURI()), - new Translator(LOCALPART, commonPackage.getQName_LocalPart()) - }); - return result; - } - - public Translator createConstructorParamOrderTranslator() { - GenericTranslator result = new GenericTranslator(CONSTRUCTOR_PARAMETER_ORDER, jaxrpcmapPackage.getExceptionMapping_ConstructorParameterOrder()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new ElementNameTranslator() - }); - return result; - } - -} - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/JaxrpcmapXmlMapperI.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/JaxrpcmapXmlMapperI.java deleted file mode 100644 index 4bfc870dc..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/JaxrpcmapXmlMapperI.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.model.translator.webservices; - -//imports for J2EE core classes -//import org.eclipse.jst.j2ee.internal.xml.DeploymentDescriptorXmlMapperI; - -/** - * This interface represents a catalog of all the tag names which occur in - * an web service deployment descriptor. Interface shared by readers and - * writers to have access to common constants - */ -public interface JaxrpcmapXmlMapperI extends WebServiceCommonXmlMapperI -{ - public String JAVA_WSDL_MAPPING ="java-wsdl-mapping"; //$NON-NLS-1$ - public String CLASS_TYPE ="class-type";//$NON-NLS-1$ - public String JAVA_TYPE ="java-type"; //$NON-NLS-1$ - public String CONSTRUCTOR_PARAMETER_ORDER ="constructor-parameter-order";//$NON-NLS-1$ - public String DATA_MEMBER ="data-member";//$NON-NLS-1$ - public String ELEMENT_NAME ="element-name";//$NON-NLS-1$ - public String EXCEPTION_MAPPING ="exception-mapping";//$NON-NLS-1$ - public String EXCEPTION_TYPE ="exception-type";//$NON-NLS-1$ - public String JAVA_METHOD_NAME ="java-method-name";//$NON-NLS-1$ - public String JAVA_PORT_NAME ="java-port-name";//$NON-NLS-1$ - public String JAVA_VARIABLE_NAME ="java-variable-name";//$NON-NLS-1$ - public String JAVA_XML_TYPE_MAPPING ="java-xml-type-mapping";//$NON-NLS-1$ - public String METHOD_PARAM_PARTS_MAPPING ="method-param-parts-mapping";//$NON-NLS-1$ - public String METHOD_RETURN_VALUE ="method-return-value";//$NON-NLS-1$ - public String PACKAGE_MAPPING ="package-mapping";//$NON-NLS-1$ - public String PACKAGE_TYPE ="package-type";//$NON-NLS-1$ - public String PARAMETER_MODE ="parameter-mode";//$NON-NLS-1$ - public String PARAM_POSITION ="param-position";//$NON-NLS-1$ - public String PARAM_TYPE ="param-type";//$NON-NLS-1$ - public String PORT_MAPPING ="port-mapping";//$NON-NLS-1$ - public String QNAME_SCOPE ="qname-scope";//$NON-NLS-1$ - public String ANONYMOUS_TYPE_QNAME = "anonymous-type-qname";//$NON-NLS-1$ - public String ROOT_TYPE_QNAME ="root-type-qname";//$NON-NLS-1$ - //public String SERVICE_ENDPOINT_INTERFACE ="service-endpoint-interface"; - public String SERVICE_ENDPOINT_INTERFACE_MAPPING ="service-endpoint-interface-mapping";//$NON-NLS-1$ - public String SERVICE_ENDPOINT_METHOD_MAPPING ="service-endpoint-method-mapping";//$NON-NLS-1$ - //public String SERVICE_INTERFACE ="service-interface"; - public String SERVICE_INTERFACE_MAPPING ="service-interface-mapping";//$NON-NLS-1$ - //public String SOAP_HEADER ="soap_header"; - public String VARIABLE_MAPPING ="variable-mapping";//$NON-NLS-1$ - public String WRAPPED_ELEMENT ="wrapped-element";//$NON-NLS-1$ - public String WSDL_BINDING ="wsdl-binding";//$NON-NLS-1$ - public String WSDL_MESSAGE ="wsdl-message";//$NON-NLS-1$ - public String WSDL_MESSAGE_MAPPING ="wsdl-message-mapping";//$NON-NLS-1$ - public String WSDL_MESSAGE_PART_NAME ="wsdl-message-part-name";//$NON-NLS-1$ - public String WSDL_OPERATION ="wsdl-operation";//$NON-NLS-1$ - public String WSDL_PORT_TYPE ="wsdl-port-type";//$NON-NLS-1$ - public String WSDL_RETURN_VALUE_MAPPING ="wsdl-return-value-mapping";//$NON-NLS-1$ - public String WSDL_SERVICE_NAME ="wsdl-service-name";//$NON-NLS-1$ - public String XML_ATTRIBUTE_NAME ="xml-attribute-name";//$NON-NLS-1$ - public String XML_ELEMENT_NAME ="xml-element-name";//$NON-NLS-1$ - public String XML_WILDCARD ="xml-wildcard";//$NON-NLS-1$ -} - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/SOAPRoleTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/SOAPRoleTranslator.java deleted file mode 100644 index fd0a35aa6..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/SOAPRoleTranslator.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.internal.model.translator.webservices; - - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonPackage; -import org.eclipse.jst.j2ee.webservice.wsdd.WsddPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - - - -public class SOAPRoleTranslator extends Translator implements WsddXmlMapperI { - - private static Translator[] SOAP_ROLE_XLATORS = new Translator[] { - new Translator(TEXT_ATTRIBUTE_VALUE, WscommonPackage.eINSTANCE.getSOAPRole_SoapRole()) - }; - - public SOAPRoleTranslator() { - super(SOAP_ROLE, WsddPackage.eINSTANCE.getHandler_SoapRoles()); - } - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - if (o == null) - return CommonTranslators.EMPTY_CHILDREN; - - return SOAP_ROLE_XLATORS; - } - - - public String getDOMName(Object value) { - return SOAP_ROLE; - } - - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - WscommonFactory fact = WscommonPackage.eINSTANCE.getWscommonFactory(); - return fact.createSOAPRole(); - - } - - public boolean isManagedByParent() { - return false; - } - -} - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/ServletLinkTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/ServletLinkTranslator.java deleted file mode 100644 index cf3abda0e..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/ServletLinkTranslator.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.internal.model.translator.webservices; - - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.webservice.wsdd.WsddFactory; -import org.eclipse.jst.j2ee.webservice.wsdd.WsddPackage; -import org.eclipse.wst.common.internal.emf.resource.Translator; - - - -public class ServletLinkTranslator extends Translator implements WsddXmlMapperI { - - private static Translator[] SERVLET_LINK_XLATORS = new Translator[] { - new Translator(TEXT_ATTRIBUTE_VALUE, WsddPackage.eINSTANCE.getServletLink_ServletLink()) - }; - - public ServletLinkTranslator() { - super(SERVLET_LINK, WsddPackage.eINSTANCE.getServiceImplBean_EServletLink()); - } - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - if (o == null) - return CommonTranslators.EMPTY_CHILDREN; - - return SERVLET_LINK_XLATORS; - } - - - public String getDOMName(Object value) { - return SERVLET_LINK; - } - - - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#createEMFObject(java.lang.String, java.lang.String) - */ - public EObject createEMFObject(String nodeName, String readAheadName) { - WsddFactory fact = WsddPackage.eINSTANCE.getWsddFactory(); - return fact.createServletLink(); - - } - - public boolean isManagedByParent() { - return false; - } - -} - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WebServiceCommonXmlMapperI.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WebServiceCommonXmlMapperI.java deleted file mode 100644 index 9bf68c74c..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WebServiceCommonXmlMapperI.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.model.translator.webservices; - -//imports for J2EE core classes -import org.eclipse.jst.j2ee.internal.xml.DeploymentDescriptorXmlMapperI; - -/** - * This interface represents a catalog of all the tag names which occur in - * an web service deployment descriptor. Interface shared by readers and - * writers to have access to common constants - */ -public interface WebServiceCommonXmlMapperI extends DeploymentDescriptorXmlMapperI -{ -// public String WSDL_FILE = "wsdl-file"; -// public String JAXRPC_MAPPING_FILE = "jaxrpc-mapping-file"; - public String NAMESPACEURI = "namespaceURI";//$NON-NLS-1$ - public String LOCALPART = "localpart";//$NON-NLS-1$ -// public String SERVICE_INTERFACE = "service-interface"; - public String SERVICE_ENDPOINT_INTERFACE = "service-endpoint-interface";//$NON-NLS-1$ -// public String HANDLER = "handler"; -// public String HANDLER_NAME = "handler-name"; -// public String HANDLER_CLASS = "handler-class"; - public String INIT_PARAM = "init-param";//$NON-NLS-1$ -// public String PARAM_NAME = "param-name"; -// public String PARAM_VALUE = "param-value"; -// public String SOAP_HEADER = "soap-header"; -// public String SOAP_ROLE = "soap-role"; -// public String PORT_NAME = "port-name"; - -} - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WebServicesTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WebServicesTranslator.java deleted file mode 100644 index c9de1addb..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WebServicesTranslator.java +++ /dev/null @@ -1,135 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.model.translator.webservices; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.internal.model.translator.common.JavaClassTranslator; -import org.eclipse.jst.j2ee.internal.xml.WebServicesDeploymentDescriptorXmlMapperI; -import org.eclipse.jst.j2ee.webservice.wsclient.Webservice_clientPackage; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.RootTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class WebServicesTranslator extends RootTranslator implements WebServicesDeploymentDescriptorXmlMapperI{ - public static WebServicesTranslator INSTANCE = new WebServicesTranslator(); - public static final String WEBSERVICESCLIENT = WEB_SERVICES_CLIENT; - private static CommonPackage COMMON_PKG = CommonPackage.eINSTANCE; - - private static Webservice_clientPackage WEBSERVICECLIENT_PKG = Webservice_clientPackage.eINSTANCE; - - private static Translator[] children13; - - public WebServicesTranslator() { - super(WEBSERVICESCLIENT, Webservice_clientPackage.eINSTANCE.getWebServicesClient()); - } - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - if (children13 == null) - children13 = create13Children(); - return children13; - } - - protected Translator[] create13Children() { - return new Translator[] { - IDTranslator.INSTANCE, - createServiceRefGroupTranslator13(null), - createComponentScopedRefs13() - }; - } - /** - * This model was model from Websphere Webservices - * @param reference - * @return - */ - public static Translator createServiceRefGroupTranslator13(EStructuralFeature feature) { - if (feature == null) - feature = WEBSERVICECLIENT_PKG.getWebServicesClient_ServiceRefs(); - GenericTranslator result = new GenericTranslator(SERVICE_REF, feature); - result.setChildren( new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName()), - new Translator(SMALL_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon()), - new Translator(LARGE_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon()), - new Translator(SERVICE_REF_NAME, WEBSERVICECLIENT_PKG.getServiceRef_ServiceRefName()), - new JavaClassTranslator(SERVICE_INTERFACE, WEBSERVICECLIENT_PKG.getServiceRef_ServiceInterface()), - new Translator(WSDL_FILE, WEBSERVICECLIENT_PKG.getServiceRef_WsdlFile()), - new Translator(JAXRPC_MAPPING_FILE, WEBSERVICECLIENT_PKG.getServiceRef_JaxrpcMappingFile()), - createQNameTranslator10(SERVICE_QNAME, WEBSERVICECLIENT_PKG.getServiceRef_ServiceQname()), - CommonTranslators.createPortComponentRefTranslator(), - createServiceRefHandlerTranslator13(), - }); - - - return result; - } - /** - * This model was model from Websphere Webservices - * @return - */ - public static Translator createServiceRefHandlerTranslator13() { - GenericTranslator result = new GenericTranslator(HANDLER, WEBSERVICECLIENT_PKG.getServiceRef_Handlers()); - result.setChildren(new Translator[]{ - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName()), - new Translator(SMALL_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon()), - new Translator(LARGE_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon()), - new Translator(HANDLER_NAME, WEBSERVICECLIENT_PKG.getHandler_HandlerName()), - new JavaClassTranslator(HANDLER_CLASS, WEBSERVICECLIENT_PKG.getHandler_HandlerClass()), - createParamValueType13(HANDLER_INIT_PARAM, WEBSERVICECLIENT_PKG.getHandler_InitParams()), - createQNameTranslator10(SOAP_HEADER, WEBSERVICECLIENT_PKG.getHandler_SoapHeaders()), - new Translator(SOAP_ROLE, WEBSERVICECLIENT_PKG.getHandler_SoapRoles()), - new Translator(PORT_NAME, WEBSERVICECLIENT_PKG.getHandler_PortNames()) - }); - - return result; - } - /** - * @return - */ - private Translator createComponentScopedRefs13() { - GenericTranslator result = new GenericTranslator(COMP_SCOPED_REFS, WEBSERVICECLIENT_PKG.getWebServicesClient_ComponentScopedRefs()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(COMP_COMPONENT_NAME, WEBSERVICECLIENT_PKG.getComponentScopedRefs_ComponentName()), - createServiceRefGroupTranslator13(WEBSERVICECLIENT_PKG.getComponentScopedRefs_ServiceRefs()) - }); - return result; - } - - public static Translator createQNameTranslator10(String domName, EStructuralFeature feature) { - GenericTranslator result = new GenericTranslator(domName, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(NAMESPACEURI, COMMON_PKG.getQName_NamespaceURI()), - new Translator(LOCALPART, COMMON_PKG.getQName_LocalPart()) - }); - return result; - } - - public static Translator createParamValueType13(String domName, EStructuralFeature feature){ - GenericTranslator result = new GenericTranslator(domName, feature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(PARAM_NAME, COMMON_PKG.getParamValue_Name()), - new Translator(PARAM_VALUE, COMMON_PKG.getParamValue_Value()), - new Translator(DESCRIPTION, COMMON_PKG.getParamValue_Description()) - }); - return result; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WsddTranslator.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WsddTranslator.java deleted file mode 100644 index 1ffa29a36..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WsddTranslator.java +++ /dev/null @@ -1,281 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.j2ee.internal.model.translator.webservices; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jst.j2ee.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.model.translator.common.CommonTranslators; -import org.eclipse.jst.j2ee.webservice.internal.WebServiceConstants; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonPackage; -import org.eclipse.jst.j2ee.webservice.wsdd.WsddPackage; -import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator; -import org.eclipse.wst.common.internal.emf.resource.GenericTranslator; -import org.eclipse.wst.common.internal.emf.resource.IDTranslator; -import org.eclipse.wst.common.internal.emf.resource.RootTranslator; -import org.eclipse.wst.common.internal.emf.resource.Translator; - - - - -public class WsddTranslator extends RootTranslator implements WsddXmlMapperI, J2EEConstants{ - public static WsddTranslator INSTANCE = new WsddTranslator(); - private static Translator[] children10; - private static Translator[] children11; - - private static WsddPackage WSDD_PKG = WsddPackage.eINSTANCE; - private static WscommonPackage WSCOMMON_PKG = WscommonPackage.eINSTANCE; - private static CommonPackage COMMON_PKG = CommonPackage.eINSTANCE; - - protected WsddTranslator() { - super(WEBSERVICES, WsddPackage.eINSTANCE.getWebServices()); - } - - /* (non-Javadoc) - * @see com.ibm.etools.emf2xml.impl.Translator#getChildren(java.lang.Object, int) - */ - public Translator[] getChildren(Object o, int versionID) { - - - - switch (versionID) { - case (J2EE_1_2_ID) : - case (J2EE_1_3_ID) : - if (children10 == null) - { - children10 = create10Children(); - } - return children10; - default : - if (children11 == null) - { - children11 = create11Children(); - } - return children11; - } - } - - - protected Translator[] create10Children() { - return new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName()), - new Translator(SMALL_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon()), - new Translator(LARGE_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon()), - create10WebServiceDescTranslator() - }; - } - - protected Translator[] create11Children() { - - return new Translator[] { - IDTranslator.INSTANCE, - new ConstantAttributeTranslator(XML_NS, J2EE_NS_URL), - new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL), - new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, J2EE_NS_URL+' '+WebServiceConstants.WEBSERVICE_SCHEMA_LOC), - new ConstantAttributeTranslator(VERSION, WebServiceConstants.WEBSERVICE_SCHEMA_VERSION), - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - create11WebServiceDescTranslator() - }; - } - - public Translator create10WebServiceDescTranslator() { - GenericTranslator result = new GenericTranslator(WEBSERVICE_DESCRIPTION, WSDD_PKG.getWebServices_WebServiceDescriptions()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, WSDD_PKG.getWebServiceDescription_Description()), - new Translator(DISPLAY_NAME, WSDD_PKG.getWebServiceDescription_DisplayName()), - new Translator(SMALL_ICON, WSDD_PKG.getWebServiceDescription_SmallIcon()), - new Translator(LARGE_ICON, WSDD_PKG.getWebServiceDescription_LargeIcon()), - new Translator(WEBSERVICE_DESCRIPTION_NAME, WSDD_PKG.getWebServiceDescription_WebServiceDescriptionName()), - new Translator(WSDL_FILE, WSDD_PKG.getWebServiceDescription_WsdlFile()), - new Translator(JAXRPC_MAPPING_FILE, WSDD_PKG.getWebServiceDescription_JaxrpcMappingFile()), - create10PortComponentTranslator() - }); - return result; - } - - public Translator create11WebServiceDescTranslator() { - - GenericTranslator result = new GenericTranslator(WEBSERVICE_DESCRIPTION, WSDD_PKG.getWebServices_WebServiceDescriptions()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - create11DescriptionTranslator(WSDD_PKG.getWebServiceDescription_DescriptionType()), - create11DisplayNameTranslator(WSDD_PKG.getWebServiceDescription_DisplayNameType()), - create11IconTranslator(WSDD_PKG.getWebServiceDescription_IconType()), - new Translator(WEBSERVICE_DESCRIPTION_NAME, WSDD_PKG.getWebServiceDescription_WebServiceDescriptionName()), - new Translator(WSDL_FILE, WSDD_PKG.getWebServiceDescription_WsdlFile()), - new Translator(JAXRPC_MAPPING_FILE, WSDD_PKG.getWebServiceDescription_JaxrpcMappingFile()), - create11PortComponentTranslator() - }); - return result; - } - - - - public Translator create10PortComponentTranslator() { - GenericTranslator result = new GenericTranslator(PORT_COMPONENT, WSDD_PKG.getWebServiceDescription_PortComponents()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, WSDD_PKG.getPortComponent_Description()), - new Translator(DISPLAY_NAME, WSDD_PKG.getPortComponent_DisplayName()), - new Translator(SMALL_ICON, WSDD_PKG.getPortComponent_SmallIcon()), - new Translator(LARGE_ICON, WSDD_PKG.getPortComponent_LargeIcon()), - new Translator(PORT_COMPONENT_NAME, WSDD_PKG.getPortComponent_PortComponentName()), - create10WsdlPortTranslator(), - new Translator(SERVICE_ENPOINT_INTERFACE, WSDD_PKG.getPortComponent_ServiceEndpointInterface()), - createServiceImplBeanTranslator(), - createHandler10Translator() - }); - return result; - } - - public Translator create11PortComponentTranslator() { - GenericTranslator result = new GenericTranslator(PORT_COMPONENT, WSDD_PKG.getWebServiceDescription_PortComponents()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, WSDD_PKG.getPortComponent_Description()), - new Translator(DISPLAY_NAME, WSDD_PKG.getPortComponent_DisplayName()), - new Translator(SMALL_ICON, WSDD_PKG.getPortComponent_SmallIcon()), - new Translator(LARGE_ICON, WSDD_PKG.getPortComponent_LargeIcon()), - new Translator(PORT_COMPONENT_NAME, WSDD_PKG.getPortComponent_PortComponentName()), - CommonTranslators.createQNameTranslator(WSDL_PORT, WSDD_PKG.getPortComponent_WsdlPort()), - new Translator(SERVICE_ENPOINT_INTERFACE, WSDD_PKG.getPortComponent_ServiceEndpointInterface()), - createServiceImplBeanTranslator(), - createHandler11Translator() - }); - return result; - } - - public Translator create10WsdlPortTranslator() { - GenericTranslator result = new GenericTranslator(WSDL_PORT, WSDD_PKG.getPortComponent_WsdlPort()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(NAMESPACEURI, COMMON_PKG.getQName_NamespaceURI()), - new Translator(LOCALPART, COMMON_PKG.getQName_LocalPart()) - }); - return result; - } - - - public Translator createServiceImplBeanTranslator() { - GenericTranslator result = new GenericTranslator(SERVICE_IMPL_BEAN, WSDD_PKG.getPortComponent_ServiceImplBean()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new ServletLinkTranslator(), - new EJBLinkTranslator() - }); - return result; - } - - - public Translator createHandler10Translator() { - GenericTranslator result = new GenericTranslator(HANDLER, WSDD_PKG.getPortComponent_Handlers()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(DESCRIPTION, COMMON_PKG.getCompatibilityDescriptionGroup_Description()), - new Translator(DISPLAY_NAME, COMMON_PKG.getCompatibilityDescriptionGroup_DisplayName()), - new Translator(SMALL_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_SmallIcon()), - new Translator(LARGE_ICON, COMMON_PKG.getCompatibilityDescriptionGroup_LargeIcon()), - new Translator(HANDLER_NAME, WSDD_PKG.getHandler_HandlerName()), - new Translator(HANDLER_CLASS, WSDD_PKG.getHandler_HandlerClass()), - create10InitParamTranslator(), - create10SOAPHeaderTranslator(), - new SOAPRoleTranslator() - }); - return result; - } - - public Translator createHandler11Translator() { - GenericTranslator result = new GenericTranslator(HANDLER, WSDD_PKG.getPortComponent_Handlers()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - CommonTranslators.DESCRIPTIONS_TRANSLATOR, - CommonTranslators.DISPLAYNAMES_TRANSLATOR, - CommonTranslators.ICONS_TRANSLATOR, - new Translator(HANDLER_NAME, WSDD_PKG.getHandler_HandlerName()), - new Translator(HANDLER_CLASS, WSDD_PKG.getHandler_HandlerClass()), - create11InitParamTranslator(), - CommonTranslators.createQNameTranslator(SOAP_HEADER, WSDD_PKG.getHandler_SoapHeaders()), - new SOAPRoleTranslator() - }); - return result; - } - - public Translator create10InitParamTranslator() { - GenericTranslator result = new GenericTranslator(INIT_PARAM, WSDD_PKG.getHandler_InitParams()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(PARAM_NAME, WSCOMMON_PKG.getInitParam_ParamName()), - new Translator(PARAM_VALUE, WSCOMMON_PKG.getInitParam_ParamValue()), - new Translator(DESCRIPTION, WSCOMMON_PKG.getInitParam_Description()) - }); - return result; - } - - public Translator create11InitParamTranslator() { - GenericTranslator result = new GenericTranslator(INIT_PARAM, WSDD_PKG.getHandler_InitParams()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - create11DescriptionTranslator(WSCOMMON_PKG.getInitParam_DescriptionTypes()), - new Translator(PARAM_NAME, WSCOMMON_PKG.getInitParam_ParamName()), - new Translator(PARAM_VALUE, WSCOMMON_PKG.getInitParam_ParamValue()) - }); - return result; - } - - - public Translator create10SOAPHeaderTranslator() { - GenericTranslator result = new GenericTranslator(SOAP_HEADER, WSDD_PKG.getHandler_SoapHeaders()); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(NAMESPACEURI, COMMON_PKG.getQName_NamespaceURI()), - new Translator(LOCALPART, COMMON_PKG.getQName_LocalPart()) - }); - return result; - } - - public Translator create11DescriptionTranslator(EStructuralFeature afeature) { - GenericTranslator result = new GenericTranslator(DESCRIPTION, afeature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(LANG, COMMON_PKG.getDescription_Lang(), Translator.DOM_ATTRIBUTE), - new Translator(Translator.TEXT_ATTRIBUTE_VALUE, COMMON_PKG.getDescription_Value()) - }); - return result; - } - public Translator create11DisplayNameTranslator(EStructuralFeature afeature) { - GenericTranslator result = new GenericTranslator(DISPLAY_NAME, afeature); - result.setChildren(new Translator[] { - IDTranslator.INSTANCE, - new Translator(LANG, COMMON_PKG.getDisplayName_Lang(), Translator.DOM_ATTRIBUTE), - new Translator(Translator.TEXT_ATTRIBUTE_VALUE, COMMON_PKG.getDisplayName_Value()) - }); - return result; - } - - private Translator create11IconTranslator(EStructuralFeature afeature) { - GenericTranslator result = new GenericTranslator(ICON, afeature); - result.setChildren(new Translator[] { - new Translator(LANG, COMMON_PKG.getIconType_Lang(), Translator.DOM_ATTRIBUTE), - IDTranslator.INSTANCE, - new Translator(SMALL_ICON, COMMON_PKG.getIconType_SmallIcon()), - new Translator(LARGE_ICON, COMMON_PKG.getIconType_LargeIcon()) - }); - return result; - } - -} - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WsddXmlMapperI.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WsddXmlMapperI.java deleted file mode 100644 index a435cb5d2..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/model/translator/webservices/WsddXmlMapperI.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.model.translator.webservices; - -//imports for J2EE core classes -//import org.eclipse.jst.j2ee.internal.xml.DeploymentDescriptorXmlMapperI; - -/** - * This interface represents a catalog of all the tag names which occur in - * an web service deployment descriptor. Interface shared by readers and - * writers to have access to common constants - */ -public interface WsddXmlMapperI extends WebServiceCommonXmlMapperI -{ - public String WEBSERVICES = "webservices";//$NON-NLS-1$ - public String WEBSERVICE_DESCRIPTION = "webservice-description";//$NON-NLS-1$ - public String WEBSERVICE_DESCRIPTION_NAME = "webservice-description-name";//$NON-NLS-1$ - public String PORT_COMPONENT = "port-component";//$NON-NLS-1$ - public String PORT_COMPONENT_NAME = "port-component-name";//$NON-NLS-1$ - public String WSDL_PORT = "wsdl-port";//$NON-NLS-1$ - public String SERVICE_IMPL_BEAN = "service-impl-bean";//$NON-NLS-1$ - public String SERVLET_LINK = "servlet-link";//$NON-NLS-1$ - //EJB_LINK is defined in DeploymentDescriptorXmlMapperI - //public String EJB_LINK = "ejb-link"; - -} - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/CollectingErrorHandler.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/CollectingErrorHandler.java deleted file mode 100644 index 31337e73b..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/CollectingErrorHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - - - -import java.util.ArrayList; -import java.util.List; - -import org.xml.sax.ErrorHandler; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; -/** - * Insert the type's description here. - * Creation date: (03/19/01 11:10:38 AM) - * @author: Administrator - */ -public class CollectingErrorHandler implements ErrorHandler { - protected List caughtExceptions; -/** - * CollectingErrorHandler constructor comment. - */ -public CollectingErrorHandler() { - super(); -} -/** - * @see org.xml.sax.ErrorHandler - */ -public void error(SAXParseException exception) throws SAXException { - getCaughtExceptions().add(exception); -} -/** - * @see org.xml.sax.ErrorHandler - */ -public void fatalError(SAXParseException exception) throws SAXException { - getCaughtExceptions().add(exception); -} -public List getCaughtExceptions() { - if (caughtExceptions == null) { - caughtExceptions = new ArrayList(); - } - return caughtExceptions; -} - -/** - * @see org.xml.sax.ErrorHandler - */ -public void warning(SAXParseException exception) throws SAXException { - getCaughtExceptions().add(exception); -} -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/DeploymentDescriptorXmlMapperI.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/DeploymentDescriptorXmlMapperI.java deleted file mode 100644 index 63218d104..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/DeploymentDescriptorXmlMapperI.java +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - - - - -/** - * This interface represents a catalog of all the tag names which may be shared in - * a deployment descriptor for EJBJars, ears, and wars. Interface shared by readers and - * writers to have access to common constants - */ - -public interface DeploymentDescriptorXmlMapperI { - String DESCRIPTION = "description";//$NON-NLS-1$ - String DISPLAY_NAME = "display-name";//$NON-NLS-1$ - String EJB_LINK = "ejb-link";//$NON-NLS-1$ - String ENV_ENTRY = "env-entry";//$NON-NLS-1$ - String ENV_ENTRY_NAME = "env-entry-name";//$NON-NLS-1$ - String ENV_ENTRY_TYPE = "env-entry-type";//$NON-NLS-1$ - String ENV_ENTRY_VALUE = "env-entry-value";//$NON-NLS-1$ - String EJB_LOCAL_REF = "ejb-local-ref"; //$NON-NLS-1$ // J2EE1.3 - String EJB_REF = "ejb-ref";//$NON-NLS-1$ - String EJB_REF_NAME = "ejb-ref-name";//$NON-NLS-1$ - String EJB_REF_TYPE = "ejb-ref-type";//$NON-NLS-1$ - String HOME = "home";//$NON-NLS-1$ - String ICON = "icon";//$NON-NLS-1$ - String ID = "id";//$NON-NLS-1$ - String LARGE_ICON = "large-icon";//$NON-NLS-1$ - String LARGE_ICON_PATH = "icon/large-icon";//$NON-NLS-1$ - String LOCAL = "local";//$NON-NLS-1$ // J2EE1.3 - String LOCAL_HOME = "local-home";//$NON-NLS-1$ // J2EE1.3 - String REMOTE = "remote";//$NON-NLS-1$ - String RES_AUTH = "res-auth";//$NON-NLS-1$ - String RES_REF_NAME = "res-ref-name";//$NON-NLS-1$ - String RES_SHARING_SCOPE = "res-sharing-scope";//$NON-NLS-1$ // J2EE1.3 - String RES_TYPE = "res-type";//$NON-NLS-1$ - String RESOURCE_ENV_REF = "resource-env-ref"; //$NON-NLS-1$ // J2EE1.3 - String RESOURCE_ENV_REF_NAME = "resource-env-ref-name";//$NON-NLS-1$ // J2EE1.3 - String RESOURCE_ENV_REF_TYPE = "resource-env-ref-type";//$NON-NLS-1$ // J2EE1.3 - String RESOURCE_REF = "resource-ref";//$NON-NLS-1$ - String ROLE_LINK = "role-link";//$NON-NLS-1$ - String ROLE_NAME = "role-name";//$NON-NLS-1$ - String RUN_AS = "run-as"; //$NON-NLS-1$ // J2EE1.3 - String SECURITY_IDENTITY = "security-identity"; //$NON-NLS-1$ // J2EE1.3 - String SECURITY_ROLE = "security-role";//$NON-NLS-1$ - String SECURITY_ROLE_REF = "security-role-ref";//$NON-NLS-1$ - String SMALL_ICON = "small-icon";//$NON-NLS-1$ - String SMALL_ICON_PATH = "icon/small-icon";//$NON-NLS-1$ - String USE_CALLER_IDENTITY = "use-caller-identity";//$NON-NLS-1$ // J2EE1.3 - - - // J2EE 1.4 - String LANG = "xml:lang";//$NON-NLS-1$ - String DEPLOY_EXT = "deployment-extension"; //$NON-NLS-1$ // J2EE1.4 - String EXT_ELEMENT = "extension-element"; //$NON-NLS-1$ // J2EE1.4 - String MESSAGE_DEST_REF = "message-destination-ref";//$NON-NLS-1$ // J2EE1.4 - String MESSAGE_DEST_REF_NAME = "message-destination-ref-name";//$NON-NLS-1$ // J2EE1.4 - String MESSAGE_DEST_TYPE = "message-destination-type";//$NON-NLS-1$ // J2EE1.4 - String MESSAGE_DEST_LINK = "message-destination-link"; //$NON-NLS-1$ // J2EE1.4 - String MESSAGE_DEST_USAGE = "message-destination-usage";//$NON-NLS-1$ // J2EE1.4 - String MESSAGE_DEST = "message-destination"; //$NON-NLS-1$ // J2EE1.4 - String MESSAGE_DEST_NAME = "message-destination-name"; //$NON-NLS-1$ // J2EE1.4 - String SERVICE_REF = "service-ref";//$NON-NLS-1$ - String SERVICE_REF_NAME = "service-ref-name";//$NON-NLS-1$ - String SERVICE_INTERFACE = "service-interface";//$NON-NLS-1$ - String WSDL_FILE = "wsdl-file";//$NON-NLS-1$ - String JAXRPC_MAPPING_FILE = "jaxrpc-mapping-file";//$NON-NLS-1$ - String SERVICE_QNAME = "service-qname";//$NON-NLS-1$ - String PORT_COMPONENT_REF = "port-component-ref";//$NON-NLS-1$ - String HANDLER = "handler";//$NON-NLS-1$ - String SERVICE_ENPOINT_INTERFACE = "service-endpoint-interface";//$NON-NLS-1$ - String PORT_COMPONENT_LINK = "port-component-link";//$NON-NLS-1$ - String HANDLER_NAME = "handler-name";//$NON-NLS-1$ - String HANDLER_CLASS = "handler-class";//$NON-NLS-1$ - String HANDLER_INIT_PARAM = "init-param";//$NON-NLS-1$ - String SOAP_HEADER = "soap-header";//$NON-NLS-1$ - String SOAP_ROLE = "soap-role";//$NON-NLS-1$ - String PORT_NAME = "port-name";//$NON-NLS-1$ - String VERSION = "version";//$NON-NLS-1$ - String XML_NS = "xmlns";//$NON-NLS-1$ - String XML_NS_XSI = "xmlns:xsi";//$NON-NLS-1$ - String XSI_SCHEMA_LOCATION = "xsi:schemaLocation";//$NON-NLS-1$ - String NAMESPACE = "namespace";//$NON-NLS-1$ - String MUSTUNDERSTAND = "mustUnderstand";//$NON-NLS-1$ - String PARAM_NAME = "param-name";//$NON-NLS-1$ - String PARAM_VALUE = "param-value";//$NON-NLS-1$ - String LISTENER_CLASS = "listener-class";//$NON-NLS-1$ // Servlet2.3 - - - -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/EarDeploymentDescriptorXmlMapperI.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/EarDeploymentDescriptorXmlMapperI.java deleted file mode 100644 index 45c82e298..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/EarDeploymentDescriptorXmlMapperI.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - - - -/** - * This interface represents a catalog of all the tag names which occur in - * an EAR deployment descriptor. Interface shared by readers and - * writers to have access to common constants - */ -public interface EarDeploymentDescriptorXmlMapperI extends DeploymentDescriptorXmlMapperI { - String ALT_DD = "alt-dd";//$NON-NLS-1$ - String APPLICATION = "application";//$NON-NLS-1$ - String CONTEXT_ROOT = "context-root";//$NON-NLS-1$ - String EJB = "ejb";//$NON-NLS-1$ - String JAVA = "java";//$NON-NLS-1$ - String MODULE = "module";//$NON-NLS-1$ - String WEB = "web";//$NON-NLS-1$ - String WEB_URI = "web-uri";//$NON-NLS-1$ - String CONNECTOR = "connector";//$NON-NLS-1$ -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/EjbDeploymentDescriptorXmlMapperI.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/EjbDeploymentDescriptorXmlMapperI.java deleted file mode 100644 index b57ecb14c..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/EjbDeploymentDescriptorXmlMapperI.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - - - -/** - * This interface represents a catalog of all the tag names which occur in - * an EJB Jar deployment descriptor. Interface shared by readers and - * writers to have access to common constants - */ - -public interface EjbDeploymentDescriptorXmlMapperI extends DeploymentDescriptorXmlMapperI { - String ABSTRACT_SCHEMA_NAME = "abstract-schema-name"; //$NON-NLS-1$ // EJB2.0 - String ACKNOWLEDGE_MODE = "acknowledge-mode";//$NON-NLS-1$ // EJB2.0 - String ASSEMBLY_DESCRIPTOR = "assembly-descriptor";//$NON-NLS-1$ - String BEAN = "Bean";//$NON-NLS-1$ - String CASCADE_DELETE = "cascade-delete";//$NON-NLS-1$ // EJB2.0 - String CMP_FIELD = "cmp-field";//$NON-NLS-1$ - String CMP_VERSION = "cmp-version"; //$NON-NLS-1$ // EJB2.0 - String CMR_FIELD = "cmr-field"; //$NON-NLS-1$ // EJB2.0 - String CMR_FIELD_NAME = "cmr-field-name";//$NON-NLS-1$ // EJB2.0 - String CMR_FIELD_TYPE = "cmr-field-type";//$NON-NLS-1$ // EJB2.0 - String CONTAINER = "Container";//$NON-NLS-1$ - String CONTAINER_TRANSACTION = "container-transaction";//$NON-NLS-1$ - String DESTINATION_TYPE = "destination-type"; //$NON-NLS-1$ // EJB2.0 - String EJB_CLASS = "ejb-class";//$NON-NLS-1$ - String EJB_CLIENT_JAR = "ejb-client-jar";//$NON-NLS-1$ - String EJB_JAR = "ejb-jar";//$NON-NLS-1$ - String EJB_NAME = "ejb-name";//$NON-NLS-1$ - String EJB_QL = "ejb-ql"; //$NON-NLS-1$ // EJB2.0 - String EJB_RELATION = "ejb-relation";//$NON-NLS-1$ // EJB2.0 - String EJB_RELATION_NAME = "ejb-relation-name"; //$NON-NLS-1$ // EJB2.0 - String EJB_RELATIONSHIP_ROLE = "ejb-relationship-role";//$NON-NLS-1$ // EJB2.0 - String EJB_RELATIONSHIP_ROLE_NAME = "ejb-relationship-role-name";//$NON-NLS-1$ // EJB2.0 - String ENTERPRISE_BEANS = "enterprise-beans";//$NON-NLS-1$ - String ENTITY = "entity";//$NON-NLS-1$ - String EXCLUDE_LIST = "exclude-list"; //$NON-NLS-1$// EJB2.0 - MODELED??? - String FIELD_NAME = "field-name";//$NON-NLS-1$ - String MESSAGE_DRIVEN = "message-driven"; //$NON-NLS-1$ // EJB2.0 - String MESSAGE_DRIVEN_DESTINATION = "message-driven-destination"; //$NON-NLS-1$// EJB2.0 - String MESSAGE_SELECTOR = "message-selector"; //$NON-NLS-1$ // EJB2.0 - String METHOD = "method";//$NON-NLS-1$ - String METHOD_INTF = "method-intf";//$NON-NLS-1$ - String METHOD_NAME = "method-name";//$NON-NLS-1$ - String METHOD_PARAM = "method-param";//$NON-NLS-1$ - String METHOD_PARAMS = "method-params";//$NON-NLS-1$ - String METHOD_PERMISSION = "method-permission";//$NON-NLS-1$ - String MULTIPLICITY = "multiplicity";//$NON-NLS-1$ // EJB2.0 - String PERSISTENCE_TYPE = "persistence-type";//$NON-NLS-1$ - String PRIM_KEY_CLASS = "prim-key-class";//$NON-NLS-1$ - String PRIMKEY_FIELD = "primkey-field";//$NON-NLS-1$ - String REENTRANT = "reentrant";//$NON-NLS-1$ - String RELATIONSHIP_ROLE_SOURCE = "relationship-role-source";//$NON-NLS-1$ // EJB2.0 - String RELATIONSHIPS = "relationships"; //$NON-NLS-1$ // EJB2.0 - String RESULT_TYPE_MAPPING = "result-type-mapping"; //$NON-NLS-1$ // EJB2.0 - String QUERY = "query"; //$NON-NLS-1$ // EJB2.0 - String QUERY_METHOD = "query-method"; //$NON-NLS-1$ // EJB2.0 - String SESSION = "session";//$NON-NLS-1$ - String SESSION_TYPE = "session-type";//$NON-NLS-1$ - String SUBSCRIPTION_DURABILITY = "subscription-durability";//$NON-NLS-1$ // EJB2.0 - String TRANS_ATTRIBUTE = "trans-attribute";//$NON-NLS-1$ - String TRANSACTION_TYPE = "transaction-type";//$NON-NLS-1$ - String UNCHECKED = "unchecked"; //$NON-NLS-1$ // EJB2.0 - - //EJB 2.1 - String SERVICE_ENDPOINT = "service-endpoint";//$NON-NLS-1$ - String MESSAGING_TYPE = "messaging-type";//$NON-NLS-1$ - String MESSAGE_DEST_TYPE = "message-destination-type";//$NON-NLS-1$ - String MESSAGE_DEST_LINK = "message-destination-link";//$NON-NLS-1$ - String ACTIVATION_CONF = "activation-config";//$NON-NLS-1$ - String ACTIVATION_CONF_PROPERTY = "activation-config-property";//$NON-NLS-1$ - String ACTIVATION_CONF_PROPERTY_NAME = "activation-config-property-name";//$NON-NLS-1$ - String ACTIVATION_CONF_PROPERTY_VALUE = "activation-config-property-value";//$NON-NLS-1$ -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/GeneralXmlDocumentReader.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/GeneralXmlDocumentReader.java deleted file mode 100644 index 4cba97aff..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/GeneralXmlDocumentReader.java +++ /dev/null @@ -1,329 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.jem.util.logger.proxy.Logger; -import org.w3c.dom.Document; -import org.xml.sax.EntityResolver; -import org.xml.sax.ErrorHandler; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; -/** - * Insert the type's description here. - * Creation date: (4/11/2001 11:58:50 AM) - * @author: Administrator - */ -public class GeneralXmlDocumentReader -{ - protected InputSource inputSource; - protected EntityResolver entityResolver; - protected ErrorHandler errorHandler; - protected boolean doValidate = false; - protected boolean doAllowJavaEncodings = false; - -/** - * GeneralXmlDocumentReader constructor comment. - */ - public GeneralXmlDocumentReader() - { - super(); - } -/** - * GeneralXmlDocumentReader constructor comment. - */ - public GeneralXmlDocumentReader(InputSource source) - { - super(); - setInputSource(source); - } -/** - * GeneralXmlDocumentReader constructor comment. - */ - public GeneralXmlDocumentReader(InputSource source, EntityResolver resolver, ErrorHandler handler) - { - super(); - setInputSource(source); - setEntityResolver(resolver); - setErrorHandler(handler); - } -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:04:18 PM) - * @return org.xml.sax.EntityResolver - */ - protected org.xml.sax.EntityResolver createDefaultEntityResolver() - { - return null; - } -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:04:18 PM) - * @return org.xml.sax.ErrorHandler - */ - protected org.xml.sax.ErrorHandler createDefaultErrorHandler() - { - return new ErrorHandler() { - /* (non-Javadoc) - * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException) - */ - public void error(SAXParseException exception) throws SAXException { - throw exception; - } - /* (non-Javadoc) - * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException) - */ - public void fatalError(SAXParseException exception) throws SAXException { - throw exception; - } - /* (non-Javadoc) - * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException) - */ - public void warning(SAXParseException exception) throws SAXException { - Logger.getLogger().logWarning(exception); - } - }; - } - protected javax.xml.parsers.DocumentBuilder createNewDOMParser() - { - try - { - javax.xml.parsers.DocumentBuilderFactory dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance(); - setFeatures(dbf); - return dbf.newDocumentBuilder(); - - } - catch (Exception ie) - { - handleException(J2EEXMLResourceHandler.getString(XMLParseResourceHandler.failed_instantiating_EXC_, (new Object[] {"Failed to instantiate parser"})), ie); //$NON-NLS-1$ // = "Failed instantiating: " - } - return null; - } -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:01:34 PM) - * @return boolean - */ - public boolean doAllowJavaEncodings() - { - return doAllowJavaEncodings; - } -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:01:34 PM) - * @return boolean - */ - public boolean doValidate() - { - return doValidate; - } -/** - * Insert the method's description here. - * Creation date: (4/11/2001 1:34:14 PM) - * @return java.lang.ClassLoader - */ - public java.lang.ClassLoader getClassLoader() - { - ClassLoader cl = getClass().getClassLoader(); - if (cl == null) - cl = Thread.currentThread().getContextClassLoader(); - if (cl == null) - cl = ClassLoader.getSystemClassLoader(); - - return cl; - } - public Document getDocument() - { - return parseDocument(); - } - - protected Document getDocument(javax.xml.parsers.DocumentBuilder domParser) - { - return domParser.newDocument(); - } - - -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:04:18 PM) - * @return org.xml.sax.EntityResolver - */ - public org.xml.sax.EntityResolver getEntityResolver() - { - if (entityResolver == null) - entityResolver = createDefaultEntityResolver(); - return entityResolver; - } -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:04:18 PM) - * @return org.xml.sax.ErrorHandler - */ - public org.xml.sax.ErrorHandler getErrorHandler() - { - if (errorHandler == null) - { - errorHandler = createDefaultErrorHandler(); - } - return errorHandler; - } - -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:04:18 PM) - * @return org.xml.sax.InputSource - */ - public org.xml.sax.InputSource getInputSource() - { - return inputSource; - } - - protected void handleException(String aMessage, Throwable anException) - { - if (anException instanceof InvocationTargetException) - { - InvocationTargetException invocationEx = - (InvocationTargetException) anException; - if (invocationEx.getTargetException() != null) - handleException(aMessage, invocationEx.getTargetException()); - } - else - primHandleException(aMessage, anException); - } - - protected Document parse(javax.xml.parsers.DocumentBuilder domParser, InputSource is) - { - try - { - return domParser.parse(is); - } - catch (org.xml.sax.SAXException ex) - { - handleException(J2EEXMLResourceHandler.getString(XMLParseResourceHandler.failed_instantiating_EXC_, (new Object[] {"SAX Parser error"})), ex); //$NON-NLS-1$ // = "Failed instantiating: " - - } - catch (java.io.IOException ex) - { - handleException(J2EEXMLResourceHandler.getString(XMLParseResourceHandler.failed_instantiating_EXC_, (new Object[] {"IO Exception on input stream"})), ex); //$NON-NLS-1$ // = "Failed instantiating: " - } - return null; - } - - - public Document parseDocument() - { - ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - javax.xml.parsers.DocumentBuilder parser = createNewDOMParser(); - setEntityResolver(parser); - setErrorHandler(parser); - return parse(parser, getInputSource()); - } finally { - Thread.currentThread().setContextClassLoader(prevClassLoader); - } - - - - - - } - - protected void primHandleException(String aMessage, Throwable anException) - { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(anException); - throw new RuntimeException(aMessage); - - } -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:01:34 PM) - * @param newAllowJavaEncodings boolean - */ - public void setAllowJavaEncodings(boolean newAllowJavaEncodings) - { - doAllowJavaEncodings = newAllowJavaEncodings; - } - - protected void setEntityResolver(javax.xml.parsers.DocumentBuilder domParser) - { - if (getEntityResolver() != null) - { - domParser.setEntityResolver(getEntityResolver()); - } - } - - -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:04:18 PM) - * @param newEntityResolver org.xml.sax.EntityResolver - */ - public void setEntityResolver(org.xml.sax.EntityResolver newEntityResolver) - { - entityResolver = newEntityResolver; - } - - - protected void setErrorHandler(javax.xml.parsers.DocumentBuilder domParser) - { - if (getErrorHandler() != null) - { - domParser.setErrorHandler(getErrorHandler()); - } - } - - -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:04:18 PM) - * @param newErrorHandler org.xml.sax.ErrorHandler - */ - public void setErrorHandler(org.xml.sax.ErrorHandler newErrorHandler) - { - errorHandler = newErrorHandler; - } - - protected void setFeatures(javax.xml.parsers.DocumentBuilderFactory domParser) - { - try { - domParser.setValidating(doValidate()); - domParser.setAttribute("http://apache.org/xml/features/allow-java-encodings", new Boolean(doAllowJavaEncodings())); //$NON-NLS-1$ - domParser.setExpandEntityReferences(true); - } catch(IllegalArgumentException e) { - //Ignore - } - } - - -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:04:18 PM) - * @param newInputSource org.xml.sax.InputSource - */ - public void setInputSource(org.xml.sax.InputSource newInputSource) - { - inputSource = newInputSource; - } -/** - * Insert the method's description here. - * Creation date: (4/11/2001 12:01:34 PM) - * @param newValidate boolean - */ - public void setValidate(boolean newValidate) - { - doValidate = newValidate; - } -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/J2EEXMLResourceHandler.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/J2EEXMLResourceHandler.java deleted file mode 100644 index 92f8095fd..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/J2EEXMLResourceHandler.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - -import org.eclipse.osgi.util.NLS; - -public class J2EEXMLResourceHandler extends NLS { - private static final String BUNDLE_NAME = "j2eexml";//$NON-NLS-1$ - - private J2EEXMLResourceHandler() { - // Do not instantiate - } - - public static String Valid_values_are___EXC_; - public static String RAR_file_support__IO_excep_EXC_; - public static String Failure_occurred_reading_x_EXC_; - public static String missing_req_field_EXC_; - public static String An_IO_Exception_occurred_w_EXC_; - public static String must_be_boolean_EXC_; - public static String unsupported_encoding_EXC_; - public static String rar_dtd_not_found_EXC_; - public static String empty_collection_EXC_; - public static String must_be_int_EXC_; - public static String Invalid_value_for__EXC_; - public static String An_Exception_occurred_whil_EXC_; - public static String dtd_not_found_EXC_; - public static String Not_supported_in_this_rele_EXC_; - public static String io_ex_saving_EXC_; - public static String could_not_create_file_EXC_; - public static String unsupported_type_EXC_; - public static String Key1; - - static { - NLS.initializeMessages(BUNDLE_NAME, J2EEXMLResourceHandler.class); - } - - public static String getString(String key, Object[] args) { - return NLS.bind(key, args); - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/J2EEXmlDtDEntityResolver.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/J2EEXmlDtDEntityResolver.java deleted file mode 100644 index ec6b64d93..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/J2EEXmlDtDEntityResolver.java +++ /dev/null @@ -1,135 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - - - -import java.io.FileNotFoundException; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - - -public class J2EEXmlDtDEntityResolver implements org.xml.sax.EntityResolver { - - /** All the dtds that this resolver knows about; import strategies register these - * at startup */ - protected static Map supportedDtDs; - static { - registerDtD("http://www.w3.org/2001/xml.xsd", "xml.xsd"); //$NON-NLS-1$ //$NON-NLS-2$ - registerDtD("XMLSchema.dtd", "XMLSchema.dtd"); //$NON-NLS-1$ //$NON-NLS-2$ - registerDtD("datatypes.dtd", "datatypes.dtd"); //$NON-NLS-1$ //$NON-NLS-2$ - } - public static J2EEXmlDtDEntityResolver INSTANCE = new J2EEXmlDtDEntityResolver(); -/** - * EjbXmlEntityResolver constructor comment. - */ -public J2EEXmlDtDEntityResolver() { - super(); -} -public static Map getSupportedDtDs() { - if (supportedDtDs == null) - supportedDtDs = new HashMap(); - return supportedDtDs; -} -/** - * Maps the system id for the dtd to a local id to be retrieved loaded from the class path - */ -public static void registerDtD(String systemID, String localID) { - //Make sure local file exists on classpath first. - - ClassLoader loader = J2EEXmlDtDEntityResolver.class.getClassLoader(); - URL url = null; - if (loader == null) { - url = ClassLoader.getSystemResource(localID); - } else { - url = loader.getResource(localID); - } - if (url == null) { - return; - } - getSupportedDtDs().put(systemID, localID); - getSupportedDtDs().put(getShortName(systemID), localID); -} -/** - * for a system id with a URL that begins with "http://java.sun.com/", check to see if that is a recognized dtd; - * if so, load the dtd from the class path using the value of the registered dtd. - * - * @return an Input source on a locally resolved dtd, or null of the systemid does not start with "http://java.sun.com/" - * - * @throws SAXException with a nested NotSupportedException if the dtd is not recognized - * @throws FileNotFoundException if the resolved dtd cannot be loaded from the classpath - */ -public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) throws java.io.IOException, org.xml.sax.SAXException { - String localResourceName = null; - //boolean isJavaSytemId = false; - if (shouldBeRegistered(systemId)) { - localResourceName = (String)getSupportedDtDs().get(systemId); - //isJavaSytemId = true; - } else { - String shortName = getShortName(systemId); - localResourceName = (String)getSupportedDtDs().get(shortName); - if (localResourceName != null) - systemId = localResourceName; - } - - if (localResourceName == null) { - return null; - } - ClassLoader loader = getClass().getClassLoader(); - URL url = null; - if (loader == null) { - url = ClassLoader.getSystemResource(localResourceName); - } else { - url = loader.getResource(localResourceName); - } - - - if (url == null) { - String message = J2EEXMLResourceHandler.getString(J2EEXMLResourceHandler.dtd_not_found_EXC_, (new Object[] {localResourceName}));// = "Could not parse xml because the resolved resource "{0}" could not be found in classpath" - throw new java.io.FileNotFoundException(message); - } - - InputSource result = new InputSource(url.toString()); - result.setPublicId(publicId); - // force the encoding to be UTF8 - result.setEncoding("UTF-8"); //$NON-NLS-1$ - - return result; -} -protected boolean shouldBeRegistered(String systemId) { - - return systemId.startsWith(J2EEConstants.JAVA_SUN_COM_URL) - || systemId.startsWith(J2EEConstants.WWW_W3_ORG_URL) - || systemId.startsWith(J2EEConstants.WWW_IBM_COM_URL); -} - -/** - * Returns the filename from the uri, or the segment after the last occurrence of a separator - */ -private static String getShortName(String uri) { - String tempURI = uri.replace('\\', '/'); - while (tempURI.endsWith("/")) //$NON-NLS-1$ - tempURI = tempURI.substring(0, tempURI.length()-1); - int lastIndex = tempURI.lastIndexOf('/'); - if (lastIndex == -1) - return uri; - return uri.substring(lastIndex+1, tempURI.length()); -} -} - - - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/MissingRequiredDataException.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/MissingRequiredDataException.java deleted file mode 100644 index 4d1f229a8..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/MissingRequiredDataException.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - - - -public class MissingRequiredDataException extends RuntimeException { - -private static final long serialVersionUID = -301039854542561304L; -/** - * MissingRequiredDataException constructor comment. - */ -public MissingRequiredDataException() { - super(); -} -/** - * MissingRequiredDataException constructor comment. - * @param s java.lang.String - */ -public MissingRequiredDataException(String s) { - super(s); -} -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/NotSupportedException.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/NotSupportedException.java deleted file mode 100644 index dbb5d1a2f..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/NotSupportedException.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - -import org.eclipse.jst.j2ee.internal.WrappedRuntimeException; - - - - -public class NotSupportedException extends WrappedRuntimeException { -private static final long serialVersionUID = -3535594720987598196L; -/** - * NotSupportedException constructor comment. - */ -public NotSupportedException() { - super(); -} -/** - * NotSupportedException constructor comment. - * @param e java.lang.Exception - */ -public NotSupportedException(Exception e) { - super(e); -} -/** - * NotSupportedException constructor comment. - * @param s java.lang.String - */ -public NotSupportedException(String s) { - super(s); -} -/** - * NotSupportedException constructor comment. - * @param s java.lang.String - * @param e java.lang.Exception - */ -public NotSupportedException(String s, Exception e) { - super(s, e); -} -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/RarDeploymentDescriptorXmlMapperI.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/RarDeploymentDescriptorXmlMapperI.java deleted file mode 100644 index 78993cebb..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/RarDeploymentDescriptorXmlMapperI.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - - - -/** - * This interface represents a catalog of all the tag names which occur in - * an RAR deployment descriptor. Interface shared by readers and - * writers to have access to common constants - */ -public interface RarDeploymentDescriptorXmlMapperI extends DeploymentDescriptorXmlMapperI { - public String AUTH_MECHANISM = "authentication-mechanism";//$NON-NLS-1$ - public String AUTH_MECH_TYPE = "authentication-mechanism-type";//$NON-NLS-1$ - public String CONFIG_PROPERTY = "config-property";//$NON-NLS-1$ - public String CONFIG_PROPERTY_NAME = "config-property-name";//$NON-NLS-1$ - public String CONFIG_PROPERTY_VALUE = "config-property-value";//$NON-NLS-1$ - public String CONFIG_PROPERTY_TYPE = "config-property-type";//$NON-NLS-1$ - public String CONNECTOR = "connector";//$NON-NLS-1$ - public String CONNECTIONFACTORY_INTERFACE = "connectionfactory-interface";//$NON-NLS-1$ - public String CONNECTIONFACTORY_IMPL_CLASS = "connectionfactory-impl-class";//$NON-NLS-1$ - public String CONNECTION_INTERFACE = "connection-interface";//$NON-NLS-1$ - public String CONNECTION_IMPL_CLASS = "connection-impl-class";//$NON-NLS-1$ - public String CREDENTIAL_INTERFACE = "credential-interface";//$NON-NLS-1$ - public String EIS_TYPE = "eis-type";//$NON-NLS-1$ - public String LICENSE = "license";//$NON-NLS-1$ - public String LICENSE_REQUIRED = "license-required";//$NON-NLS-1$ - public String MANAGEDCONNECTIONFACTORY_CLASS = "managedconnectionfactory-class";//$NON-NLS-1$ - public String REAUTHENTICATION_SUPPORT = "reauthentication-support";//$NON-NLS-1$ - public String RESOURCEADAPTER = "resourceadapter";//$NON-NLS-1$ - public String SECURITY_PERMISSION = "security-permission";//$NON-NLS-1$ - public String SECURITY_PERMISSION_SPEC = "security-permission-spec";//$NON-NLS-1$ - public String SPEC_VERSION = "spec-version";//$NON-NLS-1$ - public String TRANSACTION_SUPPORT = "transaction-support";//$NON-NLS-1$ - public String VENDOR_NAME = "vendor-name";//$NON-NLS-1$ - //JCA 1.5 - public String RESOURCEADAPTER_VERSION = "resourceadapter-version";//$NON-NLS-1$ - public String RESOURCEADAPTER_CLASS = "resourceadapter-class";//$NON-NLS-1$ - public String OUTBOUND_RESOURCEADAPTER = "outbound-resourceadapter";//$NON-NLS-1$ - public String INBOUND_RESOURCEADAPTER = "inbound-resourceadapter";//$NON-NLS-1$ - - public String CONNECTION_DEFINITION = "connection-definition";//$NON-NLS-1$ - public String MESSAGEADAPTER = "messageadapter";//$NON-NLS-1$ - public String MESSAGELISTENER = "messagelistener";//$NON-NLS-1$ - public String MESSAGELISTENER_TYPE = "messagelistener-type";//$NON-NLS-1$ - public String ACTIVATIONSPEC = "activationspec";//$NON-NLS-1$ - public String ACTIVATIONSPEC_CLASS = "activationspec-class";//$NON-NLS-1$ - public String REQUIRED_CONFIG_PROPERTY = "required-config-property";//$NON-NLS-1$ - - public String ADMINOBJECT = "adminobject";//$NON-NLS-1$ - public String ADMINOBJECT_CLASS = "adminobject-class";//$NON-NLS-1$ - public String ADMINOBJECT_INTERFACE = "adminobject-interface"; //$NON-NLS-1$ -} - - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/WarDeploymentDescriptorXmlMapperI.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/WarDeploymentDescriptorXmlMapperI.java deleted file mode 100644 index acf0eaee3..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/WarDeploymentDescriptorXmlMapperI.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - - - -/** - * This interface represents a catalog of all the tag names which occur in - * an WAR deployment descriptor. Interface shared by readers and - * writers to have access to common constants - */ -public interface WarDeploymentDescriptorXmlMapperI extends DeploymentDescriptorXmlMapperI { - public String AUTH_CONSTRAINT = "auth-constraint";//$NON-NLS-1$ - public String AUTH_METHOD = "auth-method";//$NON-NLS-1$ - public String CONTEXT_PARAM = "context-param";//$NON-NLS-1$ - public String DISTRIBUTABLE = "distributable";//$NON-NLS-1$ - public String ERROR_CODE = "error-code";//$NON-NLS-1$ - public String ERROR_PAGE = "error-page";//$NON-NLS-1$ - public String EXCEPTION_TYPE = "exception-type";//$NON-NLS-1$ - public String EXTENSION = "extension";//$NON-NLS-1$ - public String FILTER = "filter"; //$NON-NLS-1$ // Servlet2.3 - public String FILTER_MAPPING = "filter-mapping";//$NON-NLS-1$ // Servlet2.3 - public String FILTER_NAME = "filter-name"; //$NON-NLS-1$ // Servlet2.3 - public String FILTER_CLASS = "filter-class";//$NON-NLS-1$ // Servlet2.3 - public String FORM_ERROR_PAGE = "form-error-page";//$NON-NLS-1$ - public String FORM_LOGIN_CONFIG = "form-login-config";//$NON-NLS-1$ - public String FORM_LOGIN_PAGE = "form-login-page";//$NON-NLS-1$ - public String HTTP_METHOD = "http-method";//$NON-NLS-1$ - public String INIT_PARAM = "init-param";//$NON-NLS-1$ - public String JSP_FILE = "jsp-file";//$NON-NLS-1$ - public String LISTENER = "listener"; //$NON-NLS-1$ // Servlet2.3 - public String LOAD_ON_STARTUP = "load-on-startup";//$NON-NLS-1$ - public String LOCATION = "location";//$NON-NLS-1$ - public String LOGIN_CONFIG = "login-config";//$NON-NLS-1$ - public String MIME_MAPPING = "mime-mapping";//$NON-NLS-1$ - public String MIME_TYPE = "mime-type";//$NON-NLS-1$ - public String REALM_NAME = "realm-name";//$NON-NLS-1$ - public String SECURITY_CONSTRAINT = "security-constraint";//$NON-NLS-1$ - public String SERVLET = "servlet";//$NON-NLS-1$ - public String SERVLET_CLASS = "servlet-class";//$NON-NLS-1$ - public String SERVLET_MAPPING = "servlet-mapping";//$NON-NLS-1$ - public String SERVLET_NAME = "servlet-name";//$NON-NLS-1$ - public String SESSION_CONFIG = "session-config";//$NON-NLS-1$ - public String SESSION_TIMEOUT = "session-timeout";//$NON-NLS-1$ - public String TAGLIB = "taglib";//$NON-NLS-1$ - public String TAGLIB_LOCATION = "taglib-location";//$NON-NLS-1$ - public String TAGLIB_URI = "taglib-uri";//$NON-NLS-1$ - public String TRANSPORT_GUARANTEE = "transport-guarantee";//$NON-NLS-1$ - public String URL_PATTERN = "url-pattern";//$NON-NLS-1$ - public String USER_DATA_CONSTRAINT = "user-data-constraint";//$NON-NLS-1$ - public String WEB_APP = "web-app";//$NON-NLS-1$ - public String WEB_RESOURCE_COLLECTION = "web-resource-collection";//$NON-NLS-1$ - public String WEB_RESOURCE_NAME = "web-resource-name";//$NON-NLS-1$ - public String WELCOME_FILE = "welcome-file";//$NON-NLS-1$ - public String WELCOME_FILE_LIST = "welcome-file-list";//$NON-NLS-1$ - - public String DISPATCHER = "dispatcher";//$NON-NLS-1$ - public String LOCALE_ENCODING_MAPPING_LIST = "locale-encoding-mapping-list";//$NON-NLS-1$ - public String LOCALE_ENCODING_MAPPING = "locale-encoding-mapping";//$NON-NLS-1$ - public String LOCALE = "locale";//$NON-NLS-1$ - public String ENCODING = "encoding";//$NON-NLS-1$ - public String JSP_CONFIG = "jsp-config";//$NON-NLS-1$ - public String JSP_PROPERTY_GROUP = "jsp-property-group";//$NON-NLS-1$ - public String EL_IGNORED = "el-ignored";//$NON-NLS-1$ - public String PAGE_ENCODING = "page-encoding";//$NON-NLS-1$ - public String SCRIPTING_INVALID = "scripting-invalid";//$NON-NLS-1$ - public String IS_XML = "is-xml";//$NON-NLS-1$ - public String INCLUDE_PRELUDE = "include-prelude";//$NON-NLS-1$ - public String INCLUDE_CODA = "include-coda";//$NON-NLS-1$ - -} - - diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/WebServicesDeploymentDescriptorXmlMapperI.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/WebServicesDeploymentDescriptorXmlMapperI.java deleted file mode 100644 index 49868b6a9..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/WebServicesDeploymentDescriptorXmlMapperI.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Aug 5, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.xml; - -/** - * @author dfholttp - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface WebServicesDeploymentDescriptorXmlMapperI extends DeploymentDescriptorXmlMapperI{ - //1.3 specific WebServices DD - public String COMP_SCOPED_REFS = "component-scoped-refs";//$NON-NLS-1$ - public String COMP_COMPONENT_NAME = "component-name";//$NON-NLS-1$ - public String WEB_SERVICES_CLIENT = "webservicesclient";//$NON-NLS-1$ - public String LOCALPART = "localpart";//$NON-NLS-1$ - public String NAMESPACEURI = "namespaceURI";//$NON-NLS-1$ -} diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/XMLParseResourceHandler.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/XMLParseResourceHandler.java deleted file mode 100644 index e7ef7b772..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/XMLParseResourceHandler.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - -import org.eclipse.osgi.util.NLS; - -public final class XMLParseResourceHandler extends NLS { - - private static final String BUNDLE_NAME = "xmlparse";//$NON-NLS-1$ - - private XMLParseResourceHandler() { - // Do not instantiate - } - - public static String method_invoke_failed_EXC_; - public static String failed_to_load_EXC_; - public static String method_not_found_EXC_; - public static String failed_instantiating_EXC_; - public static String parse_exception_occured_EXC_; - - static { - NLS.initializeMessages(BUNDLE_NAME, XMLParseResourceHandler.class); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/XmlDocumentReader.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/XmlDocumentReader.java deleted file mode 100644 index 9a75760da..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/xml/XmlDocumentReader.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.xml; - - - -import java.io.InputStream; - -import org.eclipse.jst.j2ee.internal.WrappedRuntimeException; -import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; -import org.xml.sax.EntityResolver; -import org.xml.sax.ErrorHandler; -import org.xml.sax.InputSource; -import org.xml.sax.SAXParseException; - -/** - * Insert the type's description here. - * Creation date: (02/21/01 4:34:13 PM) - * @author: Administrator - */ -public class XmlDocumentReader extends GeneralXmlDocumentReader { -/** - * XmlDocumentReader constructor comment. - */ -public XmlDocumentReader(InputSource source) { - super(source); - setFlagDefaults(); -} -/** - * XmlDocumentReader constructor comment. - */ -public XmlDocumentReader(InputSource source, EntityResolver resolver, ErrorHandler handler) { - super(source, resolver, handler); - setFlagDefaults(); -} -/** - * Insert the method's description here. - * Creation date: (03/19/01 10:13:26 AM) - * @return org.xml.sax.EntityResolver - */ -public org.xml.sax.EntityResolver createDefaultEntityResolver() { - return J2EEXmlDtDEntityResolver.INSTANCE; -} - -protected void handleException(String aMessage, Throwable anException) { - if (anException instanceof SAXParseException) - handleException(aMessage, (SAXParseException) anException); - else - super.handleException(aMessage, anException); -} -protected void handleException(String aMessage, SAXParseException parseException) { - primHandleException(J2EEXMLResourceHandler.getString(XMLParseResourceHandler.parse_exception_occured_EXC_, (new Object[] {new Integer(parseException.getLineNumber()), new Integer(parseException.getColumnNumber()) })), parseException); - //$NON-NLS-1$ = "An Exception occurred while parsing xml: {0} Line #: {1} :Column #: " -} -protected void primHandleException(String aMessage, Throwable anException) { - if (anException instanceof Exception) - throw new WrappedRuntimeException(aMessage, (Exception)anException); - super.primHandleException(aMessage, anException); -} -protected void setFlagDefaults() { - setAllowJavaEncodings(true); - setValidate(true); -} - public static DocumentType readDocumentType(InputStream in, String uri) { - InputSource source = new InputSource(in); - GeneralXmlDocumentReader aReader = new XmlDocumentReader(source); - aReader.setValidate(false); - Document aDocument = aReader.parseDocument(); - if (aDocument != null) - return aDocument.getDoctype(); - return null; - } - -} - - |