Package com.cedarsolutions.exception

Examples of com.cedarsolutions.exception.EnumException


        case AOL:
            return "aol.com";
        case MYOPENID:
            return "myopenid.com";
        default:
            throw new EnumException("Unknown open id provider: " + openIdProvider);
        }
    }
View Full Code Here


                if (constant.getValue() == null) {
                    return (T) constant;
                }
            }

            throw new EnumException("String enumeration value not found: " + value);
        } else if (isIntegerEnum(clazz)) {
            try {
                Integer intValue = value == null ? null : Integer.parseInt(value);
                return (T) getEnum(clazz, intValue);
            } catch (NumberFormatException e) {
                return (T) getEnum(clazz, (Integer) null)// a value that can't be parsed is effectively "unknown"
            }
        } else {
            throw new EnumException("Enumeration class is not StringEnum or IntegerEnum");
        }
    }
View Full Code Here

                if (constant.getValue() == null) {
                    return (T) constant;
                }
            }

            throw new EnumException("Integer enumeration value not found: " + value);
        } else {
            throw new EnumException("Enumeration class is not IntegerEnum.");
        }
    }
View Full Code Here

TOP

Related Classes of com.cedarsolutions.exception.EnumException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.