KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > protocol > http > control > Header


1 // $Header: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/control/Header.java,v 1.6.2.1 2004/10/23 19:42:06 sebb Exp $
2
/*
3  * Copyright 2001-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17 */

18
19 package org.apache.jmeter.protocol.http.control;
20
21 import java.io.Serializable JavaDoc;
22
23 import org.apache.jmeter.config.ConfigElement;
24 import org.apache.jmeter.testelement.AbstractTestElement;
25
26 /**
27  * This class is an HTTP Header encapsulator.
28  *
29  * @author <a HREF="mailto:giacomo@apache.org">Giacomo Pati</a>
30  * @version $Revision: 1.6.2.1 $ last updated $Date: 2004/10/23 19:42:06 $
31  */

32 public class Header extends AbstractTestElement implements Serializable JavaDoc
33 {
34     private static String JavaDoc VALUE = "Header.value";
35
36     /**
37      * Create the header.
38      */

39     public Header()
40     {
41         this.setName("");
42         this.setValue("");
43     }
44
45     /**
46      * Create the coookie.
47      */

48     public Header(String JavaDoc name, String JavaDoc value)
49     {
50         this.setName(name);
51         this.setValue(value);
52     }
53
54     public void addConfigElement(ConfigElement config)
55     {
56     }
57
58     public boolean expectsModification()
59     {
60         return false;
61     }
62
63     public String JavaDoc getClassLabel()
64     {
65         return "Header";
66     }
67
68     /**
69      * Get the value for this object.
70      */

71     public synchronized String JavaDoc getValue()
72     {
73         return getPropertyAsString(VALUE);
74     }
75
76     /**
77      * Set the value for this object.
78      */

79     public synchronized void setValue(String JavaDoc value)
80     {
81         this.setProperty(VALUE, value);
82     }
83
84     /**
85      * Creates a string representation of this header.
86      */

87     public String JavaDoc toString()
88     {
89         return getName() + "\t" + getValue();
90     }
91 }
92
Popular Tags