Package jakarta.servlet.jsp.tagext
Class TagInfo
java.lang.Object
jakarta.servlet.jsp.tagext.TagInfo
Tag information for a tag in a Tag Library; This class is instantiated from the Tag Library Descriptor file (TLD) and
 is available only at translation time.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringStatic constant for getBodyContent() when it is empty.static final StringStatic constant for getBodyContent() when it is JSP.static final StringStatic constant for getBodyContent() when it is scriptless.static final StringStatic constant for getBodyContent() when it is Tag dependent.
- 
Constructor SummaryConstructorsConstructorDescriptionTagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo) Constructor for TagInfo from data in the JSP 1.1 format for TLD.TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo, String displayName, String smallIcon, String largeIcon, TagVariableInfo[] tvi) Constructor for TagInfo from data in the JSP 1.2 format for TLD.TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo, String displayName, String smallIcon, String largeIcon, TagVariableInfo[] tvi, boolean dynamicAttributes) Constructor for TagInfo from data in the JSP 2.0 format for TLD.
- 
Method SummaryModifier and TypeMethodDescriptionAttribute information (in the TLD) on this tag.The bodycontent information for this tag.Get the displayName.The information string for the tag.Get the path to the large icon.Get the path to the small icon.Name of the class that provides the handler for this tag.The instance (if any) for extra tag information.The instance of TabLibraryInfo we belong to.The name of the Tag.Get TagVariableInfo objects associated with this TagInfo.getVariableInfo(TagData data) Information on the scripting objects created by this tag at runtime.booleanGet dynamicAttributes associated with this TagInfo.booleanTranslation-time validation of the attributes.voidSet the instance for extra tag information.voidSet the TagLibraryInfo property.Translation-time validation of the attributes.
- 
Field Details- 
BODY_CONTENT_JSPStatic constant for getBodyContent() when it is JSP.- See Also:
 
- 
BODY_CONTENT_TAG_DEPENDENTStatic constant for getBodyContent() when it is Tag dependent.- See Also:
 
- 
BODY_CONTENT_EMPTYStatic constant for getBodyContent() when it is empty.- See Also:
 
- 
BODY_CONTENT_SCRIPTLESSStatic constant for getBodyContent() when it is scriptless.- Since:
- JSP 2.0
- See Also:
 
 
- 
- 
Constructor Details- 
TagInfopublic TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo) Constructor for TagInfo from data in the JSP 1.1 format for TLD. This class is to be instantiated only from the TagLibrary code under request from some JSP code that is parsing a TLD (Tag Library Descriptor). Note that, since TagLibraryInfo reflects both TLD information and taglib directive information, a TagInfo instance is dependent on a taglib directive. This is probably a design error, which may be fixed in the future.- Parameters:
- tagName- The name of this tag
- tagClassName- The name of the tag handler class
- bodycontent- Information on the body content of these tags
- infoString- The (optional) string information for this tag
- taglib- The instance of the tag library that contains us.
- tagExtraInfo- The instance providing extra Tag info. May be null
- attributeInfo- An array of AttributeInfo data from descriptor. May be null;
 
- 
TagInfopublic TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo, String displayName, String smallIcon, String largeIcon, TagVariableInfo[] tvi) Constructor for TagInfo from data in the JSP 1.2 format for TLD. This class is to be instantiated only from the TagLibrary code under request from some JSP code that is parsing a TLD (Tag Library Descriptor). Note that, since TagLibraryInfo reflects both TLD information and taglib directive information, a TagInfo instance is dependent on a taglib directive. This is probably a design error, which may be fixed in the future.- Parameters:
- tagName- The name of this tag
- tagClassName- The name of the tag handler class
- bodycontent- Information on the body content of these tags
- infoString- The (optional) string information for this tag
- taglib- The instance of the tag library that contains us.
- tagExtraInfo- The instance providing extra Tag info. May be null
- attributeInfo- An array of AttributeInfo data from descriptor. May be null;
- displayName- A short name to be displayed by tools
- smallIcon- Path to a small icon to be displayed by tools
- largeIcon- Path to a large icon to be displayed by tools
- tvi- An array of a TagVariableInfo (or null)
 
- 
TagInfopublic TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo, String displayName, String smallIcon, String largeIcon, TagVariableInfo[] tvi, boolean dynamicAttributes) Constructor for TagInfo from data in the JSP 2.0 format for TLD. This class is to be instantiated only from the TagLibrary code under request from some JSP code that is parsing a TLD (Tag Library Descriptor). Note that, since TagLibraryInfo reflects both TLD information and taglib directive information, a TagInfo instance is dependent on a taglib directive. This is probably a design error, which may be fixed in the future.- Parameters:
- tagName- The name of this tag
- tagClassName- The name of the tag handler class
- bodycontent- Information on the body content of these tags
- infoString- The (optional) string information for this tag
- taglib- The instance of the tag library that contains us.
- tagExtraInfo- The instance providing extra Tag info. May be null
- attributeInfo- An array of AttributeInfo data from descriptor. May be null;
- displayName- A short name to be displayed by tools
- smallIcon- Path to a small icon to be displayed by tools
- largeIcon- Path to a large icon to be displayed by tools
- tvi- An array of a TagVariableInfo (or null)
- dynamicAttributes- True if supports dynamic attributes
- Since:
- JSP 2.0
 
 
- 
- 
Method Details- 
getTagNameThe name of the Tag.- Returns:
- The (short) name of the tag.
 
- 
getAttributesAttribute information (in the TLD) on this tag. The return is an array describing the attributes of this tag, as indicated in the TLD.- Returns:
- The array of TagAttributeInfo for this tag, or a zero-length array if the tag has no attributes.
 
- 
getVariableInfoInformation on the scripting objects created by this tag at runtime. This is a convenience method on the associated TagExtraInfo class.- Parameters:
- data- TagData describing this action.
- Returns:
- if a TagExtraInfo object is associated with this TagInfo, the result of getTagExtraInfo().getVariableInfo( data ), otherwise null.
 
- 
isValidTranslation-time validation of the attributes. This is a convenience method on the associated TagExtraInfo class.- Parameters:
- data- The translation-time TagData instance.
- Returns:
- Whether the data is valid.
 
- 
validateTranslation-time validation of the attributes. This is a convenience method on the associated TagExtraInfo class.- Parameters:
- data- The translation-time TagData instance.
- Returns:
- A null object, or zero length array if no errors, an array of ValidationMessages otherwise.
- Since:
- JSP 2.0
 
- 
setTagExtraInfoSet the instance for extra tag information.- Parameters:
- tei- the TagExtraInfo instance
 
- 
getTagExtraInfoThe instance (if any) for extra tag information.- Returns:
- The TagExtraInfo instance, if any.
 
- 
getTagClassNameName of the class that provides the handler for this tag.- Returns:
- The name of the tag handler class.
 
- 
getBodyContentThe bodycontent information for this tag. If the bodycontent is not defined for this tag, the default of JSP will be returned.- Returns:
- the body content string.
 
- 
getInfoStringThe information string for the tag.- Returns:
- the info string, or null if not defined
 
- 
setTagLibrarySet the TagLibraryInfo property. Note that a TagLibraryInfo element is dependent not just on the TLD information but also on the specific taglib instance used. This means that a fair amount of work needs to be done to construct and initialize TagLib objects. If used carefully, this setter can be used to avoid having to create new TagInfo elements for each taglib directive.- Parameters:
- tl- the TagLibraryInfo to assign
 
- 
getTagLibraryThe instance of TabLibraryInfo we belong to.- Returns:
- the tag library instance we belong to
 
- 
getDisplayNameGet the displayName.- Returns:
- A short name to be displayed by tools, or null if not defined
 
- 
getSmallIconGet the path to the small icon.- Returns:
- Path to a small icon to be displayed by tools, or null if not defined
 
- 
getLargeIconGet the path to the large icon.- Returns:
- Path to a large icon to be displayed by tools, or null if not defined
 
- 
getTagVariableInfosGet TagVariableInfo objects associated with this TagInfo.- Returns:
- Array of TagVariableInfo objects corresponding to variables declared by this tag, or a zero length array if no variables have been declared
 
- 
hasDynamicAttributespublic boolean hasDynamicAttributes()Get dynamicAttributes associated with this TagInfo.- Returns:
- True if tag handler supports dynamic attributes
- Since:
- JSP 2.0
 
 
-