1 package mircoders.entity;
4 * Title: EntityBreaking
5 * Description: Maps table "breaking" to Java Object
6 * Copyright: Copyright (c) 2001
7 * Company: Indymedia.de
17 import freemarker.template.*;
23 public class EntityBreaking extends AbstractEntity implements Entity, TemplateHashModel
25 private static int instances;
27 public EntityBreaking() { super(); instances++; }
28 public EntityBreaking(StorageObject theStorage) { this(); setStorage(theStorage); }
29 public void finalize() {
35 public HashMap getValues() {
36 HashMap returnHash = super.getValues();
39 if ((date=(String)returnHash.get("webdb_create"))!=null)
40 returnHash.put("webdb_create_formatted", StringUtil.dateToReadableDate(date));
44 // Now implements freemarkers TemplateHashModel
45 // two methods have to be overridden:
46 // 1. public boolean isEmpty() throws TemplateModelException
47 // 2. public TemplateModel get(java.lang.String key) throws TemplateModelException
49 public boolean isEmpty() throws TemplateModelException
51 if (theValuesHash==null || theValuesHash.isEmpty())
56 public TemplateModel get(java.lang.String key) throws TemplateModelException
58 return new SimpleScalar(getValue("key"));
62 //////////////////////////////////////////////////////////////////////////////////