Methods Summary |
---|
public int | doAfterBody()Default processing for a body.
return SKIP_BODY;
|
public int | doEndTag()Default processing of the end tag returning EVAL_PAGE.
return EVAL_PAGE;
|
public int | doStartTag()Default processing of the start tag, returning SKIP_BODY.
return SKIP_BODY;
|
public static final Tag | findAncestorWithClass(Tag from, java.lang.Class klass)Find the instance of a given class type that is closest to a given
instance.
This method uses the getParent method from the Tag
interface.
This method is used for coordination among cooperating tags.
The current version of the specification only provides one formal
way of indicating the observable type of a tag handler: its
tag handler implementation class, described in the tag-class
subelement of the tag element. This is extended in an
informal manner by allowing the tag library author to
indicate in the description subelement an observable type.
The type should be a subtype of the tag handler implementation
class or void.
This addititional constraint can be exploited by a
specialized container that knows about that specific tag library,
as in the case of the JSP standard tag library.
When a tag library author provides information on the
observable type of a tag handler, client programmatic code
should adhere to that constraint. Specifically, the Class
passed to findAncestorWithClass should be a subtype of the
observable type.
boolean isInterface = false;
if (from == null ||
klass == null ||
(!Tag.class.isAssignableFrom(klass) &&
!(isInterface = klass.isInterface()))) {
return null;
}
for (;;) {
Tag tag = from.getParent();
if (tag == null) {
return null;
}
if ((isInterface && klass.isInstance(tag)) ||
klass.isAssignableFrom(tag.getClass()))
return tag;
else
from = tag;
}
|
public java.lang.String | getId()The value of the id attribute of this tag; or null.
return id;
|
public Tag | getParent()The Tag instance most closely enclosing this tag instance.
return parent;
|
public java.lang.Object | getValue(java.lang.String k)Get a the value associated with a key.
if (values == null) {
return null;
} else {
return values.get(k);
}
|
public java.util.Enumeration | getValues()Enumerate the keys for the values kept by this tag handler.
if (values == null) {
return null;
}
return values.keys();
|
public void | release()Release state.
parent = null;
id = null;
if( values != null ) {
values.clear();
}
values = null;
|
public void | removeValue(java.lang.String k)Remove a value associated with a key.
if (values != null) {
values.remove(k);
}
|
public void | setId(java.lang.String id)Set the id attribute for this tag.
this.id = id;
|
public void | setPageContext(PageContext pageContext)Set the page context.
this.pageContext = pageContext;
|
public void | setParent(Tag t)Set the nesting tag of this tag.
parent = t;
|
public void | setValue(java.lang.String k, java.lang.Object o)Associate a value with a String key.
if (values == null) {
values = new Hashtable();
}
values.put(k, o);
|