TagInfo (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.servlet.jsp.tagext Class TagInfo

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagInfo

public class TagInfo
extends Object

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.


字段摘要
static String BODY_CONTENT_EMPTY
          Static constant for getBodyContent() when it is empty.
static String BODY_CONTENT_JSP
          Static constant for getBodyContent() when it is JSP.
static String BODY_CONTENT_SCRIPTLESS
          Static constant for getBodyContent() when it is scriptless.
static String BODY_CONTENT_TAG_DEPENDENT
          Static constant for getBodyContent() when it is Tag dependent.
 
构造器摘要
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.
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.
 
方法摘要
 TagAttributeInfo[] getAttributes()
          Attribute information (in the TLD) on this tag.
 String getBodyContent()
          The bodycontent information for this tag.
 String getDisplayName()
          Get the displayName.
 String getInfoString()
          The information string for the tag.
 String getLargeIcon()
          Get the path to the large icon.
 String getSmallIcon()
          Get the path to the small icon.
 String getTagClassName()
          Name of the class that provides the handler for this tag.
 TagExtraInfo getTagExtraInfo()
          The instance (if any) for extra tag information.
 TagLibraryInfo getTagLibrary()
          The instance of TabLibraryInfo we belong to.
 String getTagName()
          The name of the Tag.
 TagVariableInfo[] getTagVariableInfos()
          Get TagVariableInfo objects associated with this TagInfo.
 VariableInfo[] getVariableInfo(TagData data)
          Information on the scripting objects created by this tag at runtime.
 boolean hasDynamicAttributes()
          Get dynamicAttributes associated with this TagInfo.
 boolean isValid(TagData data)
          Translation-time validation of the attributes.
 void setTagExtraInfo(TagExtraInfo tei)
          Set the instance for extra tag information.
 void setTagLibrary(TagLibraryInfo tl)
          Set the TagLibraryInfo property.
 ValidationMessage[] validate(TagData data)
          Translation-time validation of the attributes.
 
类方法继承 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

BODY_CONTENT_JSP

public static final String BODY_CONTENT_JSP
Static constant for getBodyContent() when it is JSP.

另请参见:
常量字段


BODY_CONTENT_TAG_DEPENDENT

public static final String BODY_CONTENT_TAG_DEPENDENT
Static constant for getBodyContent() when it is Tag dependent.

另请参见:
常量字段


BODY_CONTENT_EMPTY

public static final String BODY_CONTENT_EMPTY
Static constant for getBodyContent() when it is empty.

另请参见:
常量字段


BODY_CONTENT_SCRIPTLESS

public static final String BODY_CONTENT_SCRIPTLESS
Static constant for getBodyContent() when it is scriptless.

从以下版本开始:
JSP 2.0
另请参见:
常量字段

构造器详细信息

TagInfo

public 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 TagLibibraryInfo 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.

参数:
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;


TagInfo

public 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 TagLibibraryInfo 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.

参数:
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)


TagInfo

public 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 TagLibibraryInfo 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.

参数:
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
从以下版本开始:
JSP 2.0

方法详细信息

getTagName

public String getTagName()
The name of the Tag.

返回:
The (short) name of the tag.

getAttributes

public TagAttributeInfo[] getAttributes()
Attribute information (in the TLD) on this tag. The return is an array describing the attributes of this tag, as indicated in the TLD.

返回:
The array of TagAttributeInfo for this tag, or a zero-length array if the tag has no attributes.

getVariableInfo

public VariableInfo[] getVariableInfo(TagData data)
Information on the scripting objects created by this tag at runtime. This is a convenience method on the associated TagExtraInfo class.

参数:
data - TagData describing this action.
返回:
if a TagExtraInfo object is associated with this TagInfo, the result of getTagExtraInfo().getVariableInfo( data ), otherwise null.

isValid

public boolean isValid(TagData data)
Translation-time validation of the attributes. This is a convenience method on the associated TagExtraInfo class.

参数:
data - The translation-time TagData instance.
返回:
Whether the data is valid.

validate

public ValidationMessage[] validate(TagData data)
Translation-time validation of the attributes. This is a convenience method on the associated TagExtraInfo class.

参数:
data - The translation-time TagData instance.
返回:
A null object, or zero length array if no errors, an array of ValidationMessages otherwise.
从以下版本开始:
JSP 2.0

setTagExtraInfo

public void setTagExtraInfo(TagExtraInfo tei)
Set the instance for extra tag information.

参数:
tei - the TagExtraInfo instance

getTagExtraInfo

public TagExtraInfo getTagExtraInfo()
The instance (if any) for extra tag information.

返回:
The TagExtraInfo instance, if any.

getTagClassName

public String getTagClassName()
Name of the class that provides the handler for this tag.

返回:
The name of the tag handler class.

getBodyContent

public String getBodyContent()
The bodycontent information for this tag. If the bodycontent is not defined for this tag, the default of JSP will be returned.

返回:
the body content string.

getInfoString

public String getInfoString()
The information string for the tag.

返回:
the info string, or null if not defined

setTagLibrary

public void setTagLibrary(TagLibraryInfo tl)
Set 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.

参数:
tl - the TagLibraryInfo to assign

getTagLibrary

public TagLibraryInfo getTagLibrary()
The instance of TabLibraryInfo we belong to.

返回:
the tag library instance we belong to

getDisplayName

public String getDisplayName()
Get the displayName.

返回:
A short name to be displayed by tools, or null if not defined

getSmallIcon

public String getSmallIcon()
Get the path to the small icon.

返回:
Path to a small icon to be displayed by tools, or null if not defined

getLargeIcon

public String getLargeIcon()
Get the path to the large icon.

返回:
Path to a large icon to be displayed by tools, or null if not defined

getTagVariableInfos

public TagVariableInfo[] getTagVariableInfos()
Get TagVariableInfo objects associated with this TagInfo.

返回:
Array of TagVariableInfo objects corresponding to variables declared by this tag, or a zero length array if no variables have been declared

hasDynamicAttributes

public boolean hasDynamicAttributes()
Get dynamicAttributes associated with this TagInfo.

返回:
True if tag handler supports dynamic attributes
从以下版本开始:
JSP 2.0

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.