1 17 18 package com.finalist.jag.taglib; 19 20 21 import java.util.Collection ; 22 import java.util.*; 23 24 25 32 public class TagDef { 33 34 35 private String name = null; 36 37 38 private String tagClass = null; 39 40 41 private String bodyContent = null; 42 43 44 private Collection attrDefs = null; 45 46 47 52 public TagDef() { 53 } 54 55 56 63 public TagDef(TagDef n) { 64 65 this.name = n.name; 66 this.tagClass = n.tagClass; 67 this.bodyContent = n.bodyContent; 68 attrDefs = new ArrayList(); 69 70 AttributeDef[] ar = this.getAttributeDefArray(); 71 72 for (int i = 0; i < ar.length; i++) { 73 attrDefs.add(new AttributeDef(ar[i])); 74 } 75 } 76 77 78 85 public void setName(String name) { 86 this.name = name; 87 } 88 89 90 97 public void setTagClass(String tagClass) { 98 this.tagClass = tagClass; 99 } 100 101 102 109 public void setAttributeDefs(Collection attrDefs) { 110 this.attrDefs = attrDefs; 111 } 112 113 114 121 public String getName() { 122 return (this.name); 123 } 124 125 126 133 public String getTagClass() { 134 return (this.tagClass); 135 } 136 137 138 145 public Collection getAttributeDefs() { 146 return (this.attrDefs); 147 } 148 149 150 157 public AttributeDef[] getAttributeDefArray() { 158 159 int size = attrDefs.size(); 160 161 return (AttributeDef[]) attrDefs.toArray(new AttributeDef[size]); 162 } 163 164 165 172 public void setBodyContent(String bodyContent) { 173 this.bodyContent = bodyContent; 174 } 175 176 177 184 public String getBodyContent() { 185 return (this.bodyContent); 186 } 187 188 189 196 public String toString() { 197 StringBuffer toString = new StringBuffer (); 198 toString.append("\nname : "); 199 toString.append(name); 200 toString.append("\ntagClass : "); 201 toString.append(tagClass); 202 toString.append("\nbodyContent : "); 203 toString.append(bodyContent); 204 toString.append("\nattrDefs : "); 205 toString.append(attrDefs); 206 207 return new String (toString); 208 } 209 } | Popular Tags |