@Override protected IBMPartitionTypes doAccept(Token value, int flags) throws CommandSyntaxException { try { int code = Integer.parseInt(value.text, 16); return IBMPartitionTypes.valueOf(code); } catch (NumberFormatException ex) { throw new CommandSyntaxException("not a valid hexadecimal number"); } catch (IllegalArgumentException ex) { throw new CommandSyntaxException(ex.getMessage()); } }