javax.servlet.jsp.tagext
Class TagExtraInfo

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

public abstract class TagExtraInfo
extends java.lang.Object

Extra tag information for a custom tag. It performs a similar function to BeanInfo classes, but for tag libraries. The TagExtraInfo class will be called at JSP compile time to:

  1. instantiate and initialize runtime variables
  2. validate tags

The TagExtraInfo class is specified in the TLD using the teiclass attribute:

 <tag>
   <name>foo</name>
   <tagclass>com.caucho.tags.FooTag</tagclass>
   <teiclass>com.caucho.tags.FooTagInfo</teiclass>
 </tag>
 


Constructor Summary
TagExtraInfo()
          Implementing classes must implement a zero-arg constructor.
 
Method Summary
 TagInfo getTagInfo()
          Gets the TLD tag info for this tag.
 VariableInfo[] getVariableInfo(TagData data)
          Returns information needed to instantiate runtime variables.
 boolean isValid(TagData data)
          Validates the tag, so errors can be caught at compile-time instead of waiting for runtime.
 void setTagInfo(TagInfo tagInfo)
          Sets the TLD tag info for this tag.
 ValidationMessage[] validate(TagData data)
          Validates the tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagExtraInfo

public TagExtraInfo()
Implementing classes must implement a zero-arg constructor.

Method Detail

getVariableInfo

public VariableInfo[] getVariableInfo(TagData data)
Returns information needed to instantiate runtime variables.

The default implementation returns null.

For example, if the tag initializes a nested integer named by the foo attribute, getVariableInfo might return the following:

 public VariableInfo []getVariableInfo(TagData data)
 {
   VariableInfo []info = new VariableInfo[1];
   String foo = data.getAttribute("foo");
   info[0] = new VariableInfo(foo, "int", true, VariableInfo.NESTED);
   return info;
 }
 

Parameters:
data - The tag's static attributes and values.

isValid

public boolean isValid(TagData data)
Validates the tag, so errors can be caught at compile-time instead of waiting for runtime.

The default implementation returns true.


setTagInfo

public final void setTagInfo(TagInfo tagInfo)
Sets the TLD tag info for this tag.


getTagInfo

public final TagInfo getTagInfo()
Gets the TLD tag info for this tag.


validate

public ValidationMessage[] validate(TagData data)
Validates the tag.