Skip navigation links


org.apache.myfaces.trinidad.util
Class EnumParseException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.apache.myfaces.trinidad.util.EnumParseException

All Implemented Interfaces:
Serializable

public final class EnumParseException
extends RuntimeException

Exception thrown by Enums multi-value parsing utilities to indicate that a parsing failure has occurred. This exception class offers one benefit over the standard exceptions (eg. IllegalArgumentException): it provides access to the String value that triggered the failure, which makes it possible to provide a more detailed error message to the end user.

See Also:
Enums.parseEnumValues(java.util.Collection<java.lang.String>, java.lang.Class<E>, org.apache.myfaces.trinidad.util.Enums.EnumParser<E>, E), Serialized Form

Constructor Summary
EnumParseException(String message, String illegalValue)
          Creates the EnumParseException

 

Method Summary
 String getIllegalValue()
          Returns the String value that triggered the EnumParseException.

 

Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

EnumParseException

public EnumParseException(String message,
                          String illegalValue)
Creates the EnumParseException
Parameters:
message - A message describing the failure
illegalValue - the String value that could not be parsed to an Enum constant value.

Method Detail

getIllegalValue

public String getIllegalValue()
Returns the String value that triggered the EnumParseException.

Skip navigation links


Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.