KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > content > display > component > model > ContentConfig


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.portlets.content.display.component.model;
6
7
8 import org.apache.commons.lang.StringUtils;
9 /**
10  * Apr 26, 2004
11  * @author: Tuan Nguyen
12  * @email: tuan08@users.sourceforge.net
13  * @version: $Id: ContentConfig.java,v 1.1 2004/07/16 09:29:51 oranheim Exp $
14  **/

15 public class ContentConfig {
16     private String JavaDoc name_ ;
17     private String JavaDoc title_ ;
18   private String JavaDoc uri_ ;
19   private String JavaDoc encoding_ ;
20   private String JavaDoc content_ ;
21   
22   public ContentConfig() {
23   }
24   
25   public ContentConfig(String JavaDoc name, String JavaDoc[] values) {
26     name_ = name ;
27     for(int i = 0; i < values.length; i++) {
28       String JavaDoc[] tmp = StringUtils.split(values[i], "=") ;
29       if (tmp.length == 2) {
30         if("uri".equals(tmp[0])) {
31             uri_ = tmp[1] ;
32         } else if ("encoding".equals(tmp[0])) {
33           encoding_ = tmp[1] ;
34         } else if ("title".equals(tmp[0])) {
35           title_ = tmp[1] ;
36         }
37       }
38     }
39     content_ = null;
40   }
41   
42   /**
43    * @return Returns the encoding_.
44    */

45     public String JavaDoc getEncoding() { return encoding_; }
46     /**
47      * @param encoding_ The encoding_ to set.
48      */

49     public void setEncoding(String JavaDoc encoding_) { this.encoding_ = encoding_; }
50     /**
51      * @return Returns the name_.
52      */

53     public String JavaDoc getName() { return name_; }
54     /**
55      * @param name_
56    * The name_ to set.
57      */

58     public void setName(String JavaDoc name_) { this.name_ = name_; }
59     /**
60      * @return Returns the title_.
61      */

62     public String JavaDoc getTitle() { return title_; }
63     /**
64      * @param title_
65      * The title_ to set.
66      */

67     public void setTitle(String JavaDoc title_) { this.title_ = title_; }
68   
69     /**
70      * @return Returns the uri_.
71      */

72     // TODO: This hack is dirty, and should not be init to "", but all renderer that thorws nullptr's should be handled instead
73
public String JavaDoc getUri() {
74     if (uri_==null)
75       uri_ = "";
76     return uri_;
77   }
78   
79     /**
80      * @param uri_
81      * The uri_ to set.
82      */

83     public void setUri(String JavaDoc uri_) { this.uri_ = uri_; }
84     
85     public String JavaDoc getContent() { return content_; }
86     
87     public void setContent(String JavaDoc content) { this.content_ = content; }
88     
89 }
Popular Tags