Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.makumba.analyser
Class AnalysableTag

    java.lang.Object
      javax.servlet.jsp.tagext.TagSupport
          org.makumba.analyser.AnalysableTag

All Implemented Interfaces:
  Serializable, IterationTag, JspTag, Tag

Direct Known Subclasses:
  GenericMakumbaTag

    public abstract class AnalysableTag

extends TagSupport

Extend this class in order to get analysis support for your tag.

Version:
  $Id: AnalysableTag.java 3694 2009-02-11 00:41:05Z rosso_nero $
Author:
  Cristian Bogdan, Manuel Gay
See Also:
  Serialized Form

Field Summary
`static ThreadLocal<TagData>` | `analyzedTag`
`static String[]` | `ATTRIBUTE_VALUES_TRUE_FALSE` Commonly used Attribute values.
`static ThreadLocal<TagData>` | `runningTag`
`TagData` | `tagData` The TagData object holding the composite data collected by the analysis.
`MultipleKey` | `tagKey` A tag key, used to find cached resources.
`(package private) static ThreadLocal<Stack<TagData>>` | `tagStack`
`static String` | `TYPES` Cache names, for PageCache of analysis

Fields inherited from class javax.servlet.jsp.tagext.TagSupport
`id, pageContext`

Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
`EVAL_BODY_AGAIN`

Fields inherited from interface javax.servlet.jsp.tagext.Tag
`EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE`

Constructor Summary
`AnalysableTag()`

Method Summary
`void` | `addTagText(StringBuffer sb)` Dumps the tag line during analysis
`boolean` | `allowsIdenticalKey()` Determines whether the tag can have the same key as others in the page
`boolean` | `canHaveBody()` Determines whether this tag can have a body or not.
`protected void` | `checkValidAttributeValues(String attributeName, String value, String[] allowedAttributeValues)`
`protected void` | `doAnalyzedCleanup()` Called by doEndTag in its finally block.
`int` | `doAnalyzedEndTag(PageCache pageCache)` makumba-specific endTag
`int` | `doAnalyzedStartTag(PageCache pageCache)` makumba-specific startTag.
`void` | `doEndAnalyze(PageCache pageCache)` End the analysis of the tag, after all tags in the page were visited.
`int` | `doEndTag()` Handles exceptions and calls doMakumbaEndTag()
`void` | `doStartAnalyze(PageCache pageCache)` Starts the analysis of the tag, without knowing what tags follow it in the page.
`int` | `doStartTag()` Handles exceptions, initialises state and calls `doAnalyzedStartTag` FIXME some of the exception handling should not be here
`static TagData` | `getAnalyzedTag()`
`static TagData` | `getCurrentBodyTag()`
`static PageCache` | `getPageCache(PageContext pageContext, JspAnalyzer analyzer)` Static method to get the PageCache object for the current page.
`PageContext` | `getPageContext()`
`String` | `getPageTextInfo()` Prints the page data collected during analysis in readable format
`static TagData` | `getRunningTag()`
`MultipleKey` | `getTagKey()` Gets the key that identifies this makumba tag
`String` | `getTagText()` Returns the declaration text of the tag parsed at analysis time
`static Stack<TagData>` | `getThreadTagStack()`
`static void` | `initializeThread()`
`protected boolean` | `needPageCache()` Checks if the tag needs the page cache
`protected void` | `onlyInt(String s, String value)`
`void` | `setTagDataAtAnalysis(TagData tagData)`
`void` | `setTagKey(PageCache pageCache)` Sets tagKey to uniquely identify this tag.

Methods inherited from class javax.servlet.jsp.tagext.TagSupport
`doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ATTRIBUTE_VALUES_TRUE_FALSE

    public static final String[] ATTRIBUTE_VALUES_TRUE_FALSE

  Commonly used Attribute values.

### TYPES

    public static final String TYPES

  Cache names, for PageCache of analysis

  See Also:
    Constant Field Values

### analyzedTag

    public static ThreadLocal<TagData> analyzedTag

### runningTag

    public static ThreadLocal<TagData> runningTag

### tagStack

    static ThreadLocal<Stack<TagData>> tagStack

### tagData

    public TagData tagData

  The TagData object holding the composite data collected by the analysis. It is set by the tag parser at analysis time. It is set at runtime after the key is computed

### tagKey

    public MultipleKey tagKey

  A tag key, used to find cached resources. Computed by some tags, both at analysis and at runtime

Constructor Detail

### AnalysableTag

    public AnalysableTag()

Method Detail

### getRunningTag

    public static TagData getRunningTag()

### getAnalyzedTag

    public static TagData getAnalyzedTag()

### getCurrentBodyTag

    public static TagData getCurrentBodyTag()

### initializeThread

    public static void initializeThread()

### getThreadTagStack

    public static Stack<TagData> getThreadTagStack()

### getPageCache

    public static PageCache getPageCache(PageContext pageContext,
                                         JspAnalyzer analyzer)

  Static method to get the PageCache object for the current page. Constructs a new one if none found. We put this as static, as we may have to export it to packages like org.makumba.controller.jsp

  Parameters:
    `pageContext` - The PageContext object of the current page
    `analyzer` - the JSP analyzer

### setTagDataAtAnalysis

    public void setTagDataAtAnalysis(TagData tagData)

### addTagText

    public void addTagText(StringBuffer sb)

  Dumps the tag line during analysis

  Parameters:
    `sb` - StringBuffer holding the tag text

### getTagText

    public String getTagText()

  Returns the declaration text of the tag parsed at analysis time

  Returns:
    A string containing the declaration of the tag

### getPageContext

    public PageContext getPageContext()

### setTagKey

    public void setTagKey(PageCache pageCache)

  Sets tagKey to uniquely identify this tag. Called at analysis time before doStartAnalyze() and at runtime before doMakumbaStartTag()

  Parameters:
    `pageCache` - The page cache for the current page
  See Also:
    `doAnalyzedStartTag(org.makumba.analyser.PageCache)`, `doStartAnalyze(org.makumba.analyser.PageCache)`

### doStartAnalyze

    public void doStartAnalyze(PageCache pageCache)

  Starts the analysis of the tag, without knowing what tags follow it in the page. Typically this method will allocate initial data structures, that are then completed at doEndAnalyze()

  Parameters:
    `pageCache` - The page cache for the current page

### doEndAnalyze

    public void doEndAnalyze(PageCache pageCache)

  End the analysis of the tag, after all tags in the page were visited.

  Parameters:
    `pageCache` - The page cache for the current page

### getPageTextInfo

    public String getPageTextInfo()

  Prints the page data collected during analysis in readable format

  Returns:
    A String containing information about the page

### doAnalyzedStartTag

    public int doAnalyzedStartTag(PageCache pageCache)
                           throws LogicException,
                                  JspException

  makumba-specific startTag.

  Parameters:
    `pageCache` - The page cache for the current page
  Throws:
    `LogicException`
    `JspException`
  See Also:
    `doStartTag()`

### doAnalyzedEndTag

    public int doAnalyzedEndTag(PageCache pageCache)
                         throws LogicException,
                                JspException

  makumba-specific endTag

  Parameters:
    `pageCache` - The page cache for the current page
  Throws:
    `LogicException`
    `JspException`
  See Also:
    `doEndTag()`

### needPageCache

    protected boolean needPageCache()

  Checks if the tag needs the page cache

  Returns:
    `true` if page cache is needed, `false` otherwise

### doStartTag

    public int doStartTag()
                   throws JspException

  Handles exceptions, initialises state and calls `doAnalyzedStartTag` FIXME some of the exception handling should not be here

  Specified by:
    `doStartTag` in interface `Tag`
  Overrides:
    `doStartTag` in class `TagSupport`
  Throws:
    `JspException`

### doEndTag

    public int doEndTag()
                 throws JspException

  Handles exceptions and calls doMakumbaEndTag()

  Specified by:
    `doEndTag` in interface `Tag`
  Overrides:
    `doEndTag` in class `TagSupport`
  Throws:
    `JspException`

### doAnalyzedCleanup

    protected void doAnalyzedCleanup()

  Called by doEndTag in its finally block. Use it to clean references that will not be used next time the servlet container uses the tag object.

### getTagKey

    public MultipleKey getTagKey()

  Gets the key that identifies this makumba tag

  Returns:
    The MultipleKey used to identify the Makumba tag

### allowsIdenticalKey

    public boolean allowsIdenticalKey()

  Determines whether the tag can have the same key as others in the page

  Returns:
    `true` if the tag is allowed to have the same key as others in the page, `false` otherwise

### canHaveBody

    public boolean canHaveBody()

  Determines whether this tag can have a body or not.

  Returns:
    `true` if the tag is allowed to have a body, `false` otherwise

### onlyInt

    protected void onlyInt(String s,
                           String value)
                    throws JspException

  Throws:
    `JspException`

### checkValidAttributeValues

    protected void checkValidAttributeValues(String attributeName,
                                             String value,
                                             String[] allowedAttributeValues)
                                      throws ProgrammerError

  Throws:
    `ProgrammerError`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Docs generated on 2009-02-25 14:20