1 43 package net.jforum.repository; 44 45 import net.jforum.cache.CacheEngine; 46 import net.jforum.cache.Cacheable; 47 import net.jforum.util.bbcode.BBCode; 48 import net.jforum.util.bbcode.BBCodeHandler; 49 50 54 public class BBCodeRepository implements Cacheable 55 { 56 private static CacheEngine cache; 57 private static final String FQN = "bbcode"; 58 private static final String BBCOLLECTION = "bbCollection"; 59 60 63 public void setCacheEngine(CacheEngine cacheEngine) 64 { 65 cache = cacheEngine; 66 } 67 68 public static void setBBCollection(BBCodeHandler bbCollection) 69 { 70 cache.add(FQN, BBCOLLECTION, bbCollection); 71 } 72 73 public static BBCodeHandler getBBCollection() 74 { 75 return (BBCodeHandler)cache.get(FQN, BBCOLLECTION); 76 } 77 78 public static BBCode findByName(String tagName) 79 { 80 return getBBCollection().findByName(tagName); 81 } 82 } 83 | Popular Tags |