org.eclipse.jet.taglib
Interface RuntimeTagElement
-
public interface RuntimeTagElement
Defines the execution behavior an XML Element in a JET2 compiled template.
Clients do not typically use the class directly.
The tag has the following life cycle:
Tag constructor is called.
Parent tag is set via
setParent(). If the tag has no parent, null is passed.
The tag context is set via
setTagInfo(TagInfo).
The tag is readied for operation by a call to
doStart().
If the element has body content (that is, it is not an empty tag, but a begin-tag/end-tag pair), then
okToProcessBody() is called.
If
okToProcessBody() returns true, then
handleBodyContent() is called.
okToProcessBody() and
handleBodyContent() are called
repeatedly until
okToProcessBody() returns false.
Once body processing is complete,
doEnd() is called.
This interface is not intended to be implemented by clients.
setRuntimeParent
void setRuntimeParent(
RuntimeTagElement parentTag)
- Set the parent tag of the element. This method always called once, after construction,
and before
ready() is called.
-
-
Parameters:
-
parentTag - the parent tag, or null if the tag has no parent in the template.
setTagInfo
void setTagInfo(
TagInfo tagInfo)
- Provide the tag with information on its context within the template, include attribute values
and position.
-
-
Parameters:
-
tagInfo - the tag information. Will never by null. -
See Also:
-
TagInfo
getTagInfo
TagInfo getTagInfo()
- Return the tag context set by
setTagInfo(TagInfo).
-
-
Returns:
- the tag context, or
null if not yet set.
doStart
void doStart(
JET2Context context,
JET2Writer out)
- Perform any actions associated with the start of the tag element.
-
-
Parameters:
-
context - -
out -
doEnd
void doEnd()
- Perform any actions associated with the end of the tag element.
-
okToProcessBody
boolean okToProcessBody()
- Determine if the tag element's body should be processed.
If the tag element has a body (even an empty body), then this method is called repeatedly until
false
is returned. Each time true is returned,
handleBodyContent(JET2Writer) is called.
-
-
Returns:
-
true if the body should be processed, false otherwise.
handleBodyContent
void handleBodyContent(
JET2Writer bodyContent)
- Handle the body content of the tag element.
This method is called once everytime a call to
okToProcessBody() returns true.
-
-
Parameters:
-
bodyContent - the writer containing the body content. Will never by null.
getContext
JET2Context getContext()
- Return the context passed to
doStart(JET2Context, JET2Writer).
-
-
Returns:
- the context
getWriter
JET2Writer getWriter()
- Return the writer passed to
doStart(JET2Context, JET2Writer).
-
-
Returns:
- the current output writer