|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
Address.java | - | 66.7% | 80% | 71.4% |
|
1 |
/*
|
|
2 |
* Copyright 1999-2004 The Apache Software Foundation.
|
|
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 |
*/
|
|
17 |
|
|
18 |
package org.apache.axis.message.addressing;
|
|
19 |
|
|
20 |
import javax.xml.soap.SOAPElement;
|
|
21 |
|
|
22 |
import org.apache.axis.types.URI;
|
|
23 |
|
|
24 |
import org.w3c.dom.Element;
|
|
25 |
|
|
26 |
import org.apache.axis.message.addressing.util.TextExtractor;
|
|
27 |
|
|
28 |
/**
|
|
29 |
* Class Address
|
|
30 |
*
|
|
31 |
* @author Davanum Srinivas (dims@yahoo.com)
|
|
32 |
*/
|
|
33 |
public class Address extends AttributedURI { |
|
34 |
|
|
35 |
/**
|
|
36 |
* Constructor Address
|
|
37 |
*
|
|
38 |
* @param uri
|
|
39 |
*/
|
|
40 | 52 |
public Address(URI uri) {
|
41 | 52 |
super(uri);
|
42 |
} |
|
43 |
|
|
44 |
/**
|
|
45 |
* Constructor Address
|
|
46 |
*
|
|
47 |
* @param uri
|
|
48 |
* @throws MalformedURIException
|
|
49 |
*/
|
|
50 | 42 |
public Address(String uri) throws MalformedURIException { |
51 | 42 |
this(new URI(uri)); |
52 |
} |
|
53 |
|
|
54 |
/**
|
|
55 |
* append DOM node to parent
|
|
56 |
*
|
|
57 |
* @param parent
|
|
58 |
*/
|
|
59 | 0 |
public void append(Element parent) { |
60 | 0 |
Element child = parent.getOwnerDocument().createElementNS(Constants.NS_URI_ADDRESSING_DEFAULT, |
61 |
Constants.ADDRESS); |
|
62 | 0 |
child.appendChild(parent.getOwnerDocument().createTextNode(toString())); |
63 | 0 |
parent.appendChild(child); |
64 |
} |
|
65 |
|
|
66 | 27 |
public static Address fromSOAPElement(SOAPElement element) |
67 |
throws Exception {
|
|
68 | 27 |
String value = TextExtractor.getText(element); |
69 | 27 |
return new Address(value); |
70 |
} |
|
71 |
|
|
72 | 1 |
public static Address fromElement(Element element) |
73 |
throws Exception {
|
|
74 | 1 |
String value = TextExtractor.getText(element); |
75 | 1 |
return new Address(value); |
76 |
} |
|
77 |
} |
|
78 |
|
|
79 |
|
|
80 |
|
|