📄 taginfo.java
字号:
* @return The (short) name of the tag.
*/
public String getTagName() {
return tagName;
}
/**
* Attribute information (in the TLD) on this tag.
* The return is an array describing the attributes of this tag, as
* indicated in the TLD.
*
* @return The array of TagAttributeInfo for this tag, or a
* zero-length array if the tag has no attributes.
*/
public TagAttributeInfo[] getAttributes() {
return attributeInfo;
}
/**
* Information on the scripting objects created by this tag at runtime.
* This is a convenience method on the associated TagExtraInfo class.
*
* @param data TagData describing this action.
* @return if a TagExtraInfo object is associated with this TagInfo, the
* result of getTagExtraInfo().getVariableInfo( data ), otherwise
* null.
*/
public VariableInfo[] getVariableInfo(TagData data) {
VariableInfo[] result = null;
TagExtraInfo tei = getTagExtraInfo();
if (tei != null) {
result = tei.getVariableInfo( data );
}
return result;
}
/**
* Translation-time validation of the attributes.
* This is a convenience method on the associated TagExtraInfo class.
*
* @param data The translation-time TagData instance.
* @return Whether the data is valid.
*/
public boolean isValid(TagData data) {
TagExtraInfo tei = getTagExtraInfo();
if (tei == null) {
return true;
}
return tei.isValid(data);
}
/**
* Translation-time validation of the attributes.
* This is a convenience method on the associated TagExtraInfo class.
*
* @param data The translation-time TagData instance.
* @return A null object, or zero length array if no errors, an
* array of ValidationMessages otherwise.
* @since 2.0
*/
public ValidationMessage[] validate( TagData data ) {
TagExtraInfo tei = getTagExtraInfo();
if( tei == null ) {
return null;
}
return tei.validate( data );
}
/**
* Set the instance for extra tag information.
*
* @param tei the TagExtraInfo instance
*/
public void setTagExtraInfo(TagExtraInfo tei) {
tagExtraInfo = tei;
}
/**
* The instance (if any) for extra tag information.
*
* @return The TagExtraInfo instance, if any.
*/
public TagExtraInfo getTagExtraInfo() {
return tagExtraInfo;
}
/**
* Name of the class that provides the handler for this tag.
*
* @return The name of the tag handler class.
*/
public String getTagClassName() {
return tagClassName;
}
/**
* The bodycontent information for this tag.
* If the bodycontent is not defined for this
* tag, the default of JSP will be returned.
*
* @return the body content string.
*/
public String getBodyContent() {
return bodyContent;
}
/**
* The information string for the tag.
*
* @return the info string, or null if
* not defined
*/
public String getInfoString() {
return infoString;
}
/**
* 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.
*
* @param tl the TagLibraryInfo to assign
*/
public void setTagLibrary(TagLibraryInfo tl) {
tagLibrary = tl;
}
/**
* The instance of TabLibraryInfo we belong to.
*
* @return the tag library instance we belong to
*/
public TagLibraryInfo getTagLibrary() {
return tagLibrary;
}
// ============== JSP 2.0 TLD Information ========
/**
* Get the displayName.
*
* @return A short name to be displayed by tools,
* or null if not defined
*/
public String getDisplayName() {
return displayName;
}
/**
* Get the path to the small icon.
*
* @return Path to a small icon to be displayed by tools,
* or null if not defined
*/
public String getSmallIcon() {
return smallIcon;
}
/**
* Get the path to the large icon.
*
* @return Path to a large icon to be displayed by tools,
* or null if not defined
*/
public String getLargeIcon() {
return largeIcon;
}
/**
* Get TagVariableInfo objects associated with this TagInfo.
*
* @return Array of TagVariableInfo objects corresponding to
* variables declared by this tag, or a zero length
* array if no variables have been declared
*/
public TagVariableInfo[] getTagVariableInfos() {
return tagVariableInfo;
}
// ============== JSP 2.0 TLD Information ========
/**
* Get dynamicAttributes associated with this TagInfo.
*
* @return True if tag handler supports dynamic attributes
* @since 2.0
*/
public boolean hasDynamicAttributes() {
return dynamicAttributes;
}
/*
* private fields for 1.1 info
*/
private String tagName; // the name of the tag
private String tagClassName;
private String bodyContent;
private String infoString;
private TagLibraryInfo tagLibrary;
private TagExtraInfo tagExtraInfo; // instance of TagExtraInfo
private TagAttributeInfo[] attributeInfo;
/*
* private fields for 1.2 info
*/
private String displayName;
private String smallIcon;
private String largeIcon;
private TagVariableInfo[] tagVariableInfo;
/*
* Additional private fields for 2.0 info
*/
private boolean dynamicAttributes;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -