public NavigationCase getNavigationCase()

in deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/navigation/DeltaSpikeNavigationHandler.java [100:165]


    public NavigationCase getNavigationCase(FacesContext context, String action, String outcome)
    {
        if (this.wrapped instanceof ConfigurableNavigationHandler)
        {
            if (!this.activated)
            {
                return ((ConfigurableNavigationHandler)this.wrapped).getNavigationCase(context, action, outcome);
            }

            if (action == null && outcome != null && outcome.contains(".") && outcome.startsWith("class ") &&
                    !otherOutcomes.contains(outcome))
            {
                String originalOutcome = outcome;

                NavigationCase navigationCase = this.viewConfigBasedNavigationCaseCache.get(originalOutcome);

                if (navigationCase != null)
                {
                    return navigationCase;
                }

                outcome = outcome.substring(6);

                ViewConfigDescriptor entry = null;

                if (DefaultErrorView.class.getName().equals(originalOutcome))
                {
                    ViewConfigResolver viewConfigResolver = JsfUtils.getViewConfigResolver();
                    entry = viewConfigResolver.getDefaultErrorViewConfigDescriptor();
                }

                if (entry == null)
                {
                    Object loadedClass = ClassUtils.tryToLoadClassForName(outcome);

                    if (loadedClass == null)
                    {
                        this.otherOutcomes.add(originalOutcome);
                    }
                    else if (ViewConfig.class.isAssignableFrom((Class) loadedClass))
                    {
                        entry = JsfUtils.getViewConfigResolver()
                                .getViewConfigDescriptor((Class<? extends ViewConfig>) loadedClass);
                    }
                }

                if (entry != null)
                {
                    View.NavigationMode navigationMode = entry.getMetaData(View.class).iterator().next().navigation();

                    navigationCase = new NavigationCase("*",
                            null,
                            null,
                            null,
                            entry.getViewId(),
                            null,
                            View.NavigationMode.REDIRECT.equals(navigationMode),
                            false);
                    this.viewConfigBasedNavigationCaseCache.put(originalOutcome, navigationCase);
                    return navigationCase;
                }
            }
            return ((ConfigurableNavigationHandler) this.wrapped).getNavigationCase(context, action, outcome);
        }
        return null;
    }