diff options
author | nsandonato | 2011-03-22 20:17:23 +0000 |
---|---|---|
committer | nsandonato | 2011-03-22 20:17:23 +0000 |
commit | ff6d2211aba457598ec0260fba5ccdbe78aeabcb (patch) | |
tree | 0e893cb7f7ce245fa75211e55b4a5b8c6eae3d1a /bundles/org.eclipse.wst.html.core/src/org | |
parent | de10574fddd0606282a9f1621301f8ed9fc96246 (diff) | |
download | webtools.sourceediting-ff6d2211aba457598ec0260fba5ccdbe78aeabcb.tar.gz webtools.sourceediting-ff6d2211aba457598ec0260fba5ccdbe78aeabcb.tar.xz webtools.sourceediting-ff6d2211aba457598ec0260fba5ccdbe78aeabcb.zip |
[302120] trimDirectiveWhitespaces attribute in @tag directive should be valid for JSP 2.1 tag files
Diffstat (limited to 'bundles/org.eclipse.wst.html.core/src/org')
4 files changed, 80 insertions, 7 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 7b9f63470c..7fa1cdf257 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2010 IBM Corporation and others. + * Copyright (c) 2004, 2011 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 @@ -28,7 +28,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, CMDocType.JSP21_DOC_TYPE, CMDocType.HTML5_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.TAG21_DOC_TYPE, CMDocType.JSP21_DOC_TYPE, CMDocType.HTML5_DOC_TYPE}); private static JCMDocImpl jsp11doc = null; @@ -87,6 +87,12 @@ public final class HTMLCMDocumentFactory { return tag20doc; } + else if (CMDocType.TAG21_DOC_TYPE.equals(cmtype)) { + CMNamespaceImpl j21ns = new CMNamespaceImpl(JSP21Namespace.JSP21_URI, JSP11Namespace.JSP_TAG_PREFIX); + TagCM21DocImpl tag21doc = new TagCM21DocImpl(CMDocType.TAG21_DOC_TYPE, j21ns); + return tag21doc; + } + else if (CMDocType.JSP11_DOC_TYPE.equals(cmtype) || CMDocType.JSP12_DOC_TYPE.equals(cmtype)) { if (jsp11doc == null) { CMNamespaceImpl j11ns = new CMNamespaceImpl(JSP11Namespace.JSP11_URI, JSP11Namespace.JSP_TAG_PREFIX); diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java index 8dd86bc99a..13cbfa1615 100644 --- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java +++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 IBM Corporation and others. + * Copyright (c) 2004, 2011 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 @@ -23,7 +23,7 @@ import org.eclipse.wst.xml.core.internal.contentmodel.CMNode; /** * Factory for element declarations of JSP 2.0 Tag files. */ -final class Tag20ElementCollection extends JSPElementCollection implements JSP20Namespace.ElementName { +class Tag20ElementCollection extends JSPElementCollection implements JSP20Namespace.ElementName { // element IDs private static class TagIds20 { public static final int ID_SCRIPTLET = 0; @@ -75,7 +75,7 @@ final class Tag20ElementCollection extends JSPElementCollection implements JSP20 } // attribute creater - private class TACreater20 extends JACreater { + class TACreater20 extends JACreater { public TACreater20() { super(); @@ -140,7 +140,7 @@ final class Tag20ElementCollection extends JSPElementCollection implements JSP20 declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DESCRIPTION, adec); } - private void createForDirTag() { + void createForDirTag() { // ("import" URI optional) AttrDecl adec = new AttrDecl(ATTR_NAME_IMPORT); adec.type = new HTMLCMDataTypeImpl(CMDataType.URI); @@ -685,9 +685,13 @@ final class Tag20ElementCollection extends JSPElementCollection implements JSP20 if (content != null) decl.setContent(content); - TACreater20 creater = new TACreater20(); + TACreater20 creater = getAttributeCreater(); decl.setAttributes(creater.getDeclarations(eid)); return decl; } + + protected TACreater20 getAttributeCreater(){ + return new TACreater20(); + } } diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag21ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag21ElementCollection.java new file mode 100644 index 0000000000..cd23d63fe9 --- /dev/null +++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag21ElementCollection.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2011 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; + +public class Tag21ElementCollection extends Tag20ElementCollection { + + class TACreater21 extends TACreater20{ + + void createForDirTag() { + super.createForDirTag(); + 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 TACreater20 getAttributeCreater(){ + return new TACreater21(); + } +} diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/TagCM21DocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/TagCM21DocImpl.java new file mode 100644 index 0000000000..3ec31c0dd2 --- /dev/null +++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/TagCM21DocImpl.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2011 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; + +/** + * Implementation of CMDocument for the JSP 2.1 tag files. + */ +class TagCM21DocImpl extends JCMDocImpl { + /** + * HCMDocImpl constructor comment. + */ + public TagCM21DocImpl(String docTypeName, CMNamespaceImpl targetNamespace) { + super(docTypeName, targetNamespace, new Tag21ElementCollection()); + } +} |