commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HeaderElement.java
Date Sun, 14 Jul 2002 02:57:48 GMT
dion        2002/07/13 19:57:48

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HeaderElement.java
  Log:
  Fix imports and javadoc
  
  Revision  Changes    Path
  1.7       +34 -16    jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HeaderElement.java
  
  Index: HeaderElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HeaderElement.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HeaderElement.java	5 Jan 2002 11:15:59 -0000	1.6
  +++ HeaderElement.java	14 Jul 2002 02:57:48 -0000	1.7
  @@ -66,7 +66,8 @@
   import java.util.NoSuchElementException;
   import java.util.StringTokenizer;
   import java.util.Vector;
  -import org.apache.commons.httpclient.log.*;
  +import org.apache.commons.httpclient.log.Log;
  +import org.apache.commons.httpclient.log.LogSource;
   
   /**
    * <p>One element of an HTTP header's value.</p>
  @@ -132,11 +133,12 @@
       }
   
       /**
  -      * Constructor.
  -      * @param name my name
  -      * @param value my (possibly <tt>null</tt>) value
  -      * @param parameter my (possibly <tt>null</tt>) parameters
  -      */
  +     * Constructor with name, value and parameters.
  +     *
  +     * @param name my name
  +     * @param value my (possibly <tt>null</tt>) value
  +     * @param parameters my (possibly <tt>null</tt>) parameters
  +     */
       public HeaderElement(String name, String value,
               NameValuePair[] parameters) {
           super(name, value);
  @@ -229,7 +231,11 @@
   
       // ------------------------------------------------------------- Properties
   
  -    /** Get parameters, if any. */
  +    /**
  +     * Get parameters, if any.
  +     *
  +     * @return parameters as an array of {@link NameValuePair}s
  +     */
       public NameValuePair[] getParameters() {
           return this.parameters;
       }
  @@ -248,10 +254,11 @@
       public final static HeaderElement[] parse(String headerValue)
               throws HttpException
       {
  -        if (headerValue == null)
  +        if (headerValue == null) {
               return null;
  +        }
  +        
           Vector elements = new Vector();
  -
           StringTokenizer tokenizer =
               new StringTokenizer(headerValue.trim(), ",");
   
  @@ -353,6 +360,10 @@
       /**
        * Return <tt>true</tt> if <i>string</i> has
        * an odd number of <tt>"</tt> characters.
  +     *
  +     * @param string the string to test
  +     * @return true if there are an odd number of quotation marks, false 
  +     *      otherwise
        */
       private final static boolean hasOddNumberOfQuotationMarks(String string) {
           boolean odd = false;
  @@ -363,9 +374,16 @@
           return odd;
       }
   
  -    private final static NameValuePair parsePair(
  -            char[] header, int start, int end)
  -            throws HttpException {
  +    /**
  +     * Parse a header character array into a {@link NameValuePair}
  +     *
  +     * @param header the character array to parse
  +     * @param start the starting position of the text within the array
  +     * @param end the end position of the text within the array
  +     * @return a {@link NameValuePair} representing the header
  +     */
  +    private final static NameValuePair parsePair(char[] header, int start, 
  +        int end) {
   
           boolean done = false;
           NameValuePair pair = null;
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message