1 16 package org.apache.cocoon.portal.pluto.om.common; 17 18 import java.util.Locale ; 19 20 import org.apache.pluto.om.common.DisplayName; 21 import org.apache.pluto.util.StringUtils; 22 23 30 public class DisplayNameImpl implements DisplayName, java.io.Serializable , Support { 31 32 private String displayName; 33 private Locale locale; private String castorLocale; 35 36 public DisplayNameImpl() { 37 } 39 40 43 public String getDisplayName() { 44 return displayName; 45 } 46 47 50 public Locale getLocale() { 51 return locale; 52 } 53 54 57 public void postLoad(Object parameter) throws Exception { 58 if (castorLocale == null) { 59 locale = Locale.ENGLISH; 60 } else { 61 locale = new Locale (castorLocale, ""); 62 } 63 } 64 67 public void postStore(Object parameter) throws Exception { 68 } 70 71 74 public void preBuild(Object parameter) throws Exception { 75 } 77 78 81 public void preStore(Object parameter) throws Exception { 82 } 84 85 88 public void postBuild(Object parameter) throws Exception { 89 } 91 92 95 public String toString() { 96 return toString(0); 97 } 98 99 public String toString(int indent) { 100 StringBuffer buffer = new StringBuffer (50); 101 StringUtils.newLine(buffer,indent); 102 buffer.append(getClass().toString()); 103 buffer.append(": displayName='"); 104 buffer.append(displayName); 105 buffer.append("', locale='"); 106 buffer.append(locale); 107 buffer.append("'"); 108 return buffer.toString(); 109 } 110 111 public void setDisplayName(String displayName) { 112 this.displayName = displayName; 113 } 114 115 public void setLocale(Locale locale) { 116 this.locale = locale; 117 } 118 119 123 public String getCastorLocale() { 124 return castorLocale; 125 } 126 127 131 public void setCastorLocale(String castorLocale) { 132 this.castorLocale = castorLocale; 133 } 134 } 135 | Popular Tags |