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 javax.xml.soap.SOAPEnvelope;
19 import javax.xml.soap.SOAPException;
20 import javax.xml.soap.SOAPHeaderElement;
21
22 import org.apache.axis.types.URI;
23 import org.apache.axis.types.URI.MalformedURIException;
24 import org.w3c.dom.Document;
25 import org.w3c.dom.Element;
26
27 /**
28 * Java content class for Recipient element declaration.
29 * <p>
30 * The following schema fragment specifies the expected content contained within
31 * this java content object. (defined at
32 * http://schemas.xmlsoap.org/ws/2004/08/addressing line 83)
33 * <p>
34 *
35 * <pre>
36 * <element
37 * xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
38 * name="Recipient"
39 * type="wsa:EndpointReferenceType"/>
40 * </pre>
41 *
42 * @author Davanum Srinivas
43 * @version $Revision: 14 $
44 */
45 public class Recipient extends EndpointReference {
46 /**
47 * <code>serialVersionUID</code> attribute.
48 */
49 private static final long serialVersionUID = -1141904926460900468L;
50
51 /**
52 * Constructor Recipient.
53 *
54 * @param address Source address
55 */
56 public Recipient(Address address) {
57 super(address);
58 }
59
60 /**
61 * Constructor Recipient.
62 *
63 * @param element Source element
64 * @throws MalformedURIException If an error occurs
65 */
66 public Recipient(SOAPHeaderElement element) throws MalformedURIException {
67 super(element);
68 }
69
70 /**
71 * Constructor Recipient.
72 *
73 * @param uri Source URI
74 */
75 public Recipient(URI uri) {
76 super(uri);
77 }
78
79 /**
80 * {@inheritDoc}
81 */
82 @Override
83 public Element toDOM(Document doc) {
84 return this.toDOM(doc, Constants.RECIPIENT);
85 }
86
87 /**
88 * {@inheritDoc}
89 */
90 public SOAPHeaderElement toSOAPHeaderElement(AddressingVersion version,
91 SOAPEnvelope env, String actorURI) throws SOAPException {
92 return this.toSOAPHeaderElement(version, env, actorURI, Constants.RECIPIENT);
93 }
94 }