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;
18:
19: import javax.xml.transform.Result;
20:
21: /**
22: * Represents the contents of an individual SOAP header in the a SOAP message. All <code>SoapHeaderElement</code>s are
23: * contained in a <code>SoapHeader</code>.
24: *
25: * @author Arjen Poutsma
26: * @see SoapHeader
27: * @since 1.0.0
28: */
29: public interface SoapHeaderElement extends SoapElement {
30:
31: /**
32: * Returns the actor or role for this header element. In a SOAP 1.1 compliant message, this will read the
33: * <code>actor</code> attribute; in SOAP 1.2, the <code>role</code> attribute.
34: *
35: * @return the role of the header
36: */
37: String getActorOrRole() throws SoapHeaderException;
38:
39: /**
40: * Sets the actor or role for this header element. In a SOAP 1.1 compliant message, this will result in an
41: * <code>actor</code> attribute being set; in SOAP 1.2, a <code>actorOrRole</code> attribute.
42: *
43: * @param actorOrRole the actorOrRole value
44: */
45: void setActorOrRole(String actorOrRole) throws SoapHeaderException;
46:
47: /**
48: * Indicates whether the <code>mustUnderstand</code> attribute for this header element is set.
49: *
50: * @return <code>true</code> if the <code>mustUnderstand</code> attribute is set; <code>false</code> otherwise
51: */
52: boolean getMustUnderstand() throws SoapHeaderException;
53:
54: /**
55: * Sets the <code>mustUnderstand</code> attribute for this header element. If the attribute is on, the role who
56: * receives the header must process it.
57: *
58: * @param mustUnderstand <code>true</code> to set the <code>mustUnderstand</code> attribute on; <code>false</code>
59: * to turn it off
60: */
61: void setMustUnderstand(boolean mustUnderstand)
62: throws SoapHeaderException;
63:
64: /** Returns a <code>Result</code> that allows for writing to the <strong>contents</strong> of the header element. */
65: Result getResult() throws SoapHeaderException;
66:
67: /**
68: * Returns the text content of this header element, if any.
69: *
70: * @return the text content of this header element
71: */
72: String getText();
73:
74: /**
75: * Sets the text content of this header element.
76: *
77: * @param content the new text content of this header element
78: */
79: void setText(String content);
80: }
|