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.Description; 26 import org.apache.pluto.om.common.DescriptionSet; 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 DescriptionSetImpl extends AbstractSupportSet implements DescriptionSet, java.io.Serializable , Support { 32 33 public Description get(Locale locale) 35 { 36 Iterator iterator = this.iterator(); 37 while (iterator.hasNext()) { 38 Description desc = (Description)iterator.next(); 39 if (desc.getLocale().equals(locale)) { 40 return desc; 41 } 42 } 43 return null; 44 } 45 46 48 51 public void postBuild(Object parameter) throws Exception { 52 } 53 54 57 public void postLoad(Object parameter) throws Exception { 58 Iterator iterator = this.iterator(); 59 while (iterator.hasNext()) { 60 ((DescriptionImpl)iterator.next()).postLoad(parameter); 61 } 62 } 63 64 67 public void postStore(Object parameter) throws Exception { 68 } 69 70 73 public void preBuild(Object parameter) throws Exception { 74 } 75 76 79 public void preStore(Object parameter) throws Exception { 80 } 81 82 84 85 public String toString() 86 { 87 return toString(0); 88 } 89 90 public String toString(int indent) 91 { 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(((DescriptionImpl)iterator.next()).toString(indent+2)); 99 } 100 return buffer.toString(); 101 } 102 103 } 104 | Popular Tags |