TagData (Java EE 5)

Java EE API


javax.servlet.jsp.tagext Class TagData

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagData
All Implemented Interfaces:
Cloneable

public class TagData
extends Object
implements Cloneable

Implements: Cloneable

标记实例的(仅转换期间的)属性/值信息。

TagData 仅用作 TagExtraInfo 的 isValid、validate 和 getVariableInfo 方法的参数,这些方法在转换期间调用。

英文文档:

The (translation-time only) attribute/value information for a tag instance.

TagData is only used as an argument to the isValid, validate, and getVariableInfo methods of TagExtraInfo, which are invoked at translation time.


Field Summary
static Object
 
Constructor Summary
 
Method Summary
 Object
 Enumeration<String>
 String
 String
 void
 
Methods inherited from class java.lang.Object
 

Field Detail

英文文档:

REQUEST_TIME_VALUE

public static final Object REQUEST_TIME_VALUE
Distinguished value for an attribute to indicate its value is a request-time expression (which is not yet available because TagData instances are used at translation-time).

Constructor Detail

public TagData(Object[][] atts)
TagData 的构造方法。

典型的构造方法可能是

static final Object[][] att = {{"connection", "conn0"}, {"id", "query0"}};
static final TagData td = new TagData(att);
 
除了包含标识对象 REQUEST_TIME_VALUE 的那些值之外,其他所有值都必须是 String。
atts 静态属性和值。可以为 null。
英文文档:

TagData

public TagData(Object[][] atts)
Constructor for TagData.

A typical constructor may be

 static final Object[][] att = {{"connection", "conn0"}, {"id", "query0"}};
 static final TagData td = new TagData(att);
 
All values must be Strings except for those holding the distinguished object REQUEST_TIME_VALUE.

Parameters:
atts - the static attribute and values. May be null.


public TagData(java.util.Hashtable<K, V> attrs)
TagData 的构造方法。 如果哈希表中已经有属性了,则使用此构造方法。
attrs 可从中获取值的哈希表。
英文文档:

TagData

public TagData(Hashtable<String,Object> attrs)
Constructor for a TagData. If you already have the attributes in a hashtable, use this constructor.

Parameters:
attrs - A hashtable to get the values from.

Method Detail

public String getId()
标记的 id 属性的值。
return 标记的 id 属性的值,如果未指定这类属性,则返回 null。
英文文档:

getId

public String getId()
The value of the tag's id attribute.

Returns:
the value of the tag's id attribute, or null if no such attribute was specified.

public Object getAttribute(String attName)
属性的值。如果为接受请求期间属性表达式的属性指定了一个静态值,则返回该静态值,即使在 操作的正文中提供了该值。如果该值被指定为请求期间属性表达式,或者通过 <jsp:attribute> 操作使用包含动态内容(scriptlet、脚本表达式、EL 表达式、标准操作或自定义操作)的正文指定了该值,则仅返回标识对象 REQUEST_TIME_VALUE。如果未设置属性,则返回 null。
attName 属性的名称
return 属性的值
英文文档:

getAttribute

public Object getAttribute(String attName)
The value of the attribute. If a static value is specified for an attribute that accepts a request-time attribute expression then that static value is returned, even if the value is provided in the body of a <jsp:attribute> action. The distinguished object REQUEST_TIME_VALUE is only returned if the value is specified as a request-time attribute expression or via the <jsp:attribute> action with a body that contains dynamic content (scriptlets, scripting expressions, EL expressions, standard actions, or custom actions). Returns null if the attribute is not set.

Parameters:
attName - the name of the attribute
Returns:
the attribute's value

public void setAttribute(String attName, Object value)
设置属性的值。
attName 属性的名称
value 值。
英文文档:

setAttribute

public void setAttribute(String attName,
                         Object value)
Set the value of an attribute.

Parameters:
attName - the name of the attribute
value - the value.

public String getAttributeString(String attName)
获取给定属性的值。
attName 属性的名称
return 属性值字符串
ThrowsClassCastException: 如果属性值不是 String
英文文档:

getAttributeString

public String getAttributeString(String attName)
Get the value for a given attribute.

Parameters:
attName - the name of the attribute
Returns:
the attribute value string
Throws:
ClassCastException - if attribute value is not a String

public java.util.Enumeration<E> getAttributes()
枚举属性。
return TagData 中属性的枚举
英文文档:

getAttributes

public Enumeration<String> getAttributes()
Enumerates the attributes.

Returns:
An enumeration of the attributes in a TagData


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!