1 16 package org.apache.cocoon.portal.pluto.om.common; 17 18 import java.util.Collection ; 19 import java.util.Locale ; 20 21 import org.apache.pluto.om.common.Description; 22 import org.apache.pluto.om.common.DescriptionSet; 23 import org.apache.pluto.om.common.Parameter; 24 import org.apache.pluto.om.common.ParameterCtrl; 25 import org.apache.pluto.util.StringUtils; 26 27 public class ParameterImpl implements Parameter, ParameterCtrl, java.io.Serializable 28 { 29 30 private String name; 31 private String value; 32 private DescriptionSet descriptions; 33 34 public ParameterImpl() { 35 descriptions = new DescriptionSetImpl(); 36 } 37 38 40 public String getName() { 41 return name; 42 } 43 44 public String getValue() { 45 return value; 46 } 47 48 51 public Description getDescription(Locale locale) { 52 return descriptions.get(locale); 53 } 54 55 57 public void setName(String name) { 58 this.name = name; 59 } 60 61 public void setValue(String value) { 62 this.value = value; 63 } 64 65 68 public void setDescriptionSet(DescriptionSet descriptions) { 69 this.descriptions = descriptions; 70 } 71 72 74 public String toString() { 75 return toString(0); 76 } 77 78 public String toString(int indent) { 79 StringBuffer buffer = new StringBuffer (50); 80 StringUtils.newLine(buffer,indent); 81 buffer.append(getClass().toString()); 82 buffer.append(": name='"); 83 buffer.append(name); 84 buffer.append("', value='"); 85 buffer.append(value); 86 buffer.append("', descriptions='"); 87 buffer.append(((DescriptionSetImpl) descriptions).toString()); 88 buffer.append("'"); 89 return buffer.toString(); 90 } 91 92 public Collection getCastorDescriptions() { 93 return(DescriptionSetImpl)descriptions; 94 } 95 96 public void setCastorDescriptions(DescriptionSet castorDescriptions) { 97 this.descriptions = castorDescriptions; 98 } 99 } 100 | Popular Tags |