Oracle Application Server 10g HTTPClient API Reference
10g Release 2(10.1.2)

B14020-01


HTTPClient
Class HttpHeaderElement

java.lang.Object
  extended byHTTPClient.HttpHeaderElement


public class HttpHeaderElement
extends java.lang.Object

This class holds a description of an http header element. It is used by Util.parseHeader.

See Also:
Util.parseHeader(java.lang.String), Util.getElement(java.util.Vector, java.lang.String), Util.assembleHeader(java.util.Vector)

Constructor Summary
HttpHeaderElement(java.lang.String name)
Construct an element with the given name.
HttpHeaderElement(java.lang.String name, java.lang.String value, NVPair[] params)

Method Summary
void appendTo(java.lang.StringBuffer buf)
Append this header element to the given buffer.
boolean equals(java.lang.Object obj)
Two elements are equal if they have the same name.
java.lang.String getName()
NVPair[] getParams()
java.lang.String getValue()
java.lang.String toString()
Returns a string representation of the object.

Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

HttpHeaderElement

public HttpHeaderElement(java.lang.String name)
Construct an element with the given name. The value and parameters are set to null. This can be used when a dummy element is constructed for comparison or retrieval purposes.
Parameters:
name - the name of the element

HttpHeaderElement

public HttpHeaderElement(java.lang.String name,
                         java.lang.String value,
                         NVPair[] params)
Parameters:
name - the first token in the element
value - the value part, or null
params - the parameters

Method Detail

getName

public java.lang.String getName()
Returns:
the name

getValue

public java.lang.String getValue()
Returns:
the value

getParams

public NVPair[] getParams()
Returns:
the parameters

equals

public boolean equals(java.lang.Object obj)
Two elements are equal if they have the same name. The comparison is case-insensitive.
Parameters:
obj - the object to compare with
Returns:
true if obj is an HttpHeaderElement with the same name as this element.
See Also:
Object.hashCode(), Hashtable

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 
Returns:
a string containing the HttpHeaderElement formatted as it would appear in a header

appendTo

public void appendTo(java.lang.StringBuffer buf)
Append this header element to the given buffer. This is basically a more efficient version of toString() for assembling multiple elements.
Parameters:
buf - the StringBuffer to append this header to
See Also:
toString()

Oracle Application Server 10g HTTPClient API Reference
10g Release 2(10.1.2)

B14020-01


Copyright © 2001, 2004, Oracle. All rights reserved.