|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.servlet.jsp.tagext Class TagInfo
java.lang.Object javax.servlet.jsp.tagext.TagInfo
public class TagInfo
- extends Object
标记库中某个标记的标记信息;此类是根据标记库描述符文件 (TLD) 实例化的,仅在转换期间可用。
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 Summary | |
---|---|
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. |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
英文文档:
BODY_CONTENT_JSP
public static final String BODY_CONTENT_JSP
- Static constant for getBodyContent() when it is JSP.
- See Also:
- Constant Field Values
英文文档:
BODY_CONTENT_TAG_DEPENDENT
public static final String BODY_CONTENT_TAG_DEPENDENT
- Static constant for getBodyContent() when it is Tag dependent.
- See Also:
- Constant Field Values
英文文档:
BODY_CONTENT_EMPTY
public static final String BODY_CONTENT_EMPTY
- Static constant for getBodyContent() when it is empty.
- See Also:
- Constant Field Values
英文文档:
BODY_CONTENT_SCRIPTLESS
public static final String BODY_CONTENT_SCRIPTLESS
- Static constant for getBodyContent() when it is scriptless.
- Since:
- JSP 2.0
- See Also:
- Constant Field Values
Constructor Detail |
---|
public
TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo)
TagInfo 的构造方法,该 TagInfo 来自 JSP 1.1 格式的 TLD 中的数据。此类只能通过某些解析 TLD (Tag Library Descriptor) 的 JSP 代码所请求的 TagLibrary 代码进行实例化。
注意,因为 TagLibibraryInfo 同时反映了 TLD 信息和 taglib 指令信息,所以 TagInfo 实例取决于 taglib 指令。这可能是一个设计错误,将来可能会修复。
tagName | 此标记的名称 |
tagClassName | 标记处理程序类的名称 |
bodycontent | 有关这些标记正文内容的信息 |
infoString | 此标记的(可选)字符串信息 |
taglib | 包含我们的标记库实例。 |
tagExtraInfo | 提供附加标记信息的实例。可以为 null |
attributeInfo | 描述符中的 AttributeInfo 数据数组。可以为 null。 |
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.
- Parameters:
tagName
- The name of this tagtagClassName
- The name of the tag handler classbodycontent
- Information on the body content of these tagsinfoString
- The (optional) string information for this tagtaglib
- The instance of the tag library that contains us.tagExtraInfo
- The instance providing extra Tag info. May be nullattributeInfo
- An array of AttributeInfo data from descriptor. May be null;
public
TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo, String displayName, String smallIcon, String largeIcon, TagVariableInfo[] tvi)
TagInfo 的构造方法,该 TagInfo 来自 JSP 1.2 格式的 TLD 中的数据。此类只能通过某些解析 TLD (Tag Library Descriptor) 的 JSP 代码所请求的 TagLibrary 代码进行实例化。
注意,因为 TagLibibraryInfo 同时反映了 TLD 信息和 taglib 指令信息,所以 TagInfo 实例取决于 taglib 指令。这可能是一个设计错误,将来可能会修复。
tagName | 此标记的名称 |
tagClassName | 标记处理程序类的名称 |
bodycontent | 有关这些标记正文内容的信息 |
infoString | 此标记的(可选)字符串信息 |
taglib | 包含我们的标记库实例。 |
tagExtraInfo | 提供附加标记信息的实例。可以为 null |
attributeInfo | 描述符中的 AttributeInfo 数据数组。可以为 null。 |
displayName | 通过工具显示的短名称 |
smallIcon | 指向通过工具显示的小图标的路径 |
largeIcon | 指向通过工具显示的大图标的路径 |
tvi | TagVariableInfo 的数组(或者为 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.
- Parameters:
tagName
- The name of this tagtagClassName
- The name of the tag handler classbodycontent
- Information on the body content of these tagsinfoString
- The (optional) string information for this tagtaglib
- The instance of the tag library that contains us.tagExtraInfo
- The instance providing extra Tag info. May be nullattributeInfo
- An array of AttributeInfo data from descriptor. May be null;displayName
- A short name to be displayed by toolssmallIcon
- Path to a small icon to be displayed by toolslargeIcon
- Path to a large icon to be displayed by toolstvi
- An array of a TagVariableInfo (or null)
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)
TagInfo 的构造方法,该 TagInfo 来自 JSP 2.0 格式的 TLD 中的数据。此类只能通过某些解析 TLD (Tag Library Descriptor) 的 JSP 代码所请求的 TagLibrary 代码进行实例化。
注意,因为 TagLibibraryInfo 同时反映了 TLD 信息和 taglib 指令信息,所以 TagInfo 实例取决于 taglib 指令。这可能是一个设计错误,将来可能会修复。
tagName | 此标记的名称 |
tagClassName | 标记处理程序类的名称 |
bodycontent | 有关这些标记正文内容的信息 |
infoString | 此标记的(可选)字符串信息 |
taglib | 包含我们的标记库实例。 |
tagExtraInfo | 提供附加标记信息的实例。可以为 null |
attributeInfo | 描述符中的 AttributeInfo 数据数组。可以为 null。 |
displayName | 通过工具显示的短名称 |
smallIcon | 指向通过工具显示的小图标的路径 |
largeIcon | 指向通过工具显示的大图标的路径 |
tvi | TagVariableInfo 的数组(或者为 null) |
dynamicAttributes | 如果支持动态属性,则该参数为 true |
since | 2.0 |
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.
- Parameters:
tagName
- The name of this tagtagClassName
- The name of the tag handler classbodycontent
- Information on the body content of these tagsinfoString
- The (optional) string information for this tagtaglib
- The instance of the tag library that contains us.tagExtraInfo
- The instance providing extra Tag info. May be nullattributeInfo
- An array of AttributeInfo data from descriptor. May be null;displayName
- A short name to be displayed by toolssmallIcon
- Path to a small icon to be displayed by toolslargeIcon
- Path to a large icon to be displayed by toolstvi
- An array of a TagVariableInfo (or null)dynamicAttributes
- True if supports dynamic attributes- Since:
- JSP 2.0
Method Detail |
---|
public String
getTagName()
Tag 的名称。
return | 标记的(短)名称。 |
getTagName
public String getTagName()
- The name of the Tag.
- Returns:
- The (short) name of the tag.
public TagAttributeInfo[]
getAttributes()
关于此标记的属性信息(在 TLD 中)。返回 TLD 中指示的描述此标记属性的数组。
return | 此标记的 TagAttributeInfo 的数组,如果该标记没有属性,则返回长度为 0 的数组。 |
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.
- Returns:
- The array of TagAttributeInfo for this tag, or a zero-length array if the tag has no attributes.
public VariableInfo[]
getVariableInfo(TagData data)
关于此标记在运行时创建的脚本对象的信息。这是用于关联的 TagExtraInfo 类的便捷方法。
data | 描述此操作的 TagData。 |
return | 如果 TagExtraInfo 对象与此 TagInfo 关联,则返回调用 getTagExtraInfo().getVariableInfo( data ) 的结果,否则返回 null。 |
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.
- Parameters:
data
- TagData describing this action.- Returns:
- if a TagExtraInfo object is associated with this TagInfo, the result of getTagExtraInfo().getVariableInfo( data ), otherwise null.
public boolean
isValid(TagData data)
属性的转换期间验证。这是用于关联的 TagExtraInfo 类的便捷方法。
data | 转换期间 TagData 实例。 |
return | 数据是否有效。 |
isValid
public boolean isValid(TagData data)
- Translation-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.
public ValidationMessage[]
validate(TagData data)
属性的转换期间验证。这是用于关联的 TagExtraInfo 类的便捷方法。
data | 转换期间 TagData 实例。 |
return | 一个 null 对象,如果没有错误,则返回长度为 0 的数组,否则返回 ValidationMessage 数组。 |
since | 2.0 |
validate
public ValidationMessage[] validate(TagData data)
- Translation-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
public void
setTagExtraInfo(TagExtraInfo tei)
设置额外标记信息的实例。
tei | TagExtraInfo 实例 |
setTagExtraInfo
public void setTagExtraInfo(TagExtraInfo tei)
- Set the instance for extra tag information.
- Parameters:
tei
- the TagExtraInfo instance
public TagExtraInfo
getTagExtraInfo()
额外标记信息的实例(如果有)。
return | TagExtraInfo 实例(如果有)。 |
getTagExtraInfo
public TagExtraInfo getTagExtraInfo()
- The instance (if any) for extra tag information.
- Returns:
- The TagExtraInfo instance, if any.
public String
getTagClassName()
为此标记提供处理程序的类的名称。
return | 标记处理程序类的名称。 |
getTagClassName
public String getTagClassName()
- Name of the class that provides the handler for this tag.
- Returns:
- The name of the tag handler class.
public String
getBodyContent()
此标记的 bodycontent 信息。如果没有为此标记定义 bodycontent,则返回 JSP 的默认值。
return | 正文内容字符串。 |
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.
- Returns:
- the body content string.
public String
getInfoString()
标记的信息字符串。
return | 信息字符串,如果没有定义该字符串,则返回 null |
getInfoString
public String getInfoString()
- The information string for the tag.
- Returns:
- the info string, or null if not defined
public void
setTagLibrary(TagLibraryInfo tl)
设置 TagLibraryInfo 属性。
注意,TagLibraryInfo 元素不但依赖于 TLD 信息,而且还依赖于使用的特定 taglib 实例。这意味着需要做大量工作来构造和初始化 TagLib 对象。
如果谨慎使用,可使用此 setter 避免必须为每个 taglib 指令创建新的 TagInfo 元素。
tl | 要分配的 TagLibraryInfo |
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.
- Parameters:
tl
- the TagLibraryInfo to assign
public TagLibraryInfo
getTagLibrary()
我们所属的 TabLibraryInfo 实例。
return | 我们所属的标记库实例 |
getTagLibrary
public TagLibraryInfo getTagLibrary()
- The instance of TabLibraryInfo we belong to.
- Returns:
- the tag library instance we belong to
public String
getDisplayName()
获取 displayName。
return | 通过工具显示的短名称,如果没有定义该名称,则返回 null |
getDisplayName
public String getDisplayName()
- Get the displayName.
- Returns:
- A short name to be displayed by tools, or null if not defined
public String
getSmallIcon()
获取指向小图标的路径。
return | 指向通过工具显示的小图标的路径,如果没有定义该路径,则返回 null |
getSmallIcon
public String getSmallIcon()
- Get the path to the small icon.
- Returns:
- Path to a small icon to be displayed by tools, or null if not defined
public String
getLargeIcon()
获取指向大图标的路径。
return | 指向通过工具显示的大图标的路径,如果没有定义该路径,则返回 null |
getLargeIcon
public String getLargeIcon()
- Get the path to the large icon.
- Returns:
- Path to a large icon to be displayed by tools, or null if not defined
public TagVariableInfo[]
getTagVariableInfos()
获取与此 TagInfo 关联的 TagVariableInfo 对象。
return | 与此标记声明的变量相对应的 TagVariableInfo 对象的数组,如果没有声明任何变量,则返回长度为 0 的数组 |
getTagVariableInfos
public TagVariableInfo[] getTagVariableInfos()
- Get 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
public boolean
hasDynamicAttributes()
获取与此 TagInfo 关联的 dynamicAttributes。
return | 如果标记处理程序支持动态属性,则返回 true |
since | 2.0 |
hasDynamicAttributes
public boolean hasDynamicAttributes()
- Get dynamicAttributes associated with this TagInfo.
- Returns:
- True if tag handler supports dynamic attributes
- Since:
- JSP 2.0
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!