View Javadoc
1   /*
2    * Copyright 2006 the original author or authors.
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  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) throws SoapHeaderException;
62  
63      /** Returns a <code>Result</code> that allows for writing to the <strong>contents</strong> of the header element. */
64      Result getResult() throws SoapHeaderException;
65  
66      /**
67       * Returns the text content of this header element, if any.
68       *
69       * @return the text content of this header element
70       */
71      String getText();
72  
73      /**
74       * Sets the text content of this header element.
75       *
76       * @param content the new text content of this header element
77       */
78      void setText(String content);
79  }