Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornsandonato2009-11-23 19:08:40 +0000
committernsandonato2009-11-23 19:08:40 +0000
commit2226403169b7befcac94bb218ae53530e31f1736 (patch)
treec9c0304e866fa9dcb622b8f7426a52077313bc4e /bundles/org.eclipse.wst.html.core/src/org
parent40d60c638ddcf79e9429c941b799b0defeb55a2f (diff)
downloadwebtools.sourceediting-2226403169b7befcac94bb218ae53530e31f1736.tar.gz
webtools.sourceediting-2226403169b7befcac94bb218ae53530e31f1736.tar.xz
webtools.sourceediting-2226403169b7befcac94bb218ae53530e31f1736.zip
[283365] JSP 2.1 should accept trimDirectiveWhitespaces attribute in @page directive
Diffstat (limited to 'bundles/org.eclipse.wst.html.core/src/org')
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java8
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java20
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java10
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java39
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java17
5 files changed, 90 insertions, 4 deletions
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
index 28316ec94d..7bf524991b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
@@ -27,7 +27,7 @@ import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
public final class HTMLCMDocumentFactory {
private static Hashtable cmdocs = new Hashtable();
- private static List supportedCMtypes = Arrays.asList(new Object[]{CMDocType.HTML_DOC_TYPE, CMDocType.CHTML_DOC_TYPE, CMDocType.JSP11_DOC_TYPE, CMDocType.JSP12_DOC_TYPE, CMDocType.JSP20_DOC_TYPE, CMDocType.TAG20_DOC_TYPE});
+ private static List supportedCMtypes = Arrays.asList(new Object[]{CMDocType.HTML_DOC_TYPE, CMDocType.CHTML_DOC_TYPE, CMDocType.JSP11_DOC_TYPE, CMDocType.JSP12_DOC_TYPE, CMDocType.JSP20_DOC_TYPE, CMDocType.TAG20_DOC_TYPE, CMDocType.JSP21_DOC_TYPE});
private static JCMDocImpl jsp11doc = null;
@@ -68,6 +68,12 @@ public final class HTMLCMDocumentFactory {
return jsp20doc;
}
+ else if (CMDocType.JSP21_DOC_TYPE.equals(cmtype)) {
+ CMNamespaceImpl j21ns = new CMNamespaceImpl(JSP21Namespace.JSP21_URI, JSP11Namespace.JSP_TAG_PREFIX);
+ JCM21DocImpl jsp21doc = new JCM21DocImpl(CMDocType.JSP21_DOC_TYPE, j21ns);
+ return jsp21doc;
+ }
+
else if (CMDocType.TAG20_DOC_TYPE.equals(cmtype)) {
CMNamespaceImpl j20ns = new CMNamespaceImpl(JSP20Namespace.JSP20_URI, JSP11Namespace.JSP_TAG_PREFIX);
TagCMDocImpl tag20doc = new TagCMDocImpl(CMDocType.TAG20_DOC_TYPE, j20ns);
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java
new file mode 100644
index 0000000000..ba9e0cdb0f
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.wst.html.core.internal.contentmodel;
+
+class JCM21DocImpl extends JCMDocImpl {
+ /**
+ * JCM21DocImpl constructor comment.
+ */
+ public JCM21DocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
+ super(docTypeName, targetNamespace, new JSP21ElementCollection());
+ }
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java
index 3ca1dadefe..fd404c5d5b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java
@@ -23,7 +23,7 @@ import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
/**
* Factory for element declarations of JSP 1.1 and JSP 1.2.
*/
-final class JSP20ElementCollection extends JSPElementCollection implements JSP20Namespace.ElementName {
+class JSP20ElementCollection extends JSPElementCollection implements JSP20Namespace.ElementName {
// element IDs
private static class Ids20 extends Ids {
@@ -55,7 +55,7 @@ final class JSP20ElementCollection extends JSPElementCollection implements JSP20
}
// attribute creater
- private class JACreater20 extends JACreater {
+ class JACreater20 extends JACreater {
public JACreater20() {
super();
}
@@ -483,9 +483,13 @@ final class JSP20ElementCollection extends JSPElementCollection implements JSP20
if (content != null)
decl.setContent(content);
- JACreater20 creater = new JACreater20();
+ JACreater20 creater = getAttributeCreator();
decl.setAttributes(creater.getDeclarations(eid));
return decl;
}
+
+ protected JACreater20 getAttributeCreator() {
+ return new JACreater20();
+ }
}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java
new file mode 100644
index 0000000000..4b7a1ba6fb
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+
+class JSP21ElementCollection extends JSP20ElementCollection {
+
+ class JACreator21 extends JACreater20 {
+ void createForDirPage() {
+ super.createForDirPage();
+ AttrDecl adec;
+ // ("trimDirectiveWhitespaces" ENUM DECLARED (true|false) "false")
+ adec = createBoolType(JSP21Namespace.ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES, ATTR_VALUE_FALSE);
+ if (adec != null) {
+ adec.usage = CMAttributeDeclaration.OPTIONAL;
+ declarations.putNamedItem(JSP21Namespace.ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES, adec);
+ }
+ // ("deferredSyntaxAllowedAsLiteral" ENUM DECLARED (true|false) "false")
+ adec = createBoolType(JSP21Namespace.ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, ATTR_VALUE_FALSE);
+ if (adec != null) {
+ adec.usage = CMAttributeDeclaration.OPTIONAL;
+ declarations.putNamedItem(JSP21Namespace.ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, adec);
+ }
+ }
+ }
+
+ protected JACreater20 getAttributeCreator() {
+ return new JACreator21();
+ }
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java
new file mode 100644
index 0000000000..dde35b77c6
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.wst.html.core.internal.contentmodel;
+
+public interface JSP21Namespace extends JSP20Namespace {
+ String JSP21_URI = "";//$NON-NLS-1$
+ String ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES = "trimDirectiveWhitespaces"; //$NON-NLS-1$
+ String ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL = "deferredSyntaxAllowedAsLiteral"; //$NON-NLS-1$
+}

Back to the top