1 5 package com.jofti.config; 6 7 import java.util.List ; 8 import java.util.Map ; 9 import java.util.Properties ; 10 11 import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap; 12 13 14 15 38 public class DefaultIndexConfig implements IndexConfig { 39 40 41 43 private String name="default"; 44 45 private String cacheAdapter = "com.jofti.cache.adapter.MapAdapter"; 46 47 48 private String indexType = "com.jofti.tree.TreeIndex"; 49 50 private String parserType = "com.jofti.introspect.JavaBeanClassIntrospector"; 51 52 private Map classMappings = new ConcurrentHashMap(); 53 54 private Map queryMappings = new ConcurrentHashMap(); 55 56 private boolean lazyLoaded = false; 57 58 private Properties adapterProperties; 59 60 private Properties indexProperties = new Properties (); 61 62 63 public DefaultIndexConfig(){ 64 65 } 66 67 70 public String getName() { 71 return name; 72 } 73 74 77 public String getCacheAdapter() { 78 return cacheAdapter; 79 } 80 81 82 85 public Map getIndexMappings() { 86 return classMappings; 87 } 88 89 90 93 public void addMapping(String clazz, List propertyList){ 94 95 classMappings.put(clazz, propertyList); 96 } 97 98 101 public void addQuery(String name, String query){ 102 103 queryMappings.put(name, query); 104 } 105 106 109 public void setCacheAdapter(String cacheAdapter) { 110 this.cacheAdapter = cacheAdapter; 111 } 112 115 public void setIndexType(String indexType) { 116 this.indexType = indexType; 117 } 118 121 public void setName(String name) { 122 this.name = name; 123 } 124 127 public Map getClassMappings() { 128 return classMappings; 129 } 130 131 134 public Map getQueryMappings() { 135 return queryMappings; 136 } 137 140 public String getIndexType() { 141 return indexType; 142 } 143 146 public boolean isLazyLoaded() { 147 return lazyLoaded; 148 } 149 152 public void setLazyLoaded(boolean lazyLoaded) { 153 this.lazyLoaded = lazyLoaded; 154 } 155 158 public Properties getAdapterProperties() { 159 return adapterProperties; 160 } 161 164 public void setAdapterProperties(Properties adapterProperties) { 165 this.adapterProperties = adapterProperties; 166 } 167 168 171 public String getParserType() { 172 return parserType; 173 } 174 177 public void setParserType(String parserType) { 178 this.parserType = parserType; 179 } 180 181 184 public Properties getIndexProperties() { 185 186 return indexProperties; 187 } 188 189 190 public synchronized void setIndexProperties(Properties indexProperties) { 191 this.indexProperties = indexProperties; 192 } 193 194 195 } 196 | Popular Tags |