%line | %branch | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
org.apache.commons.jelly.tags.http.HeaderTag |
|
|
1 | /* |
|
2 | * Copyright 2002,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 | package org.apache.commons.jelly.tags.http; |
|
18 | ||
19 | import org.apache.commons.jelly.JellyTagException; |
|
20 | import org.apache.commons.jelly.TagSupport; |
|
21 | import org.apache.commons.jelly.XMLOutput; |
|
22 | ||
23 | /** |
|
24 | * A tag to hold request headers |
|
25 | * |
|
26 | * @author dion |
|
27 | * @version $Id: HeaderTag.java 155420 2005-02-26 13:06:03Z dirkv $ |
|
28 | */ |
|
29 | public class HeaderTag extends TagSupport { |
|
30 | /** parameter name */ |
|
31 | private String _name; |
|
32 | /** parameter value */ |
|
33 | private String _value; |
|
34 | ||
35 | /** Creates a new instance of HeaderTag */ |
|
36 | 0 | public HeaderTag() { |
37 | 0 | } |
38 | ||
39 | /** |
|
40 | * Perform the tag functionality. In this case, simply evaluate the body. |
|
41 | * |
|
42 | * @param xmlOutput where to send output |
|
43 | * @throws Exception when an error occurs |
|
44 | */ |
|
45 | public void doTag(XMLOutput xmlOutput) throws JellyTagException { |
|
46 | 0 | HttpTagSupport http = (HttpTagSupport) findAncestorWithClass( |
47 | 0 | HttpTagSupport.class); |
48 | 0 | http.addRequestHeader(getName(), getValue()); |
49 | 0 | invokeBody(xmlOutput); |
50 | 0 | } |
51 | ||
52 | //-------------------------------------------------------------------------- |
|
53 | // Property accessors/mutators |
|
54 | //-------------------------------------------------------------------------- |
|
55 | /** |
|
56 | * Getter for property name. |
|
57 | * |
|
58 | * @return Value of property name. |
|
59 | */ |
|
60 | public String getName() { |
|
61 | 0 | return _name; |
62 | } |
|
63 | ||
64 | /** |
|
65 | * Setter for property name. |
|
66 | * |
|
67 | * @param name New value of property name. |
|
68 | */ |
|
69 | public void setName(String name) { |
|
70 | 0 | _name = name; |
71 | 0 | } |
72 | ||
73 | /** |
|
74 | * Getter for property value. |
|
75 | * |
|
76 | * @return Value of property value. |
|
77 | */ |
|
78 | public String getValue() { |
|
79 | 0 | return _value; |
80 | } |
|
81 | ||
82 | /** |
|
83 | * Setter for property value. |
|
84 | * |
|
85 | * @param value New value of property value. |
|
86 | */ |
|
87 | public void setValue(String value) { |
|
88 | 0 | _value = value; |
89 | 0 | } |
90 | ||
91 | } |
This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |