Skip to main content
summaryrefslogtreecommitdiffstats
blob: b857c4e61ae509be3ed706511c1cf599e7691dd8 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*******************************************************************************
 * 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.pagedesigner.dtmanager.converter;

import org.eclipse.jst.pagedesigner.converter.ConvertPosition;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;

/**
 * Represents ITagConverter-specific context and functionality.
 * 
 * <p><b>Provisional API - subject to change</b></p>
 * 
 * @author Ian Trimble - Oracle
 */
public interface ITagConverterContext {

	/**
	 * Gets ITagConverter instance's host Element instance.
	 * 
	 * @return ITagConverter instance's host Element instance.
	 */
	public Element getHostElement();

	/**
	 * Creates an Element instance to be used in ITagConverter's Document
	 * instance.
	 * 
	 * @param tag Name of element to be created.
	 * @return Element instance to be used in ITagConverter's Document
	 * instance.
	 */
	public Element createElement(String tag);

	/**
	 * Creates a Text node instance to be used in ITagConverter's Document
	 * instance.
	 * 
	 * @param content Textual content of the created text node.
	 * @return Text node instance to be used in ITagConverter's Document
	 * instance.
	 */
	public Text createText(String content);

	/**
	 * Adds a child Node instance to ITagConverter's collection of Nodes
	 * requiring subsequent processing.
	 * 
	 * @param childNode Child Node instance requiring subsequent processing.
	 * @param position ConvertPosition instance describing child Node
	 * instance's position, relative to another Node instance.
	 */
	public void addChild(Node childNode, ConvertPosition position);

	/**
	 * Add all child Element instances of srcElement to ITagConverter's
	 * collection of Nodes requiring subsequent processing.
	 * 
	 * @param srcElement Source Element instance from which child Elements are
	 * copied.
	 * @param destElement Destination Element instance to which child Elements
	 * will be relative.
	 */
	public void copyChildren(Element srcElement, Element destElement);

}

Back to the top