javax.servlet.jsp.tagext

Class TagData

Implemented Interfaces:
Cloneable

public class TagData
extends Object
implements Cloneable

Tag instance attributes and values. This information is used by TagExtraInfo to prepare VariableInfo.

Field Summary

static Object
REQUEST_TIME_VALUE
Constant object used as a key for request time attributes.

Constructor Summary

TagData(Object[][] attrs)
Create a new TagData object based on and array of attribute key/values.
TagData(Hashtable<K,V> attrs)
Create a new TagData object based on an attribute key/value hash table.

Method Summary

Object
clone()
Clone the tag data.
Object
getAttribute(String attribute)
Returns the attribute with the given name.
String
getAttributeString(String name)
Return the attribute as a string.
Enumeration<E>
getAttributes()
Enumerates the attribute names.
String
getId()
Return the id of the attribute as a string.
void
setAttribute(String attribute, Object value)
Sets the attribute with the given name.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

REQUEST_TIME_VALUE

public static final Object REQUEST_TIME_VALUE
Constant object used as a key for request time attributes.
Usages and Demos :

View More Examples of REQUEST_TIME_VALUE
   1:     else
   2:       tags.put(name, TagData.REQUEST_TIME_VALUE);
   3:       }
   4:         ...
   5:       else if (value instanceof String && hasRuntimeAttribute((String) value))
   6:         tags.put(name, TagData.REQUEST_TIME_VALUE);
   7:       else
   8:         ...
   9: 
  10:     TagData tagData = new TagData(tags);
  11:     

View Full Code Here
   1: import javax.servlet.jsp.tagext.TagAttributeInfo;
   2: import javax.servlet.jsp.tagext.TagData;
   3: import javax.servlet.jsp.tagext.TagExtraInfo;
   4:         ...
   5: 
   6:             TagData tagData = new TagData(tagDataAttrs);
   7: 
   8:         ...
   9:                             tagDataAttrs.put(attrs.getQName(i),
  10:                                     TagData.REQUEST_TIME_VALUE);
  11:                         } else {
  12:         ...
  13:                             tagDataAttrs.put(na.getName(),
  14:                                     TagData.REQUEST_TIME_VALUE);

View Full Code Here

Constructor Details

TagData

public TagData(Object[][] attrs)
Create a new TagData object based on and array of attribute key/values.
Usages and Demos :

View More Examples of TagData(Object[][] attrs)
   1:         table.put("name", fakeVariable);
   2:         data = new TagData(table);
   3:     }
   4:     
   5:     public void testGetVariableInfo(TagData data) {

View Full Code Here
   1:     TagData tagData = 
   2:         new TagData(JspUtil.attrsToHashtable(attrs));
   3:         VariableInfo[] vi = ti.getVariableInfo(tagData);
   4:     TagVariableInfo[] tvi = ti.getTagVariableInfos();

View Full Code Here
   1:         
   2:         tagData = new TagData(attribs);
   3:         if (!ti.isValid(tagData))
   4:             throw new CompileException(start,
   5:                        Constants.getString("jsp.error.invalid_attributes"));

View Full Code Here
   1: 
   2:     TagData tagData = new TagData(tags);
   3:     
   4:     _varInfo = _tagInfo.getVariableInfo(tagData);

View Full Code Here
   1: 
   2:             TagData tagData = new TagData(tagDataAttrs);
   3: 
   4:             TagExtraInfo tei = tagInfo.getTagExtraInfo();
   5:             if (tei != null && tei.getVariableInfo(tagData) != null

View Full Code Here

TagData

public TagData(Hashtable<K,V> attrs)
Create a new TagData object based on an attribute key/value hash table.
Usages and Demos :

View More Examples of TagData(Hashtable attrs)
   1:         table.put("name", fakeVariable);
   2:         data = new TagData(table);
   3:     }
   4:     
   5:     public void testGetVariableInfo(TagData data) {

View Full Code Here
   1:     TagData tagData = 
   2:         new TagData(JspUtil.attrsToHashtable(attrs));
   3:         VariableInfo[] vi = ti.getVariableInfo(tagData);
   4:     TagVariableInfo[] tvi = ti.getTagVariableInfos();

View Full Code Here
   1:         
   2:         tagData = new TagData(attribs);
   3:         if (!ti.isValid(tagData))
   4:             throw new CompileException(start,
   5:                        Constants.getString("jsp.error.invalid_attributes"));

View Full Code Here
   1: 
   2:     TagData tagData = new TagData(tags);
   3:     
   4:     _varInfo = _tagInfo.getVariableInfo(tagData);

View Full Code Here
   1: 
   2:             TagData tagData = new TagData(tagDataAttrs);
   3: 
   4:             TagExtraInfo tei = tagInfo.getTagExtraInfo();
   5:             if (tei != null && tei.getVariableInfo(tagData) != null

View Full Code Here

Method Details

clone

public Object clone()
Clone the tag data.
Overrides:
clone in interface Object

getAttribute

public Object getAttribute(String attribute)
Returns the attribute with the given name.
Usages and Demos :

View More Examples of getAttribute(String attribute)
   1: 
   2: import javax.servlet.jsp.tagext.TagData;
   3: import javax.servlet.jsp.tagext.TagExtraInfo;
   4:         ...
   5:     
   6:     public boolean isValid(TagData data)
   7:     {
   8:         ...
   9:         try {
  10:             Object from = data.getAttribute("from");
  11:             if(null != from && from instanceof String) {
  12:         ...
  13:             
  14:             Object to = data.getAttribute("to");

View Full Code Here
   1: import javax.servlet.jsp.tagext.VariableInfo;
   2: import javax.servlet.jsp.tagext.TagData;
   3: 
   4:         ...
   5: 
   6:   public VariableInfo[] getVariableInfo(TagData tagData) {
   7:     String var = tagData.getAttributeString("var");
   8:         ...
   9:       return new VariableInfo[] {            
  10:             new VariableInfo((String)tagData.getAttribute("var"),                       
  11:                              "java.lang.String",

View Full Code Here
   1: 
   2:     public static boolean isSpecified(TagData data, String attributeName) {
   3:         ...
   4:         return (data.getAttribute(attributeName) != null);
   5:     }
   6: 
   7: }

View Full Code Here
   1: 
   2: import javax.servlet.jsp.tagext.TagData;
   3: import javax.servlet.jsp.tagext.TagExtraInfo;
   4:         ...
   5: 
   6:     public static boolean isSpecified(TagData data, String attributeName) {
   7: 
   8:         ...
   9:         return (data.getAttribute(attributeName) != null);
  10:     }
  11:         ...
  12: 
  13:     public boolean isValid(TagData data) {

View Full Code Here
   1: 
   2: import javax.servlet.jsp.tagext.TagData;
   3: import javax.servlet.jsp.tagext.TagExtraInfo;
   4:         ...
   5:     
   6:     public static boolean isSpecified(TagData data, String attributeName) {
   7:         ...
   8:         return (data.getAttribute(attributeName) != null);
   9:     }
  10:         ...
  11:     
  12:     public boolean isValid(TagData data) {

View Full Code Here

getAttributeString

public String getAttributeString(String name)
Return the attribute as a string.
Usages and Demos :

View More Examples of getAttributeString(String name)
   1:     
   2:     public VariableInfo[] getVariableInfo(TagData data)
   3:     {
   4:         ...
   5:             (
   6:                 data.getAttributeString("name"),
   7:         ...
   8:                 data.getAttributeString("type"),
   9:                 true,

View Full Code Here
   1:     
   2:     public VariableInfo[] getVariableInfo(TagData data)
   3:     {
   4:         ...
   5:             (
   6:                 data.getAttributeString("name"),
   7:         ...
   8:                 data.getAttributeString("type"),
   9:                 true,

View Full Code Here
   1: public class XPathForEachNodeTei extends TagExtraInfo {
   2:     public VariableInfo[] getVariableInfo(TagData data) {
   3:         return new VariableInfo[]{
   4:         ...
   5:             new VariableInfo(data.getAttributeString("id"), 
   6:             "com.wrox.projsp.ch11.jsp.XPathForEachNodeTag", 
   7:             true, 
   8:             VariableInfo.NESTED)};

View Full Code Here
   1:     public IterateTei() {}
   2:     public VariableInfo[] getVariableInfo(TagData data)
   3:     {
   4:         ...
   5:                 new VariableInfo(
   6:                         data.getAttributeString("name"),
   7:         ...
   8:                         data.getAttributeString("type"),
   9:                         true,

View Full Code Here
   1: public class DefinicePromTEI extends TagExtraInfo { 
   2:     public VariableInfo[] getVariableInfo(TagData data) {
   3:         VariableInfo info1
   4:         ...
   5:         = new VariableInfo(data.getAttributeString("nazev"),
   6:         ...
   7:                            data.getAttributeString("typ"),    
   8:                            true,

View Full Code Here

getAttributes

public Enumeration<E> getAttributes()
Enumerates the attribute names.

getId

public String getId()
Return the id of the attribute as a string.
Usages and Demos :

View More Examples of getId()
   1:     
   2:     public VariableInfo[] getVariableInfo(TagData data)
   3:     {
   4:         ...
   5:         {
   6:             new VariableInfo(data.getId(),
   7:                              "com.hellking.study.ejb.Customer",
   8:                              true,
   9:                              VariableInfo.AT_BEGIN)

View Full Code Here
   1: {
   2:     public VariableInfo[] getVariableInfo(TagData data)
   3:     {
   4:         ...
   5:         {
   6:             new VariableInfo(data.getId(),
   7:                              (String)data.getAttribute("type"),
   8:                              true,
   9:                              VariableInfo.AT_BEGIN)

View Full Code Here
   1: {
   2:     public VariableInfo[] getVariableInfo(TagData data)
   3:     {
   4:         ...
   5:         {
   6:             new VariableInfo(data.getId(),
   7:                              (String)data.getAttribute("type"),
   8:                              true,
   9:                              VariableInfo.NESTED)

View Full Code Here
   1: public class QueryExtraInfo extends TagExtraInfo {
   2:   public VariableInfo[] getVariableInfo(TagData data) {
   3:     
   4:         ...
   5:     return new VariableInfo[] {
   6:         new VariableInfo(data.getId(), 
   7:                          "java.sql.ResultSet",
   8:                          true,
   9:                          VariableInfo.NESTED) };

View Full Code Here
   1: 
   2: import javax.servlet.jsp.tagext.TagData;
   3: import javax.servlet.jsp.tagext.TagExtraInfo;
   4:         ...
   5:     
   6:     public VariableInfo[] getVariableInfo(TagData data)
   7:     {
   8:         ...
   9: 
  10:         rc[0] =  new VariableInfo(data.getId(),
  11:                                   "java.lang.String",

View Full Code Here

setAttribute

public void setAttribute(String attribute,
                         Object value)
Sets the attribute with the given name.