|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTagSupport
BodyTagSupport
AbstractClassicTag
public abstract class AbstractClassicTag
AbstractBaseTag is the base tag for most of the NetUI tags. This tag provides default behavior and services for NetUI tags. There following categories of services are provided by this tag:
INameInterceptor
s to a name to produce the name written out. In addition, it allows
the URL Rewritter service to modify names.
Field Summary | |
---|---|
static List |
DefaultNamingChain
This List represents the default naming chain for handling dataSource attributes. |
protected static String |
EMPTY_STRING
String constant for the empty string. |
static String |
NETUI_UNIQUE_CNT
This is the name of a request scoped attribute which creates a unique id for processing a request. |
Fields inherited from class BodyTagSupport |
---|
bodyContent |
Fields inherited from class TagSupport |
---|
id, pageContext |
Fields inherited from interface BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
AbstractClassicTag()
|
Method Summary | |
---|---|
protected String |
applyNamingChain(String name)
This method walks all of the naming chains and allows them to rewrite the name parameter. |
protected String |
getErrorsReport()
This method will return a String |
protected String |
getIdForTagId(String tagId)
This method will generate a real id based upon the passed in tagId. |
protected List |
getNamingChain()
Return an List which represents a chain of INameInterceptor
objects. |
protected Form |
getNearestForm()
Returns the closest parent form tag, or null if there is none. |
protected int |
getNextId(ServletRequest req)
This method will generate the next unique int within the HTML tag. |
protected IScriptReporter |
getScriptReporter()
Return the closest ScriptReporter in the parental chain. |
abstract String |
getTagName()
Return the name of the tag. |
protected Locale |
getUserLocale()
This method will return the user local of the request. |
protected boolean |
hasErrors()
This method will return true if there have been any errors registered on this
tag. |
protected void |
localRelease()
This is a method that will reinitialize all temporary state on a tag and should be called in the doEndTag method. |
protected String |
qualifyAttribute(String name)
An internal method that allows a tag to qualify the name paramater by converting
it from a struts style naming convention to an explicit databinding expression. |
void |
registerTagError(AbstractPageError error)
This will report an error from a tag. |
void |
registerTagError(String message,
Throwable e)
This will report an error from a tag. |
protected int |
reportAndExit(int returnValue)
This is a simple routine which will call the error reporter if there is an error and then call local release before returning the returnValue . |
protected void |
reportErrors()
This method will write out the String returned by getErrorsReport to the
response output stream. |
protected String |
rewriteName(String name)
This method will rewrite the name (id) by passing it to the URL Rewritter and getting back a value. |
protected String |
setNonEmptyValueAttribute(String attrValue)
Filter out the empty string value and return either the value or null. |
protected String |
setRequiredValueAttribute(String attrValue,
String attrName)
Report an error if the value of attrValue is equal to the empty string, otherwise return
that value. |
protected void |
write(String string)
This mehod will write the passed string to the response. |
Methods inherited from class BodyTagSupport |
---|
doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent |
Methods inherited from class TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Tag |
---|
getParent, setPageContext, setParent |
Field Detail |
---|
public static final List DefaultNamingChain
dataSource
attributes. The list
is a read-only list which may be used by any dataSource
implementation.
public static final String NETUI_UNIQUE_CNT
protected static final String EMPTY_STRING
Constructor Detail |
---|
public AbstractClassicTag()
Method Detail |
---|
public abstract String getTagName()
getTagName
in interface INetuiTag
protected void localRelease()
protected Locale getUserLocale()
protected final void write(String string)
string
- to be written to the response.protected List getNamingChain()
List
which represents a chain of INameInterceptor
objects. This method by default returns null
and should be overridden
by objects that support naming.
List
that will contain INameInterceptor
objects.protected String applyNamingChain(String name) throws JspException
name
parameter.
After the naming chain processes the name, it will be passed to rewriteName
for final processing.
If the naming chaing returned from getNamingChain
returns null, the name will be passed to
rewriteName
and returned. If there is an ExpressionEvaluationException
thrown
by a INameInterceptor
, the error will be registered with the tag and null
will
be returned.
name
- the name to rewrite
INameInterceptor
s in the naming chain.
JspException
rewriteName(java.lang.String)
,
INameInterceptor
protected String qualifyAttribute(String name) throws JspException
name
paramater by converting
it from a struts style naming convention to an explicit databinding expression. The qualified
name will be returned. This method may report an error if there is an error in the expression.
name
- the name to be qualified
JspException
- throws a JspException if in-page error reporting is turned off.FormDataNameInterceptor
protected final String rewriteName(String name)
name
- the name that will be rewritten
protected final String getIdForTagId(String tagId)
tagId
- The base tagId set on a tag
protected final String setRequiredValueAttribute(String attrValue, String attrName) throws JspException
attrValue
is equal to the empty string, otherwise return
that value. If attrValue
is equal to the empty string, an error is registered and
null is returned.
attrValue
- The value to be checked for the empty stringattrName
- The name of the attribute
JspException
- A JspException will be thrown if inline error reporting is turned off.protected final String setNonEmptyValueAttribute(String attrValue)
attrValue
is equal to the empty string this will return null, otherwise it will
return the value of attrValue
.
attrValue
- This is the value we will check for the empty string.
protected int reportAndExit(int returnValue) throws JspException
returnValue
.
This is a very common code sequence in the Classic Tags so we provide this routine.
returnValue
- The value that will be returned.
returnValue
is always returned.
JspException
public void registerTagError(String message, Throwable e) throws JspException
registerTagError
in interface INetuiTag
message
- - the message to register with the error
JspException
- - if in-page error reporting is turned off this method will always
throw a JspException.public void registerTagError(AbstractPageError error) throws JspException
registerTagError
in interface INetuiTag
error
- The AbstractPageError
to add to the error list.
JspException
- - if in-page error reporting is turned off this method will always
throw a JspException.protected boolean hasErrors()
true
if there have been any errors registered on this
tag. Otherwise it returns false
true
if errors have been reported on this tag.protected void reportErrors() throws JspException
String
returned by getErrorsReport
to the
response output stream.
JspException
- if write
throws an exception.write(java.lang.String)
protected String getErrorsReport()
String that represents all of the errors that were
registered for the tag. This method assumes that there are errors in the tag and asserts
this is true. Code will typically call hasErrors
before calling this method.
- Returns:
- A
String
that contains all of the errors registered on this tag.
protected IScriptReporter getScriptReporter()
ScriptReporter
in the parental chain. Searching starts
at this node an moves upward through the parental chain.
ScriptReporter
or null if there is not one found.protected int getNextId(ServletRequest req)
req
- the Request
protected Form getNearestForm()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |