|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.util.TagUtils
public abstract class TagUtils
Utility class for tag library related code, exposing functionality
such as translating Strings
to web scopes.
page
will be transformed to
PageContext.PAGE_SCOPE
request
will be transformed to
PageContext.REQUEST_SCOPE
session
will be transformed to
PageContext.SESSION_SCOPE
application
will be transformed to
PageContext.APPLICATION_SCOPE
Field Summary | |
---|---|
static String |
SCOPE_APPLICATION
Constant identifying the application scope |
static String |
SCOPE_PAGE
Constant identifying the page scope |
static String |
SCOPE_REQUEST
Constant identifying the request scope |
static String |
SCOPE_SESSION
Constant identifying the session scope |
Constructor Summary | |
---|---|
TagUtils()
|
Method Summary | |
---|---|
static void |
assertHasAncestorOfType(Tag tag,
Class ancestorTagClass,
String tagName,
String ancestorTagName)
Determine whether the supplied Tag has any ancestor tag
of the supplied type, throwing an IllegalStateException
if not. |
static int |
getScope(String scope)
Determines the scope for a given input String . |
static boolean |
hasAncestorOfType(Tag tag,
Class ancestorTagClass)
Determine whether the supplied Tag has any ancestor tag
of the supplied type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SCOPE_PAGE
public static final String SCOPE_REQUEST
public static final String SCOPE_SESSION
public static final String SCOPE_APPLICATION
Constructor Detail |
---|
public TagUtils()
Method Detail |
---|
public static int getScope(String scope)
String
.
If the String
does not match 'request', 'session',
'page' or 'application', the method will return PageContext.PAGE_SCOPE
.
scope
- the String
to inspect
PageContext.PAGE_SCOPE
if no scope matched
IllegalArgumentException
- if the supplied scope
is null
public static boolean hasAncestorOfType(Tag tag, Class ancestorTagClass)
Tag
has any ancestor tag
of the supplied type.
tag
- the tag whose ancestors are to be checkedancestorTagClass
- the ancestor Class
being searched for
true
if the supplied Tag
has any ancestor tag
of the supplied type
IllegalArgumentException
- if either of the supplied arguments is null
;
or if the supplied ancestorTagClass
is not type-assignable to
the Tag
classpublic static void assertHasAncestorOfType(Tag tag, Class ancestorTagClass, String tagName, String ancestorTagName)
Tag
has any ancestor tag
of the supplied type, throwing an IllegalStateException
if not.
tag
- the tag whose ancestors are to be checkedancestorTagClass
- the ancestor Class
being searched fortagName
- the name of the tag
; for example 'option
'ancestorTagName
- the name of the ancestor tag
; for example 'select
'
IllegalStateException
- if the supplied tag
does not
have a tag of the supplied parentTagClass
as an ancestor
IllegalArgumentException
- if any of the supplied arguments is null
,
or in the case of the String
-typed arguments, is composed wholly
of whitespace; or if the supplied ancestorTagClass
is not
type-assignable to the Tag
classhasAncestorOfType(javax.servlet.jsp.tagext.Tag, Class)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |