1 16 package dlog4j.formbean; 17 18 import java.util.Date ; 19 import java.util.List ; 20 21 25 public class LogBaseForm extends ContentPreviewForm { 26 27 public final static int LEVEL_1 = 1; 28 public final static int LEVEL_2 = 2; 29 public final static int LEVEL_3 = 3; 30 public final static int LEVEL_4 = 4; 31 public final static int LEVEL_5 = 5; 32 33 int id; 34 UserForm owner; 35 String author; 36 String authorUrl; 37 String title; 38 Date logTime; 39 String refUrl; 40 String weather; 41 int useFace = 1; 42 int useUbb = 1; 43 int showFormerly = 0; 44 int moodLevel = LEVEL_3; 45 SiteForm site; 46 List attachments; 47 48 public List getAttachments() { 49 return attachments; 50 } 51 public void setAttachments(List attachments) { 52 this.attachments = attachments; 53 } 54 public String getAuthor() { 55 if("".equals(author)) 56 return null; 57 return author; 58 } 59 public void setAuthor(String author) { 60 this.author = author; 61 } 62 public int getOwnerId(){ 63 return (owner!=null)?owner.getId():-1; 64 } 65 public void setOwnerId(int userid){ 66 if(owner==null) 67 owner = new UserForm(); 68 owner.setId(userid); 69 } 70 73 public String getOwnerName() { 74 return owner.getDisplayName(); 75 } 76 77 public String getAuthorUrl() { 78 if("".equals(authorUrl)) 79 return null; 80 return authorUrl; 81 } 82 public void setAuthorUrl(String authorUrl) { 83 this.authorUrl = authorUrl; 84 } 85 public int getId() { 86 return id; 87 } 88 public void setId(int id) { 89 this.id = id; 90 } 91 public Date getLogTime() { 92 return logTime; 93 } 94 95 public void setLogTime(Date logTime) { 96 this.logTime = logTime; 97 } 98 public int getMoodLevel() { 99 return moodLevel; 100 } 101 public void setMoodLevel(int moodLevel) { 102 this.moodLevel = moodLevel; 103 } 104 public UserForm getOwner() { 105 return owner; 106 } 107 public void setOwner(UserForm owner) { 108 this.owner = owner; 109 } 110 public String getRefUrl() { 111 if("".equals(refUrl)) 112 return null; 113 return refUrl; 114 } 115 public void setRefUrl(String refUrl) { 116 this.refUrl = refUrl; 117 } 118 public int getShowFormerly() { 119 return showFormerly; 120 } 121 public void setShowFormerly(int showFormerly) { 122 this.showFormerly = showFormerly; 123 } 124 public SiteForm getSite() { 125 return site; 126 } 127 public void setSite(SiteForm site) { 128 this.site = site; 129 } 130 public String getTitleText(){ 131 try{ 132 return extractText(title); 133 }catch(Exception e){} 134 return null; 135 } 136 public String getTitle() { 137 if("".equals(title)) 138 return null; 139 return title; 140 } 141 public void setTitle(String title) { 142 this.title = title; 143 } 144 public int getUseFace() { 145 return useFace; 146 } 147 public void setUseFace(int useFace) { 148 this.useFace = useFace; 149 } 150 public int getUseUbb() { 151 return useUbb; 152 } 153 public void setUseUbb(int useUbb) { 154 this.useUbb = useUbb; 155 } 156 public String getWeather() { 157 if("".equals(weather)) 158 return null; 159 return weather; 160 } 161 public void setWeather(String weather) { 162 this.weather = weather; 163 } 164 165 public static void main(String [] args){ 166 try{ 167 System.out.print("RESULT:"); 168 System.out.println(extractText("<font color=\"red\" size=4>大字体测试</font>")); 169 }catch(Exception e){} 170 } 171 } 172 | Popular Tags |