1 package org.jahia.services.htmlparser; 2 3 import java.util.Comparator ; 4 import java.util.Properties ; 5 import java.util.HashSet ; 6 import java.util.Set ; 7 8 17 public class MarkupSetting implements Comparator { 18 19 protected int settingId = -1; 20 21 protected String settingType = ""; 22 23 protected int markupDefId = -1; 24 25 protected boolean applyToAllSite = false; 26 27 protected Properties properties; 28 29 30 protected Set sites; 31 32 public MarkupSetting(String settingType, int markupDefId){ 33 this.markupDefId = markupDefId; 34 this.settingType = settingType; 35 this.properties = new Properties (); 36 this.sites = new HashSet (); 37 } 38 39 44 public int getSettingId(){ 45 return this.settingId; 46 } 47 48 52 public void setSettingId(int value){ 53 this.settingId = value; 54 } 55 56 61 public String getSettingType(){ 62 return this.settingType; 63 } 64 65 69 public Set getSites(){ 70 return this.sites; 71 } 72 73 77 public void addSite(int siteId){ 78 this.sites.add(new Integer (siteId)); 79 } 80 81 85 public void removeSite(int siteId){ 86 this.sites.remove(new Integer (siteId)); 87 } 88 89 93 public boolean containSite(int siteId){ 94 return this.getSites().contains(new Integer (siteId)); 95 } 96 97 101 public int getMarkupDefId(){ 102 return this.markupDefId; 103 } 104 105 public void setMarkupDefId(int id){ 106 this.markupDefId = id; 107 } 108 109 110 115 public boolean applyToAllSite(){ 116 return this.applyToAllSite; 117 } 118 119 public void setApplyToAllSite(boolean applyToAllSite){ 120 this.applyToAllSite = applyToAllSite; 121 } 122 123 129 public String getProperty(String name){ 130 if ( name == null ){ 131 return null; 132 } 133 return this.properties.getProperty(name); 134 } 135 136 139 public void setProperty(String name, String value){ 140 if ( name != null ){ 141 this.properties.setProperty(name,value); 142 } 143 } 144 145 146 public Properties getProperties(){ 147 return this.properties; 148 } 149 150 153 public void setProperties(Properties properties){ 154 if ( properties != null ){ 155 this.properties = properties; 156 } 157 } 158 159 public int compare(Object obj1, Object obj2){ 160 return 0; 161 } 162 } 163 164 | Popular Tags |