Skip to main content
summaryrefslogtreecommitdiffstats
blob: e1a0d98f041a84818a64200e8683d41bbbc546a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*******************************************************************************
 * Copyright (c) 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.wst.html.core.internal.modelquery;



import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.SimpleAssociationProvider;
import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;

/**
 */
public class HTMLModelQueryAssociationProvider extends SimpleAssociationProvider {

	/**
	 * @param modelQueryCMProvider org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryCMProvider
	 */
	public HTMLModelQueryAssociationProvider(CMDocumentCache cache, URIResolver idResolver) {
		super(new HTMLModelQueryCMProvider(cache, idResolver));
	}

	// MIWA: We cannot cache a CMElementDeclaration any more.  Because, when the DOCTYPE
	// was changed, CMDocument would be changed.  Then, a cached CMElementDeclaration
	// would be invalid.  If some performance problems occurs, we consider a smarter
	// cache mechanism.
	//
	//	public CMElementDeclaration getCMElementDeclaration(Element element) {
	//		// check if element declaration is cached
	//		INodeNotifier notifier = (INodeNotifier) element;
	//		ElementDeclarationAdapter adapter = (ElementDeclarationAdapter) notifier.getExistingAdapter(ElementDeclarationAdapter.class);
	//		if (adapter != null)
	//			return adapter.getDeclaration();
	//
	//		CMElementDeclaration decl = super.getCMElementDeclaration(element);
	//
	//		// cache HTML element declaration only
	//		if (decl != null && decl instanceof HTMLElementDeclaration) {
	//			IAdapterFactory factory = ElementDeclarationAdapterFactory.getInstance();
	//			adapter = (ElementDeclarationAdapter) factory.adapt(notifier);
	//			if (adapter != null)
	//				adapter.setDeclaration(decl);
	//		}
	//
	//		return decl;
	//	}
}

Back to the top