org.jfree.eastwood
Class Parameters

java.lang.Object
  extended by org.jfree.eastwood.Parameters

public class Parameters
extends java.lang.Object

A utility class that parses a string into a Map containing the parameters for a chart.


Constructor Summary
Parameters()
           
 
Method Summary
static java.util.Map parseQueryString(java.lang.String qs)
          Parses the query string part of a URL.
static java.lang.String urlDecode(java.lang.String s)
          Decodes %xx sequences and + characters in the specified string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parameters

public Parameters()
Method Detail

parseQueryString

public static java.util.Map parseQueryString(java.lang.String qs)
                                      throws java.io.UnsupportedEncodingException
Parses the query string part of a URL. We need this since we shouldn't try to decode %-characters which aren't proper %xx sequences (this is the way the Google Chart API does it). Servlet containers like Tomcat and Jetty don't work that way. Also, our custom parser always uses UTF-8 to do byte -> char conversion, regardless of what encoding the servlet environment has been configured to use.

Parameters:
qs - the string to be decoded.
Returns:
The decoded string.
Throws:
java.io.UnsupportedEncodingException - if UTF-8 isn't supported by the JVM.

urlDecode

public static java.lang.String urlDecode(java.lang.String s)
                                  throws java.io.UnsupportedEncodingException
Decodes %xx sequences and + characters in the specified string. UTF-8 is used for byte .> char conversions.

Parameters:
s - the string to be decoded.
Returns:
the decoded string.
Throws:
java.io.UnsupportedEncodingException - if UTF-8 isn't supported by the JVM.


Copyright © 2010. All Rights Reserved.