blob: bb44fe55b180539cb1f051b7bb873bcbaa949bc8 [file] [log] [blame]
nitind958d79a2004-11-23 19:23:00 +00001/*******************************************************************************
2 * Copyright (c) 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
david_williams56777022005-04-11 06:21:55 +000011package org.eclipse.wst.html.core.internal.contentmodel;
nitind958d79a2004-11-23 19:23:00 +000012
13
14
15import java.util.Arrays;
16
david_williams4ad020f2005-04-18 08:00:30 +000017import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
david_williamsc06c86f2005-03-18 18:23:41 +000018import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
19import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
nitind958d79a2004-11-23 19:23:00 +000020
21/**
22 * PARAM.
23 */
24final class HedPARAM extends HedEmpty {
25
26 /**
27 */
28 public HedPARAM(ElementCollection collection) {
29 super(HTML40Namespace.ElementName.PARAM, collection);
30 layoutType = LAYOUT_HIDDEN;
31 }
32
33 /**
34 * PARAM.
35 * (id ID #IMPLIED)
36 * (name CDATA #REQUIRED) ... should be defined locally.
37 * (value CDATA #IMPLIED)
38 * (valuetype (DATA|REF|OBJECT) DATA)
39 * (type %ContentType; #IMPLIED)
40 */
41 protected void createAttributeDeclarations() {
42 if (attributes != null)
43 return; // already created.
44 if (attributeCollection == null)
45 return; // fatal
46
47 attributes = new CMNamedNodeMapImpl();
48
49 String[] names = {HTML40Namespace.ATTR_NAME_ID, HTML40Namespace.ATTR_NAME_VALUE, HTML40Namespace.ATTR_NAME_VALUETYPE, HTML40Namespace.ATTR_NAME_TYPE};
50 attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
51
52 // (name CDATA #REQUIRED) ... should be defined locally.
53 HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
54 HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
55 attributes.putNamedItem(HTML40Namespace.ATTR_NAME_NAME, attr);
56 }
57}