1 16 package org.apache.cocoon.portal.aspect.impl; 17 18 import org.apache.avalon.framework.configuration.Configuration; 19 import org.apache.avalon.framework.configuration.ConfigurationException; 20 import org.apache.cocoon.portal.aspect.AspectDescription; 21 22 23 24 31 public class DefaultAspectDescription 32 implements AspectDescription { 33 34 protected String name; 35 36 protected String className; 37 38 protected String persistence; 39 40 protected boolean autoCreate; 41 42 protected String defaultValue; 43 44 48 public static AspectDescription newInstance(Configuration conf) 49 throws ConfigurationException { 50 DefaultAspectDescription adesc = new DefaultAspectDescription(); 51 adesc.setClassName(conf.getAttribute("class")); 52 adesc.setName(conf.getAttribute("name")); 53 adesc.setPersistence(conf.getAttribute("store")); 54 adesc.setAutoCreate(conf.getAttributeAsBoolean("auto-create", false)); 55 adesc.setDefaultValue(conf.getAttribute("value", null)); 56 57 return adesc; 58 } 59 60 63 public String getClassName() { 64 return className; 65 } 66 67 70 public String getName() { 71 return name; 72 } 73 74 77 public void setClassName(String string) { 78 className = string; 79 } 80 81 84 public void setName(String string) { 85 name = string; 86 } 87 88 91 public String getStoreName() { 92 return persistence; 93 } 94 95 98 public void setPersistence(String string) { 99 persistence = string; 100 } 101 102 105 public boolean isAutoCreate() { 106 return autoCreate; 107 } 108 109 112 public void setAutoCreate(boolean b) { 113 autoCreate = b; 114 } 115 116 119 public String getDefaultValue() { 120 return this.defaultValue; 121 } 122 123 public void setDefaultValue(String value) { 124 this.defaultValue = value; 125 } 126 127 public String toString() { 128 return ("AspectDescription name=" + this.name + 129 ", class=" + this.className + 130 ", persistence=" + this.persistence + 131 ", autoCreate=" + this.autoCreate + 132 ", defaultValue=" + this.defaultValue); 133 } 134 } 135 | Popular Tags |