KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > htmlparser > MarkupSetting


1 package org.jahia.services.htmlparser;
2
3 import java.util.Comparator JavaDoc;
4 import java.util.Properties JavaDoc;
5 import java.util.HashSet JavaDoc;
6 import java.util.Set JavaDoc;
7
8 /**
9  *
10  * <p>Title: Markup Setting</p>
11  * <p>Description: </p>
12  * <p>Copyright: Copyright (c) 2002</p>
13  * <p>Company: </p>
14  * @author Khue Nguyen
15  * @version 1.0
16  */

17 public class MarkupSetting implements Comparator JavaDoc {
18
19     protected int settingId = -1;
20
21     protected String JavaDoc settingType = "";
22
23     protected int markupDefId = -1;
24
25     protected boolean applyToAllSite = false;
26
27     protected Properties JavaDoc properties;
28
29     /** contains the sitekeys of linked sites **/
30     protected Set JavaDoc sites;
31
32     public MarkupSetting(String JavaDoc settingType, int markupDefId){
33         this.markupDefId = markupDefId;
34         this.settingType = settingType;
35         this.properties = new Properties JavaDoc();
36         this.sites = new HashSet JavaDoc();
37     }
38
39     /**
40      * Return the unique identifier
41      *
42      * @return
43      */

44     public int getSettingId(){
45         return this.settingId;
46     }
47
48     /**
49      * Set the id
50      * @return
51      */

52     public void setSettingId(int value){
53         this.settingId = value;
54     }
55
56     /**
57      * Return the Type ( that differentiate the nature of the setting )
58      *
59      * @return
60      */

61     public String JavaDoc getSettingType(){
62         return this.settingType;
63     }
64
65     /**
66      * Return the list of sites linked with this setting
67      * @return
68      */

69     public Set JavaDoc getSites(){
70         return this.sites;
71     }
72
73     /**
74      * Add a site
75      * @return
76      */

77     public void addSite(int siteId){
78         this.sites.add(new Integer JavaDoc(siteId));
79     }
80
81     /**
82      * remove a site
83      * @return
84      */

85     public void removeSite(int siteId){
86         this.sites.remove(new Integer JavaDoc(siteId));
87     }
88
89     /**
90      * Return true if contains the given site
91      * @return
92      */

93     public boolean containSite(int siteId){
94         return this.getSites().contains(new Integer JavaDoc(siteId));
95     }
96
97     /**
98      * Return the markup def id
99      * @return
100      */

101     public int getMarkupDefId(){
102         return this.markupDefId;
103     }
104
105     public void setMarkupDefId(int id){
106         this.markupDefId = id;
107     }
108
109
110     /**
111      * Is the setting applied to all sites
112      *
113      * @return
114      */

115     public boolean applyToAllSite(){
116         return this.applyToAllSite;
117     }
118
119     public void setApplyToAllSite(boolean applyToAllSite){
120         this.applyToAllSite = applyToAllSite;
121     }
122
123     /**
124      * Return a property
125      *
126      * @param name
127      * @param value
128      */

129     public String JavaDoc getProperty(String JavaDoc name){
130         if ( name == null ){
131             return null;
132         }
133         return this.properties.getProperty(name);
134     }
135
136     /**
137      * Set a property
138      */

139     public void setProperty(String JavaDoc name, String JavaDoc value){
140         if ( name != null ){
141             this.properties.setProperty(name,value);
142         }
143     }
144
145
146     public Properties JavaDoc getProperties(){
147         return this.properties;
148     }
149
150     /**
151      * Set the properties
152      */

153     public void setProperties(Properties JavaDoc properties){
154         if ( properties != null ){
155             this.properties = properties;
156         }
157     }
158
159     public int compare(Object JavaDoc obj1, Object JavaDoc obj2){
160         return 0;
161     }
162 }
163
164
Popular Tags