question: public < T extends Enum < T > > T consumeEnum ( String name , boolean required , Class < T > enumClass , T defaultValue ) throws ParseException { String value = consume ( name , required ) ; if ( value == null ) { return defaultValue ; } try { return Enum . valueOf ( enumClass , value . toUpperCase ( ) ) ; } catch ( IllegalArgumentException e ) { ParseException pe = new ParseException ( CoreErrorDomain . ERR . invalidAttributeValue , e ) ; pe . setInternalReason ( "Invalid value for attribute : '" + name + "'" ) ; throw pe ; } }
target:  Gets the value of an enumerated attribute and remove it from the list. Enumerated values are case-insensitive.