Package com.aspectran.web.support.util
Class TagUtils
- java.lang.Object
-
- com.aspectran.web.support.util.TagUtils
-
public abstract class TagUtils extends java.lang.ObjectThis class is a clone of org.springframework.web.util.TagUtils
Utility class for tag library related code, exposing functionality such as translatingStringsto web scopes.pagewill be transformed toPageContext.PAGE_SCOPErequestwill be transformed toPageContext.REQUEST_SCOPEsessionwill be transformed toPageContext.SESSION_SCOPEapplicationwill be transformed toPageContext.APPLICATION_SCOPE
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSCOPE_APPLICATIONConstant identifying the application scope.static java.lang.StringSCOPE_PAGEConstant identifying the page scope.static java.lang.StringSCOPE_REQUESTConstant identifying the request scope.static java.lang.StringSCOPE_SESSIONConstant identifying the session scope.
-
Constructor Summary
Constructors Constructor Description TagUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertHasAncestorOfType(javax.servlet.jsp.tagext.Tag tag, java.lang.Class<?> ancestorTagClass, java.lang.String tagName, java.lang.String ancestorTagName)Determine whether the suppliedTaghas any ancestor tag of the supplied type, throwing anIllegalStateExceptionif not.static intgetScope(java.lang.String scope)Determines the scope for a given inputString.static booleanhasAncestorOfType(javax.servlet.jsp.tagext.Tag tag, java.lang.Class<?> ancestorTagClass)Determine whether the suppliedTaghas any ancestor tag of the supplied type.
-
-
-
Field Detail
-
SCOPE_PAGE
public static final java.lang.String SCOPE_PAGE
Constant identifying the page scope.- See Also:
- Constant Field Values
-
SCOPE_REQUEST
public static final java.lang.String SCOPE_REQUEST
Constant identifying the request scope.- See Also:
- Constant Field Values
-
SCOPE_SESSION
public static final java.lang.String SCOPE_SESSION
Constant identifying the session scope.- See Also:
- Constant Field Values
-
SCOPE_APPLICATION
public static final java.lang.String SCOPE_APPLICATION
Constant identifying the application scope.- See Also:
- Constant Field Values
-
-
Method Detail
-
getScope
public static int getScope(java.lang.String scope)
Determines the scope for a given inputString.If the
Stringdoes not match 'request', 'session', 'page' or 'application', the method will returnPageContext.PAGE_SCOPE.- Parameters:
scope- theStringto inspect- Returns:
- the scope found, or
PageContext.PAGE_SCOPEif no scope matched - Throws:
java.lang.IllegalArgumentException- if the suppliedscopeisnull
-
hasAncestorOfType
public static boolean hasAncestorOfType(javax.servlet.jsp.tagext.Tag tag, java.lang.Class<?> ancestorTagClass)Determine whether the suppliedTaghas any ancestor tag of the supplied type.- Parameters:
tag- the tag whose ancestors are to be checkedancestorTagClass- the ancestorClassbeing searched for- Returns:
trueif the suppliedTaghas any ancestor tag of the supplied type- Throws:
java.lang.IllegalArgumentException- if either of the supplied arguments isnull; or if the suppliedancestorTagClassis not type-assignable to theTagclass
-
assertHasAncestorOfType
public static void assertHasAncestorOfType(javax.servlet.jsp.tagext.Tag tag, java.lang.Class<?> ancestorTagClass, java.lang.String tagName, java.lang.String ancestorTagName)Determine whether the suppliedTaghas any ancestor tag of the supplied type, throwing anIllegalStateExceptionif not.- Parameters:
tag- the tag whose ancestors are to be checkedancestorTagClass- the ancestorClassbeing searched fortagName- the name of thetag; for example 'option'ancestorTagName- the name of the ancestortag; for example 'select'- Throws:
java.lang.IllegalStateException- if the suppliedtagdoes not have a tag of the suppliedparentTagClassas an ancestorjava.lang.IllegalArgumentException- if any of the supplied arguments isnull, or in the case of theString-typed arguments, is composed wholly of whitespace; or if the suppliedancestorTagClassis not type-assignable to theTagclass- See Also:
hasAncestorOfType(javax.servlet.jsp.tagext.Tag, Class)
-
-