1 16 package org.apache.cocoon.portal.pluto.om.common; 17 18 import java.util.Locale ; 19 20 import org.apache.pluto.om.common.Description; 21 import org.apache.pluto.util.StringUtils; 22 23 30 public class DescriptionImpl implements Description, java.io.Serializable , Support { 31 32 private String description; 33 private Locale locale; private String castorLocale; 35 36 public DescriptionImpl() { 37 } 39 40 public String getDescription() { 42 return description; 43 } 44 45 public Locale getLocale() { 46 return locale; 47 } 48 49 52 public void postBuild(Object parameter) throws Exception { 53 } 55 56 59 public void postLoad(Object parameter) throws Exception { 60 if (castorLocale == null) { 61 locale = Locale.ENGLISH; 62 } else { 63 locale = new Locale (castorLocale, ""); 64 } 65 } 66 69 public void postStore(Object parameter) throws Exception { 70 } 72 73 public void preBuild(Object parameter) throws Exception { 74 } 76 77 public void preStore(Object parameter) throws Exception { 78 } 80 81 84 public String toString() { 85 return toString(0); 86 } 87 88 public String toString(int indent) { 89 StringBuffer buffer = new StringBuffer (50); 90 StringUtils.newLine(buffer,indent); 91 buffer.append(getClass().toString()); 92 buffer.append(": description='"); 93 buffer.append(description); 94 buffer.append("', locale='"); 95 buffer.append(locale); 96 buffer.append("'"); 97 return buffer.toString(); 98 } 99 100 101 public void setDescription(String description) { 102 this.description = description; 103 } 104 105 public void setLocale(Locale locale) { 106 this.locale = locale; 107 } 108 109 110 112 116 public String getCastorLocale() { 117 return castorLocale; 118 } 119 120 124 public void setCastorLocale(String castorLocale) { 125 this.castorLocale = castorLocale; 126 } 127 128 } 129 | Popular Tags |