Class NavigationCaseWrapper
- java.lang.Object
-
- jakarta.faces.application.NavigationCase
-
- jakarta.faces.application.NavigationCaseWrapper
-
- All Implemented Interfaces:
FacesWrapper<NavigationCase>
public abstract class NavigationCaseWrapper extends NavigationCase implements FacesWrapper<NavigationCase>
Provides a simple implementation of
NavigationCasethat can be subclassed by developers wishing to provide specialized behavior to an existingNavigationCaseinstance. The default implementation of all methods is to call through to the wrappedNavigationCaseinstance.Usage: extend this class and push the implementation being wrapped to the constructor and use
getWrapped()to access the instance being wrapped.- Since:
- 2.2
-
-
Constructor Summary
Constructors Constructor Description NavigationCaseWrapper()Deprecated.Use the other constructor taking the implementation being wrapped.NavigationCaseWrapper(NavigationCase wrapped)If this navigation case has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)URLgetActionURL(FacesContext context)Construct an absolute URL to thisNavigationCaseinstance usingViewHandler.getActionURL(jakarta.faces.context.FacesContext, java.lang.String)on the path portion of the url.URLgetBookmarkableURL(FacesContext context)Construct an absolute URL suitable for a bookmarkable link to thisNavigationCaseinstance usingViewHandler.getBookmarkableURL(jakarta.faces.context.FacesContext, java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, boolean)on the path portion of the url.BooleangetCondition(FacesContext context)Evaluates the<if>for this<navigation-case>, if any.StringgetFromAction()Return the<from-action>for this<navigation-case>StringgetFromOutcome()Return the<from-outcome>for this<navigation-case>StringgetFromViewId()Return the<from-view-id>of the<navigation-rule>inside which this<navigation-case>is nested.Map<String,List<String>>getParameters()Return the parameters to be included for navigation cases requiring a redirect.URLgetRedirectURL(FacesContext context)Construct an absolute URL suitable for a "redirect" to thisNavigationCaseinstance usingViewHandler.getRedirectURL(jakarta.faces.context.FacesContext, java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, boolean)on the path portion of the url.URLgetResourceURL(FacesContext context)Construct an absolute URL to thisNavigationCaseinstance usingViewHandler.getResourceURL(jakarta.faces.context.FacesContext, java.lang.String)on the path portion of the url.StringgetToFlowDocumentId()If this navigation case represents a flow invocation, this property is the documentId in which the flow whose id is given by the return fromNavigationCase.getFromOutcome()is defined.StringgetToViewId(FacesContext context)Evaluates the<to-view-id>for this<navigation-case>NavigationCasegetWrapped()A class that implements this interface uses this method to return an instance of the class being wrapped.booleanhasCondition()Test if this navigation case has an associated<if>element.inthashCode()booleanisIncludeViewParams()Return the<redirect>value for this<navigation-case>.booleanisRedirect()Return the<redirect>value for this<navigation-case>.StringtoString()
-
-
-
Constructor Detail
-
NavigationCaseWrapper
@Deprecated public NavigationCaseWrapper()
Deprecated.Use the other constructor taking the implementation being wrapped.
-
NavigationCaseWrapper
public NavigationCaseWrapper(NavigationCase wrapped)
If this navigation case has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. The
getWrapped()will then return the implementation being wrapped.- Parameters:
wrapped- The implementation being wrapped.- Since:
- 2.3
-
-
Method Detail
-
getWrapped
public NavigationCase getWrapped()
Description copied from interface:FacesWrapperA class that implements this interface uses this method to return an instance of the class being wrapped.
- Specified by:
getWrappedin interfaceFacesWrapper<NavigationCase>- Returns:
- the wrapped instance.
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classNavigationCase
-
hashCode
public int hashCode()
- Overrides:
hashCodein classNavigationCase
-
toString
public String toString()
- Overrides:
toStringin classNavigationCase
-
getActionURL
public URL getActionURL(FacesContext context) throws MalformedURLException
Description copied from class:NavigationCaseConstruct an absolute URL to this
NavigationCaseinstance usingViewHandler.getActionURL(jakarta.faces.context.FacesContext, java.lang.String)on the path portion of the url.- Overrides:
getActionURLin classNavigationCase- Parameters:
context- theFacesContextfor the current request- Returns:
- the action URL.
- Throws:
MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getBookmarkableURL
public URL getBookmarkableURL(FacesContext context) throws MalformedURLException
Description copied from class:NavigationCaseConstruct an absolute URL suitable for a bookmarkable link to this
NavigationCaseinstance usingViewHandler.getBookmarkableURL(jakarta.faces.context.FacesContext, java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, boolean)on the path portion of the url. This URL may include view parameters specified as metadata within the view.- Overrides:
getBookmarkableURLin classNavigationCase- Parameters:
context- theFacesContextfor the current request- Returns:
- the bookmarkable URL.
- Throws:
MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getCondition
public Boolean getCondition(FacesContext context)
Description copied from class:NavigationCaseEvaluates the
Note throws any exceptions encountered during the process of evaluating the expression or obtaining its value.<if>for this<navigation-case>, if any. The expression to be evaluated is passed into the constructor as a string. When the expression is evaluated, its value must be coerced into abooleanper the normal Jakarta Expression Language coercion rules.- Overrides:
getConditionin classNavigationCase- Parameters:
context- theFacesContextfor the current request- Returns:
nullif there is no<if>element associated with this<navigation-case>, otherwise return the evaluation result of the condition
-
getFromAction
public String getFromAction()
Description copied from class:NavigationCaseReturn the
<from-action>for this<navigation-case>- Overrides:
getFromActionin classNavigationCase- Returns:
- the from action.
-
getFromOutcome
public String getFromOutcome()
Description copied from class:NavigationCaseReturn the
<from-outcome>for this<navigation-case>- Overrides:
getFromOutcomein classNavigationCase- Returns:
- the from outcome.
-
getFromViewId
public String getFromViewId()
Description copied from class:NavigationCaseReturn the
<from-view-id>of the<navigation-rule>inside which this<navigation-case>is nested.- Overrides:
getFromViewIdin classNavigationCase- Returns:
- the from viedId.
-
getParameters
public Map<String,List<String>> getParameters()
Description copied from class:NavigationCaseReturn the parameters to be included for navigation cases requiring a redirect. If no parameters are defined,
nullwill be returned. The keys in theMapare parameter names. For each key, the corresponding value is aListof unconverted values.- Overrides:
getParametersin classNavigationCase- Returns:
- the list of parameters, or
null
-
getRedirectURL
public URL getRedirectURL(FacesContext context) throws MalformedURLException
Description copied from class:NavigationCaseConstruct an absolute URL suitable for a "redirect" to this
NavigationCaseinstance usingViewHandler.getRedirectURL(jakarta.faces.context.FacesContext, java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, boolean)on the path portion of the url.- Overrides:
getRedirectURLin classNavigationCase- Parameters:
context- theFacesContextfor the current request- Returns:
- the redirect URL.
- Throws:
MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getResourceURL
public URL getResourceURL(FacesContext context) throws MalformedURLException
Description copied from class:NavigationCaseConstruct an absolute URL to this
NavigationCaseinstance usingViewHandler.getResourceURL(jakarta.faces.context.FacesContext, java.lang.String)on the path portion of the url.- Overrides:
getResourceURLin classNavigationCase- Parameters:
context- theFacesContextfor the current request- Returns:
- the resource URL.
- Throws:
MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getToViewId
public String getToViewId(FacesContext context)
Description copied from class:NavigationCaseEvaluates the
<to-view-id>for this<navigation-case>- Overrides:
getToViewIdin classNavigationCase- Parameters:
context- theFacesContextfor the current request- Returns:
- the view ID that should be navigated to
-
getToFlowDocumentId
public String getToFlowDocumentId()
Description copied from class:NavigationCaseIf this navigation case represents a flow invocation, this property is the documentId in which the flow whose id is given by the return from
NavigationCase.getFromOutcome()is defined. Implementations must override this method to return the value defined in the corresponding application configuration resources element. The base implementation returns the empty string.- Overrides:
getToFlowDocumentIdin classNavigationCase- Returns:
- the toFlow documentId.
-
hasCondition
public boolean hasCondition()
Description copied from class:NavigationCaseTest if this navigation case has an associated
<if>element.- Overrides:
hasConditionin classNavigationCase- Returns:
trueif there's an<if>element associated with this<navigation-case>, otherwisefalse
-
isIncludeViewParams
public boolean isIncludeViewParams()
Description copied from class:NavigationCaseReturn the
<redirect>value for this<navigation-case>. This will betrueif the view parametets should be encoded into the redirect URL (only applies to redirect case)- Overrides:
isIncludeViewParamsin classNavigationCase- Returns:
trueif view parameters are to be included,falseotherwise.
-
isRedirect
public boolean isRedirect()
Description copied from class:NavigationCaseReturn the
<redirect>value for this<navigation-case>. This will betrueif the new view should be navigated to via aExternalContext.redirect(String)- Overrides:
isRedirectin classNavigationCase- Returns:
trueif this is a redirect,falseotherwise.
-
-