类 TagUtils
- java.lang.Object
- org.springframework.web.util.TagUtils
public abstract class TagUtils extends Object
Utility class for tag library related code, exposing functionality such as translatingStrings
to web scopes.page
will be transformed toPageContext.PAGE_SCOPE
request
will be transformed toPageContext.REQUEST_SCOPE
session
will be transformed toPageContext.SESSION_SCOPE
application
will be transformed toPageContext.APPLICATION_SCOPE
- 作者:
- Alef Arendsen, Rob Harrop, Juergen Hoeller, Rick Evans
字段概要
字段 修饰符和类型 字段 说明 static String
SCOPE_APPLICATION
Constant identifying the application scopestatic String
SCOPE_PAGE
Constant identifying the page scopestatic String
SCOPE_REQUEST
Constant identifying the request scopestatic String
SCOPE_SESSION
Constant identifying the session scope
构造器概要
构造器 构造器 说明 TagUtils()
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static void
assertHasAncestorOfType(Tag tag, Class<?> ancestorTagClass, String tagName, String ancestorTagName)
Determine whether the suppliedTag
has any ancestor tag of the supplied type, throwing anIllegalStateException
if not.static int
getScope(String scope)
Determines the scope for a given inputString
.static boolean
hasAncestorOfType(Tag tag, Class<?> ancestorTagClass)
Determine whether the suppliedTag
has any ancestor tag of the supplied type.
字段详细资料
SCOPE_PAGE
public static final String SCOPE_PAGE
Constant identifying the page scope- 另请参阅:
- 常量字段值
SCOPE_REQUEST
public static final String SCOPE_REQUEST
Constant identifying the request scope- 另请参阅:
- 常量字段值
SCOPE_SESSION
public static final String SCOPE_SESSION
Constant identifying the session scope- 另请参阅:
- 常量字段值
SCOPE_APPLICATION
public static final String SCOPE_APPLICATION
Constant identifying the application scope- 另请参阅:
- 常量字段值
构造器详细资料
TagUtils
public TagUtils()
方法详细资料
getScope
public static int getScope(String scope)
Determines the scope for a given inputString
.If the
String
does not match 'request', 'session', 'page' or 'application', the method will returnPageContext.PAGE_SCOPE
.- 参数:
scope
- theString
to inspect- 返回:
- the scope found, or
PageContext.PAGE_SCOPE
if no scope matched - 抛出:
IllegalArgumentException
- if the suppliedscope
isnull
hasAncestorOfType
public static boolean hasAncestorOfType(Tag tag, Class<?> ancestorTagClass)
Determine whether the suppliedTag
has any ancestor tag of the supplied type.- 参数:
tag
- the tag whose ancestors are to be checkedancestorTagClass
- the ancestorClass
being searched for- 返回:
true
if the suppliedTag
has any ancestor tag of the supplied type- 抛出:
IllegalArgumentException
- if either of the supplied arguments isnull
; or if the suppliedancestorTagClass
is not type-assignable to theTag
class
assertHasAncestorOfType
public static void assertHasAncestorOfType(Tag tag, Class<?> ancestorTagClass, String tagName, String ancestorTagName)
Determine whether the suppliedTag
has any ancestor tag of the supplied type, throwing anIllegalStateException
if not.- 参数:
tag
- the tag whose ancestors are to be checkedancestorTagClass
- the ancestorClass
being searched fortagName
- the name of thetag
; for example 'option
'ancestorTagName
- the name of the ancestortag
; for example 'select
'- 抛出:
IllegalStateException
- if the suppliedtag
does not have a tag of the suppliedparentTagClass
as an ancestorIllegalArgumentException
- if any of the supplied arguments isnull
, or in the case of theString
-typed arguments, is composed wholly of whitespace; or if the suppliedancestorTagClass
is not type-assignable to theTag
class- 另请参阅:
hasAncestorOfType(javax.servlet.jsp.tagext.Tag, Class)