Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoritrimble2006-06-05 13:31:11 -0400
committeritrimble2006-06-05 13:31:11 -0400
commit40b3e0475cf266132c14093690bd87ba88e2dd06 (patch)
treed763d5417a09e84f43250ed8383386a65234ade9
parente62dc031d4b73df3c32dd012c2837f58cdefa456 (diff)
downloadwebtools.jsf-40b3e0475cf266132c14093690bd87ba88e2dd06.tar.gz
webtools.jsf-40b3e0475cf266132c14093690bd87ba88e2dd06.tar.xz
webtools.jsf-40b3e0475cf266132c14093690bd87ba88e2dd06.zip
https://bugs.eclipse.org/bugs/show_bug.cgi?id=143866
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/AttributeExtensionTranslator.java2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/ComponentExtensionTranslator.java2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/FacetExtensionTranslator.java2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/PropertyExtensionTranslator.java2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/RendererExtensionTranslator.java2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/SkipUnknownChildrenTranslator.java50
6 files changed, 55 insertions, 5 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/AttributeExtensionTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/AttributeExtensionTranslator.java
index e4d214bc2..e5fb8035a 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/AttributeExtensionTranslator.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/AttributeExtensionTranslator.java
@@ -21,7 +21,7 @@ import org.eclipse.wst.common.internal.emf.resource.Translator;
* @author xnjiang, itrimble
*
*/
-public class AttributeExtensionTranslator extends Translator {
+public class AttributeExtensionTranslator extends SkipUnknownChildrenTranslator {
public AttributeExtensionTranslator(String domNameAndPath, EStructuralFeature aFeature) {
super(domNameAndPath, aFeature);//$NON-NLS-1$
}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/ComponentExtensionTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/ComponentExtensionTranslator.java
index 5093c31c0..5c8a9bd4f 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/ComponentExtensionTranslator.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/ComponentExtensionTranslator.java
@@ -21,7 +21,7 @@ import org.eclipse.wst.common.internal.emf.resource.Translator;
* @author xnjiang, itrimble
*
*/
-public class ComponentExtensionTranslator extends Translator {
+public class ComponentExtensionTranslator extends SkipUnknownChildrenTranslator {
public ComponentExtensionTranslator(String domNameAndPath, EStructuralFeature aFeature) {
super(domNameAndPath, aFeature);
}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/FacetExtensionTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/FacetExtensionTranslator.java
index ed21b0b2f..e58a59c18 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/FacetExtensionTranslator.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/FacetExtensionTranslator.java
@@ -21,7 +21,7 @@ import org.eclipse.wst.common.internal.emf.resource.Translator;
* @author xnjiang, itrimble
*
*/
-public class FacetExtensionTranslator extends Translator {
+public class FacetExtensionTranslator extends SkipUnknownChildrenTranslator {
public FacetExtensionTranslator(String domNameAndPath, EStructuralFeature aFeature) {
super(domNameAndPath, aFeature); //$NON-NLS-1$
}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/PropertyExtensionTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/PropertyExtensionTranslator.java
index 93be00ee5..05a0cc801 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/PropertyExtensionTranslator.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/PropertyExtensionTranslator.java
@@ -21,7 +21,7 @@ import org.eclipse.wst.common.internal.emf.resource.Translator;
* @author xnjiang, itrimble
*
*/
-public class PropertyExtensionTranslator extends Translator {
+public class PropertyExtensionTranslator extends SkipUnknownChildrenTranslator {
public PropertyExtensionTranslator(String domNameAndPath, EStructuralFeature aFeature) {
super(domNameAndPath, aFeature);
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/RendererExtensionTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/RendererExtensionTranslator.java
index 3a48e9378..5fb4d01e0 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/RendererExtensionTranslator.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/RendererExtensionTranslator.java
@@ -21,7 +21,7 @@ import org.eclipse.wst.common.internal.emf.resource.Translator;
* @author xnjiang, itrimble
*
*/
-public class RendererExtensionTranslator extends Translator {
+public class RendererExtensionTranslator extends SkipUnknownChildrenTranslator {
public RendererExtensionTranslator(String domNameAndPath, EStructuralFeature aFeature) {
super(domNameAndPath, aFeature);
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/SkipUnknownChildrenTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/SkipUnknownChildrenTranslator.java
new file mode 100644
index 000000000..79c4b6e32
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig/facesconfig/org/eclipse/jst/jsf/facesconfig/internal/translator/SkipUnknownChildrenTranslator.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2005 Oracle Corporation.
+ * 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:
+ * Ian Trimble - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facesconfig.internal.translator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.wst.common.internal.emf.resource.Translator;
+
+/**
+ * SkipUnknownChildrenTranslator has been implemented to temporarily allow
+ * processing of application configuration resource files containing extension
+ * elements (those defined with a content type of "ANY"); it essentially skips
+ * all processing of child elements for which no child Translator has been
+ * defined. This is not intended as a long-term solution.
+ *
+ * @author Ian Trimble - Oracle
+ */
+public class SkipUnknownChildrenTranslator extends Translator {
+
+ /**
+ * Creates an instance.
+ *
+ * @param domNameAndPath DOM name and path for which this Translator is
+ * to be used.
+ * @param aFeature EStructuralFeature instance for which this Translator is
+ * to be used (may be null).
+ */
+ public SkipUnknownChildrenTranslator(String domNameAndPath, EStructuralFeature aFeature) {
+ super(domNameAndPath, aFeature);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.common.internal.emf.resource.Translator#findChild(java.lang.String, java.lang.Object, int)
+ */
+ public Translator findChild(String tagName, Object target, int versionID) {
+ Translator childTranslator = super.findChild(tagName, target, versionID);
+ if (childTranslator == null) {
+ childTranslator = new SkipUnknownChildrenTranslator(tagName, (EStructuralFeature)null);
+ }
+ return childTranslator;
+ }
+
+}

Back to the top