com.caucho.jsp
Class TagInstance

java.lang.Object
  extended by com.caucho.jsp.TagInstance

public class TagInstance
extends java.lang.Object

Describes a single tag instance.


Field Summary
static java.lang.String FRAGMENT_WITH_SIMPLE_PARENT
           
static java.lang.String FRAGMENT_WITH_TAG_PARENT
           
static java.lang.String TOP_TAG
           
 
Constructor Summary
TagInstance(ParseTagManager manager)
           
TagInstance(ParseTagManager manager, java.lang.String id)
           
 
Method Summary
 void addAttribute(QName name, java.lang.Object value)
          Sets the attribute.
 TagInstance addNewTag(JspGenerator gen, QName tagName, TagInfo tagInfo, java.lang.Class cl, java.util.ArrayList<QName> names, java.util.ArrayList<java.lang.String> values, boolean hasBodyContent)
          Adds a new tag.
 TagInstance addTag(JspGenerator gen, QName tagName, TagInfo tagInfo, java.lang.Class cl, java.util.ArrayList<QName> names, java.util.ArrayList<java.lang.Object> values, boolean hasBodyContent)
          Adds a child tag.
 TagInstance findTag(QName tagName, java.util.ArrayList<QName> names, boolean hasBodyContent)
          Finds the matching tag.
 boolean generateAdapterDeclaration()
           
 TagInstance get(int i)
          Iterates through the children.
 AnalyzedTag getAnalyzedTag()
          Returns the analyzed tag.
 boolean getAndSetInjectFactory(boolean value)
           
 java.lang.String getAttribute(QName name)
           
 TagAttributeInfo getAttributeInfo(java.lang.String name)
           
 java.util.ArrayList<QName> getAttributeNames()
          Returns the tag's attribute names.
 boolean getBodyContent()
          Get true if the tag has a body content.
 java.lang.String getId()
           
 java.lang.String getName()
          Returns the tag name
 boolean getNeedsAdapter()
          Set true if needs an adapter.
 TagInstance getParent()
           
 QName getQName()
          Returns the tag name
 java.lang.Class getTagClass()
          Returns the tag class.
 TagInfo getTagInfo()
           
 VariableInfo[] getVarInfo()
           
 boolean hasChildren()
          Returns true if there are children.
 boolean isSimpleTag()
          Returns true if it's a simple tag.
 boolean isTagFileTag()
          Returns true if it's a simple tag.
 boolean isTop()
          Returns true for a top tag.
 java.util.Iterator<TagInstance> iterator()
          Iterates through the children.
 void setBodyContent(boolean hasBodyContent)
          Set true if the tag has a body content.
 void setId(java.lang.String id)
           
 void setNeedsAdapter(boolean needsAdapter)
          if needs an adapter.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP_TAG

public static final java.lang.String TOP_TAG

FRAGMENT_WITH_TAG_PARENT

public static final java.lang.String FRAGMENT_WITH_TAG_PARENT
See Also:
Constant Field Values

FRAGMENT_WITH_SIMPLE_PARENT

public static final java.lang.String FRAGMENT_WITH_SIMPLE_PARENT
See Also:
Constant Field Values
Constructor Detail

TagInstance

public TagInstance(ParseTagManager manager)

TagInstance

public TagInstance(ParseTagManager manager,
                   java.lang.String id)
Method Detail

getQName

public QName getQName()
Returns the tag name


getName

public java.lang.String getName()
Returns the tag name


getId

public java.lang.String getId()

setId

public void setId(java.lang.String id)

generateAdapterDeclaration

public boolean generateAdapterDeclaration()

getParent

public TagInstance getParent()

isTop

public boolean isTop()
Returns true for a top tag.


getTagClass

public java.lang.Class getTagClass()
Returns the tag class.


isSimpleTag

public boolean isSimpleTag()
Returns true if it's a simple tag.


isTagFileTag

public boolean isTagFileTag()
Returns true if it's a simple tag.


getTagInfo

public TagInfo getTagInfo()

getAnalyzedTag

public AnalyzedTag getAnalyzedTag()
Returns the analyzed tag.


getVarInfo

public VariableInfo[] getVarInfo()

size

public int size()

hasChildren

public boolean hasChildren()
Returns true if there are children.


getNeedsAdapter

public boolean getNeedsAdapter()
Set true if needs an adapter.


setNeedsAdapter

public void setNeedsAdapter(boolean needsAdapter)
if needs an adapter.


iterator

public java.util.Iterator<TagInstance> iterator()
Iterates through the children.


get

public TagInstance get(int i)
Iterates through the children.


getAttributeNames

public java.util.ArrayList<QName> getAttributeNames()
Returns the tag's attribute names.


setBodyContent

public void setBodyContent(boolean hasBodyContent)
Set true if the tag has a body content.


getBodyContent

public boolean getBodyContent()
Get true if the tag has a body content.


addTag

public TagInstance addTag(JspGenerator gen,
                          QName tagName,
                          TagInfo tagInfo,
                          java.lang.Class cl,
                          java.util.ArrayList<QName> names,
                          java.util.ArrayList<java.lang.Object> values,
                          boolean hasBodyContent)
Adds a child tag. If the tag exists, just reuse it.

Parameters:
tagName - the JSP name of the tag
tagInfo - the TagInfo structure for the tag
cl - the tag's implementation class
names - the array of attribute names
values - the array of attribute values

addNewTag

public TagInstance addNewTag(JspGenerator gen,
                             QName tagName,
                             TagInfo tagInfo,
                             java.lang.Class cl,
                             java.util.ArrayList<QName> names,
                             java.util.ArrayList<java.lang.String> values,
                             boolean hasBodyContent)
Adds a new tag. Always create a new tag.


addAttribute

public void addAttribute(QName name,
                         java.lang.Object value)
Sets the attribute. Null values can't be pre-cached.


getAttribute

public java.lang.String getAttribute(QName name)

getAttributeInfo

public TagAttributeInfo getAttributeInfo(java.lang.String name)

findTag

public TagInstance findTag(QName tagName,
                           java.util.ArrayList<QName> names,
                           boolean hasBodyContent)
Finds the matching tag.


getAndSetInjectFactory

public boolean getAndSetInjectFactory(boolean value)