1 16 19 20 package org.apache.pluto.portalImpl.om.common.impl; 21 22 import java.util.Locale ; 23 24 import org.apache.pluto.om.common.DisplayName; 25 import org.apache.pluto.portalImpl.om.common.Support; 26 import org.apache.pluto.util.StringUtils; 27 28 public class DisplayNameImpl implements DisplayName, java.io.Serializable , Support { 29 30 private String displayName; 31 private Locale locale; private String castorLocale; 33 34 public DisplayNameImpl() 35 { 36 } 37 38 public String getDisplayName() 40 { 41 return displayName; 42 } 43 44 public Locale getLocale() 45 { 46 return locale; 47 } 48 49 51 public void postLoad(Object parameter) throws Exception 52 { 53 if (castorLocale == null) { 54 locale = Locale.ENGLISH; 55 } else { 56 locale = new Locale (castorLocale, ""); 57 } 58 } 59 public void postStore(Object parameter) throws Exception 60 { 61 } 62 63 public void preBuild(Object parameter) throws Exception 64 { 65 } 66 67 public void preStore(Object parameter) throws Exception 68 { 69 } 70 71 74 public void postBuild(Object parameter) throws Exception { 75 } 76 77 public String toString() 79 { 80 return toString(0); 81 } 82 83 public String toString(int indent) 84 { 85 StringBuffer buffer = new StringBuffer (50); 86 StringUtils.newLine(buffer,indent); 87 buffer.append(getClass().toString()); 88 buffer.append(": displayName='"); 89 buffer.append(displayName); 90 buffer.append("', locale='"); 91 buffer.append(locale); 92 buffer.append("'"); 93 return buffer.toString(); 94 } 95 96 public void setDisplayName(String displayName) 97 { 98 this.displayName = displayName; 99 } 100 101 public void setLocale(Locale locale) 102 { 103 this.locale = locale; 104 } 105 106 110 public String getCastorLocale() { 111 return castorLocale; 112 } 113 114 118 public void setCastorLocale(String castorLocale) { 119 this.castorLocale = castorLocale; 120 } 121 } 122 | Popular Tags |