1 /*
2 * Copyright (c) 2008 Rodrigo Ruiz
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.apache.axis.message.addressing;
17
18 import org.w3c.dom.Element;
19
20 /**
21 * Represents classes that know how to serialize themselves
22 * into a DOM tree.
23 *
24 * @author Rodrigo Ruiz
25 * @version $Revision: 14 $
26 */
27 public interface DOMAppendable {
28
29 /**
30 * Appends a DOM representation of this instance to the specified element.
31 *
32 * @param version WS-Addressing version to use
33 * @param parent Parent element
34 * @param elementName Name of the element to create
35 */
36 void append(AddressingVersion version, Element parent, String elementName);
37
38 /**
39 * Appends a DOM representation of this instance to
40 * the specified element.
41 *
42 * @param parent Parent element
43 * @param elementName The name of the element to create
44 */
45 void append(Element parent, String elementName);
46
47 /**
48 * Appends a DOM representation of this instance to
49 * the specified element.
50 * <p>
51 * This method should call {@link #append(Element, String)}
52 * with a default value for the elementName parameter. Abstract
53 * classes, or those to be always subclassed may optionally
54 * throw {@link java.lang.UnsupportedOperationException}
55 * instead.
56 *
57 * @param parent Parent element
58 */
59 void append(Element parent);
60 }