01: /*
02: * Copyright 2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: package org.springframework.ws.soap.saaj;
18:
19: import javax.xml.soap.SOAPException;
20: import javax.xml.soap.SOAPHeaderElement;
21: import javax.xml.transform.Result;
22:
23: import org.springframework.ws.soap.SoapHeaderElement;
24: import org.springframework.ws.soap.SoapHeaderException;
25:
26: /**
27: * SAAJ-specific implementation of the <code>SoapHeaderElement</code> interface. Wraps a {@link
28: * javax.xml.soap.SOAPHeaderElement}.
29: *
30: * @author Arjen Poutsma
31: * @since 1.0.0
32: */
33: class SaajSoapHeaderElement extends SaajSoapElement implements
34: SoapHeaderElement {
35:
36: SaajSoapHeaderElement(SOAPHeaderElement headerElement) {
37: super (headerElement);
38: }
39:
40: public Result getResult() throws SoapHeaderException {
41: return getImplementation().getResult(getSaajElement());
42: }
43:
44: public String getActorOrRole() throws SoapHeaderException {
45: return getImplementation().getActorOrRole(
46: getSaajHeaderElement());
47: }
48:
49: public void setActorOrRole(String actorOrRole)
50: throws SoapHeaderException {
51: getImplementation().setActorOrRole(getSaajHeaderElement(),
52: actorOrRole);
53: }
54:
55: public boolean getMustUnderstand() throws SoapHeaderException {
56: return getImplementation().getMustUnderstand(
57: getSaajHeaderElement());
58: }
59:
60: public void setMustUnderstand(boolean mustUnderstand)
61: throws SoapHeaderException {
62: getImplementation().setMustUnderstand(getSaajHeaderElement(),
63: mustUnderstand);
64: }
65:
66: public String getText() {
67: return getImplementation().getText(getSaajHeaderElement());
68: }
69:
70: public void setText(String content) {
71: try {
72: getImplementation()
73: .setText(getSaajHeaderElement(), content);
74: } catch (SOAPException ex) {
75: throw new SaajSoapHeaderException(ex);
76: }
77: }
78:
79: protected SOAPHeaderElement getSaajHeaderElement() {
80: return (SOAPHeaderElement) getSaajElement();
81: }
82:
83: }
|