KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > commons > xhtml > Parameters


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.commons.xhtml;
6
7 /**
8  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
9  * @since Nov 7, 2004
10  * @version $Id$
11  */

12 public class Parameters {
13   final static public Parameter[] EMPTY = new Parameter[0] ;
14   Parameter[] parameter_ ;
15   
16   public Parameters(String JavaDoc s) {
17     s = s.trim() ;
18     String JavaDoc[] temp = s.split("|") ;
19     parameter_ = new Parameter[temp.length] ;
20     for(int i = 0 ; i < temp.length; i++) {
21       temp[i] = temp[i].trim() ;
22       parameter_[i] = toParameter(temp[i]) ;
23     }
24   }
25   
26   private Parameter toParameter(String JavaDoc s) {
27     String JavaDoc[] temp = s.split("=") ;
28     return new Parameter(temp[0], temp[1]) ;
29   }
30 }
Popular Tags