/** * Returns the enum value that corresponds to the given textual * representation. * * @param defaultTextRep The textual representation * @return The enum value */ public static CascadeActionEnum getEnum(String defaultTextRep) { return (CascadeActionEnum)getEnum(CascadeActionEnum.class, defaultTextRep); }
/** * Returns the enum value that corresponds to the given integer * representation. * * @param intValue The integer value * @return The enum value */ public static CascadeActionEnum getEnum(int intValue) { return (CascadeActionEnum)getEnum(CascadeActionEnum.class, intValue); }
/** * Returns the value of the indicated attribute of the current element as a boolean. * If the value is not a valid boolean, then an exception is thrown. * * @param xmlReader The xml reader * @param attributeIdx The index of the attribute * @return The attribute's value as a boolean */ private CascadeActionEnum getAttributeValueAsCascadeEnum(XMLStreamReader xmlReader, int attributeIdx) throws DdlUtilsXMLException { String value = xmlReader.getAttributeValue(attributeIdx); CascadeActionEnum enumValue = value == null ? null : CascadeActionEnum.getEnum(value.toLowerCase()); if (enumValue == null) { throw new DdlUtilsXMLException("Illegal boolean value '" + value +"' for attribute " + xmlReader.getAttributeLocalName(attributeIdx)); } else { return enumValue; } }