1 16 package org.apache.cocoon.portal.pluto.om.common; 17 18 import java.util.Iterator ; 19 import java.util.Locale ; 20 21 import org.apache.pluto.om.common.DisplayName; 22 import org.apache.pluto.om.common.DisplayNameSet; 23 import org.apache.pluto.util.StringUtils; 24 25 32 public class DisplayNameSetImpl extends AbstractSupportSet implements DisplayNameSet, java.io.Serializable , Support { 33 34 37 public DisplayName get(Locale locale) { 38 Iterator iterator = this.iterator(); 39 while (iterator.hasNext()) { 40 DisplayName displayName = (DisplayName)iterator.next(); 41 if (displayName.getLocale().equals(locale)) { 42 return displayName; 43 } 44 } 45 return null; 46 } 47 48 49 52 public void postBuild(Object parameter) throws Exception { 53 } 55 56 public void postLoad(Object parameter) throws Exception { 57 Iterator iterator = this.iterator(); 58 while (iterator.hasNext()) { 59 ((DisplayNameImpl) iterator.next()).postLoad(parameter); 60 } 61 } 62 63 66 public void postStore(Object parameter) throws Exception { 67 } 69 70 73 public void preBuild(Object parameter) throws Exception { 74 } 76 77 80 public void preStore(Object parameter) throws Exception { 81 } 83 84 87 public String toString() { 88 return toString(0); 89 } 90 91 public String toString(int indent) { 92 StringBuffer buffer = new StringBuffer (50); 93 StringUtils.newLine(buffer,indent); 94 buffer.append(getClass().toString()); 95 buffer.append(": "); 96 Iterator iterator = this.iterator(); 97 while (iterator.hasNext()) { 98 buffer.append(((DisplayNameImpl)iterator.next()).toString(indent+2)); 99 } 100 return buffer.toString(); 101 } 102 103 } 104 | Popular Tags |