1 17 18 19 package javax.servlet.jsp.tagext; 20 21 28 29 public class TagInfo { 30 31 34 35 public static final String BODY_CONTENT_JSP = "JSP"; 36 37 40 41 public static final String BODY_CONTENT_TAG_DEPENDENT = "TAGDEPENDENT"; 42 43 44 47 48 public static final String BODY_CONTENT_EMPTY = "EMPTY"; 49 50 55 public static final String BODY_CONTENT_SCRIPTLESS = "SCRIPTLESS"; 56 57 78 public TagInfo(String tagName, 79 String tagClassName, 80 String bodycontent, 81 String infoString, 82 TagLibraryInfo taglib, 83 TagExtraInfo tagExtraInfo, 84 TagAttributeInfo [] attributeInfo) { 85 this.tagName = tagName; 86 this.tagClassName = tagClassName; 87 this.bodyContent = bodycontent; 88 this.infoString = infoString; 89 this.tagLibrary = taglib; 90 this.tagExtraInfo = tagExtraInfo; 91 this.attributeInfo = attributeInfo; 92 93 if (tagExtraInfo != null) 94 tagExtraInfo.setTagInfo(this); 95 } 96 97 121 public TagInfo(String tagName, 122 String tagClassName, 123 String bodycontent, 124 String infoString, 125 TagLibraryInfo taglib, 126 TagExtraInfo tagExtraInfo, 127 TagAttributeInfo [] attributeInfo, 128 String displayName, 129 String smallIcon, 130 String largeIcon, 131 TagVariableInfo [] tvi) { 132 this.tagName = tagName; 133 this.tagClassName = tagClassName; 134 this.bodyContent = bodycontent; 135 this.infoString = infoString; 136 this.tagLibrary = taglib; 137 this.tagExtraInfo = tagExtraInfo; 138 this.attributeInfo = attributeInfo; 139 this.displayName = displayName; 140 this.smallIcon = smallIcon; 141 this.largeIcon = largeIcon; 142 this.tagVariableInfo = tvi; 143 144 if (tagExtraInfo != null) 145 tagExtraInfo.setTagInfo(this); 146 } 147 148 175 public TagInfo(String tagName, 176 String tagClassName, 177 String bodycontent, 178 String infoString, 179 TagLibraryInfo taglib, 180 TagExtraInfo tagExtraInfo, 181 TagAttributeInfo [] attributeInfo, 182 String displayName, 183 String smallIcon, 184 String largeIcon, 185 TagVariableInfo [] tvi, 186 boolean dynamicAttributes) { 187 this.tagName = tagName; 188 this.tagClassName = tagClassName; 189 this.bodyContent = bodycontent; 190 this.infoString = infoString; 191 this.tagLibrary = taglib; 192 this.tagExtraInfo = tagExtraInfo; 193 this.attributeInfo = attributeInfo; 194 this.displayName = displayName; 195 this.smallIcon = smallIcon; 196 this.largeIcon = largeIcon; 197 this.tagVariableInfo = tvi; 198 this.dynamicAttributes = dynamicAttributes; 199 200 if (tagExtraInfo != null) 201 tagExtraInfo.setTagInfo(this); 202 } 203 204 209 210 public String getTagName() { 211 return tagName; 212 } 213 214 222 223 public TagAttributeInfo [] getAttributes() { 224 return attributeInfo; 225 } 226 227 236 public VariableInfo [] getVariableInfo(TagData data) { 237 VariableInfo [] result = null; 238 TagExtraInfo tei = getTagExtraInfo(); 239 if (tei != null) { 240 result = tei.getVariableInfo( data ); 241 } 242 return result; 243 } 244 245 252 public boolean isValid(TagData data) { 253 TagExtraInfo tei = getTagExtraInfo(); 254 if (tei == null) { 255 return true; 256 } 257 return tei.isValid(data); 258 } 259 260 269 public ValidationMessage [] validate( TagData data ) { 270 TagExtraInfo tei = getTagExtraInfo(); 271 if( tei == null ) { 272 return null; 273 } 274 return tei.validate( data ); 275 } 276 277 282 public void setTagExtraInfo(TagExtraInfo tei) { 283 tagExtraInfo = tei; 284 } 285 286 287 292 public TagExtraInfo getTagExtraInfo() { 293 return tagExtraInfo; 294 } 295 296 297 302 303 public String getTagClassName() { 304 return tagClassName; 305 } 306 307 308 315 316 public String getBodyContent() { 317 return bodyContent; 318 } 319 320 321 327 328 public String getInfoString() { 329 return infoString; 330 } 331 332 333 347 348 public void setTagLibrary(TagLibraryInfo tl) { 349 tagLibrary = tl; 350 } 351 352 357 358 public TagLibraryInfo getTagLibrary() { 359 return tagLibrary; 360 } 361 362 363 365 366 372 373 public String getDisplayName() { 374 return displayName; 375 } 376 377 383 384 public String getSmallIcon() { 385 return smallIcon; 386 } 387 388 394 395 public String getLargeIcon() { 396 return largeIcon; 397 } 398 399 406 407 public TagVariableInfo [] getTagVariableInfos() { 408 return tagVariableInfo; 409 } 410 411 412 414 420 public boolean hasDynamicAttributes() { 421 return dynamicAttributes; 422 } 423 424 427 private String tagName; private String tagClassName; 429 private String bodyContent; 430 private String infoString; 431 private TagLibraryInfo tagLibrary; 432 private TagExtraInfo tagExtraInfo; private TagAttributeInfo [] attributeInfo; 434 435 438 private String displayName; 439 private String smallIcon; 440 private String largeIcon; 441 private TagVariableInfo [] tagVariableInfo; 442 443 446 private boolean dynamicAttributes; 447 } 448 | Popular Tags |