|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
org.makumba.analyser.AnalysableElement
org.makumba.analyser.AnalysableTag
public abstract class AnalysableTag
Extend this class in order to get analysis support for your tag.
Do make sure that:
TagData
from the cache if you need it
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.makumba.analyser.AnalysableElement |
---|
AnalysableElement.FilePositionElementComparator |
Field Summary | |
---|---|
static String[] |
ATTRIBUTE_VALUES_TRUE_FALSE
Commonly used Attribute values. |
TagData |
tagData
The TagData object holding the composite data collected by the analysis. |
MultipleKey |
tagKey
A tag key, used to find cached resources. |
static String |
TYPES
Cache names, for PageCache of analysis |
Fields inherited from class org.makumba.analyser.AnalysableElement |
---|
ANALYSIS_STATE |
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. |
void |
checkAttributeValues()
Checks if the provided attribute values are correct. |
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 |
ElementData |
getElementData()
|
PageContext |
getPageContext()
|
String |
getPageTextInfo()
Prints the page data collected during analysis in readable format |
MultipleKey |
getTagKey()
Gets the key that identifies this makumba tag |
String |
getTagText()
Returns the declaration text of the tag parsed at analysis time |
protected boolean |
needPageCache()
Checks if the tag needs the page cache |
protected void |
notEmpty(String attributeName,
String value)
Checks whether the given value is not blank, i.e. not null, and not an empty string or just contains whitespace, and throws a descriptive programmer error otherwise |
protected void |
onlyInt(String attributeName,
String value)
Checks whether the given value is of type integer, and throws a descriptive programmer error otherwise |
protected void |
registerAttributeValues(String attributeName,
String... values)
Registers one attribute and several possible values |
protected void |
registerPossibleAttributeValues()
Override this in order to register possible attribute values using registerAttributeValues(String, String...) . |
void |
setTagDataAtAnalysis(TagData tagData)
|
void |
setTagKey(PageCache pageCache)
Sets tagKey to uniquely identify this tag. |
Methods inherited from class org.makumba.analyser.AnalysableElement |
---|
checkTagFound, discardJSPParsingData, getAnalyzedElementData, getCurrentBodyTagData, getElementAfter, getElementBefore, getPageCache, getPageCache, getRunningElementData, getTagByAttribute, getTagById, getThreadElementStack, initializeThread, keepAnalysisState, setAnalyzedElementData, setRunningElementData |
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 |
---|
public static final String[] ATTRIBUTE_VALUES_TRUE_FALSE
public static final String TYPES
public TagData tagData
public MultipleKey tagKey
Constructor Detail |
---|
public AnalysableTag()
Method Detail |
---|
public ElementData getElementData()
getElementData
in class AnalysableElement
public void setTagDataAtAnalysis(TagData tagData)
public void addTagText(StringBuffer sb)
sb
- StringBuffer holding the tag textpublic String getTagText()
public PageContext getPageContext()
public void setTagKey(PageCache pageCache)
pageCache
- The page cache for the current pagedoAnalyzedStartTag(org.makumba.analyser.PageCache)
,
doStartAnalyze(org.makumba.analyser.PageCache)
public void doStartAnalyze(PageCache pageCache)
pageCache
- The page cache for the current pagepublic void doEndAnalyze(PageCache pageCache)
pageCache
- The page cache for the current pagepublic String getPageTextInfo()
public int doAnalyzedStartTag(PageCache pageCache) throws LogicException, JspException
pageCache
- The page cache for the current page
LogicException
JspException
doStartTag()
public int doAnalyzedEndTag(PageCache pageCache) throws LogicException, JspException
pageCache
- The page cache for the current page
LogicException
JspException
doEndTag()
protected boolean needPageCache()
true
if page cache is needed, false
otherwisepublic int doStartTag() throws JspException
doAnalyzedStartTag
FIXME some of the exception handling
should not be here
doStartTag
in interface Tag
doStartTag
in class TagSupport
JspException
public int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class TagSupport
JspException
protected void doAnalyzedCleanup()
public MultipleKey getTagKey()
public boolean allowsIdenticalKey()
true
if the tag is allowed to have the same key as others in the page, false
otherwisepublic boolean canHaveBody()
true
if the tag is allowed to have a body, false
otherwiseprotected void onlyInt(String attributeName, String value)
protected void notEmpty(String attributeName, String value)
protected void registerPossibleAttributeValues()
registerAttributeValues(String, String...)
. The registered attributes are checked before
doStartAnalyze(PageCache)
and throw a ProgrammerError
is thrown if the provided value is not
allowed.
protected final void registerAttributeValues(String attributeName, String... values)
attributeName
- the name of the attributevalues
- a number of possible values the attribute can takepublic void checkAttributeValues()
doStartAnalyze(PageCache)
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |