1 16 19 20 package org.apache.pluto.portalImpl.om.common.impl; 21 22 import java.util.Iterator ; 23 import java.util.Locale ; 24 25 import org.apache.pluto.om.common.DisplayName; 26 import org.apache.pluto.om.common.DisplayNameSet; 27 import org.apache.pluto.portalImpl.om.common.AbstractSupportSet; 28 import org.apache.pluto.portalImpl.om.common.Support; 29 import org.apache.pluto.util.StringUtils; 30 31 public class DisplayNameSetImpl extends AbstractSupportSet implements DisplayNameSet, java.io.Serializable , Support { 32 33 35 public DisplayName get(Locale locale) 36 { 37 Iterator iterator = this.iterator(); 38 while (iterator.hasNext()) { 39 DisplayName displayName = (DisplayName)iterator.next(); 40 if (displayName.getLocale().equals(locale)) { 41 return displayName; 42 } 43 } 44 return null; 45 } 46 47 48 50 53 public void postBuild(Object parameter) throws Exception { 54 } 55 56 59 public void postLoad(Object parameter) throws Exception { 60 Iterator iterator = this.iterator(); 61 while (iterator.hasNext()) { 62 ((DisplayNameImpl) iterator.next()).postLoad(parameter); 63 } 64 } 65 66 69 public void postStore(Object parameter) throws Exception { 70 } 71 72 75 public void preBuild(Object parameter) throws Exception { 76 } 77 78 81 public void preStore(Object parameter) throws Exception { 82 } 83 84 86 public String toString() 87 { 88 return toString(0); 89 } 90 91 public String toString(int indent) 92 { 93 StringBuffer buffer = new StringBuffer (50); 94 StringUtils.newLine(buffer,indent); 95 buffer.append(getClass().toString()); 96 buffer.append(": "); 97 Iterator iterator = this.iterator(); 98 while (iterator.hasNext()) { 99 buffer.append(((DisplayNameImpl)iterator.next()).toString(indent+2)); 100 } 101 return buffer.toString(); 102 } 103 104 105 } 106 | Popular Tags |