org.apache.myfaces.extensions.cdi.jsf.impl.util
Class ExceptionUtils

java.lang.Object
  extended by org.apache.myfaces.extensions.cdi.jsf.impl.util.ExceptionUtils

@Typed
public abstract class ExceptionUtils
extends Object

Helper for exceptions


Method Summary
static IllegalStateException ambiguousDefaultErrorViewDefinitionException(Class<? extends ViewConfig> newDef, Class<? extends ViewConfig> existingDef)
          Creates an exception if there are multiple classes which represent the same default-error-view
static IllegalStateException ambiguousViewConfigRootException(Class storedPageClass, Class viewConfigRootClass)
          Creates an exception if there are multiple classes annotated with InlineViewConfigRoot in an web-app.
static IllegalArgumentException ambiguousViewDefinitionException(String viewId, Class<? extends ViewConfig> newDef, Class<? extends ViewConfig> existingDef)
          Creates an exception if there are multiple classes which represent the same view-id
static RuntimeException conversationNotEditableException(Conversation conversation)
          Creates an exception in case of a custom implementation of Conversation which doesn't implement EditableConversation
static IllegalArgumentException conversationNotFoundException(String conversationKey)
          Creates an exception if there is no conversation with the given key
static IllegalArgumentException invalidPhasesCallbackMethod(Class targetClass, Method method)
          Creates an exception if a method is annotated with BeforePhase or AfterPhase and has an unsupported signature
static IllegalStateException missingInlineViewConfigRootMarkerException(Class<? extends ViewConfig> viewDefinitionClass)
          Creates an exception if Page is used for a page bean and there is no class annotated with InlineViewConfigRoot to mark the package root
static RuntimeException tooManyOpenWindowException()
          Creates an exception which signals that a user opened too many windows.
static IllegalStateException unsupportedPhasesLifecycleCallback()
          Creates an exception in case of an unsupported usage of BeforePhase
static RuntimeException windowContextManagerNotEditableException(WindowContextManager windowContextManager)
          Creates an exception in case of a custom implementation of WindowContextManager which doesn't implement EditableWindowContextManager
static RuntimeException windowContextNotEditableException(WindowContext windowContext)
          Creates an exception in case of a custom implementation of WindowContext which doesn't implement EditableWindowContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

tooManyOpenWindowException

public static RuntimeException tooManyOpenWindowException()
Creates an exception which signals that a user opened too many windows.

Returns:
exception which can be thrown

windowContextManagerNotEditableException

public static RuntimeException windowContextManagerNotEditableException(WindowContextManager windowContextManager)
Creates an exception in case of a custom implementation of WindowContextManager which doesn't implement EditableWindowContextManager

Parameters:
windowContextManager - found window-context-manager instance
Returns:
exception which can be thrown

windowContextNotEditableException

public static RuntimeException windowContextNotEditableException(WindowContext windowContext)
Creates an exception in case of a custom implementation of WindowContext which doesn't implement EditableWindowContext

Parameters:
windowContext - found window-context instance
Returns:
exception which can be thrown

conversationNotEditableException

public static RuntimeException conversationNotEditableException(Conversation conversation)
Creates an exception in case of a custom implementation of Conversation which doesn't implement EditableConversation

Parameters:
conversation - found conversation instance
Returns:
exception which can be thrown

invalidPhasesCallbackMethod

public static IllegalArgumentException invalidPhasesCallbackMethod(Class targetClass,
                                                                   Method method)
Creates an exception if a method is annotated with BeforePhase or AfterPhase and has an unsupported signature

Parameters:
targetClass - class which contains the method
method - annotated but invalid method
Returns:
exception which can be thrown

unsupportedPhasesLifecycleCallback

public static IllegalStateException unsupportedPhasesLifecycleCallback()
Creates an exception in case of an unsupported usage of BeforePhase

Returns:
exception which can be thrown

conversationNotFoundException

public static IllegalArgumentException conversationNotFoundException(String conversationKey)
Creates an exception if there is no conversation with the given key

Parameters:
conversationKey - current conversation-key
Returns:
exception which can be thrown

missingInlineViewConfigRootMarkerException

public static IllegalStateException missingInlineViewConfigRootMarkerException(Class<? extends ViewConfig> viewDefinitionClass)
Creates an exception if Page is used for a page bean and there is no class annotated with InlineViewConfigRoot to mark the package root

Parameters:
viewDefinitionClass - class with the invalid usage
Returns:
exception which can be thrown

ambiguousViewConfigRootException

public static IllegalStateException ambiguousViewConfigRootException(Class storedPageClass,
                                                                     Class viewConfigRootClass)
Creates an exception if there are multiple classes annotated with InlineViewConfigRoot in an web-app.

Parameters:
storedPageClass - registered class which hosts InlineViewConfigRoot
viewConfigRootClass - current class which also hosts InlineViewConfigRoot
Returns:
exception which can be thrown

ambiguousViewDefinitionException

public static IllegalArgumentException ambiguousViewDefinitionException(String viewId,
                                                                        Class<? extends ViewConfig> newDef,
                                                                        Class<? extends ViewConfig> existingDef)
Creates an exception if there are multiple classes which represent the same view-id

Parameters:
viewId - current view-id
newDef - current view-config class
existingDef - registered view-config class
Returns:
exception which can be thrown

ambiguousDefaultErrorViewDefinitionException

public static IllegalStateException ambiguousDefaultErrorViewDefinitionException(Class<? extends ViewConfig> newDef,
                                                                                 Class<? extends ViewConfig> existingDef)
Creates an exception if there are multiple classes which represent the same default-error-view

Parameters:
newDef - current view-config class
existingDef - registered view-config class
Returns:
exception which can be thrown


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.