src/jdk/nashorn/internal/runtime/options/OptionTemplate.java

Print this page




 250                     break;
 251                 case "name":
 252                     if (!arg.startsWith("-")) {
 253                         throw new IllegalArgumentException(arg);
 254                     }
 255                     this.name = arg;
 256                     break;
 257                 case "short_name":
 258                     if (!arg.startsWith("-")) {
 259                         throw new IllegalArgumentException(arg);
 260                     }
 261                     this.shortName = arg;
 262                     break;
 263                 case "desc":
 264                     this.description = arg;
 265                     break;
 266                 case "params":
 267                     this.params = arg;
 268                     break;
 269                 case "type":
 270                     this.type = arg.toLowerCase(Locale.ROOT);
 271                     break;
 272                 case "default":
 273                     this.defaultValue = arg;
 274                     break;
 275                 case "dependency":
 276                     this.dependency = arg;
 277                     break;
 278                 case "conflict":
 279                     this.conflict = arg;
 280                     break;
 281                 case "value_next_arg":
 282                     this.valueNextArg = Boolean.parseBoolean(arg);
 283                     break;
 284                 default:
 285                     throw new IllegalArgumentException(keyToken);
 286                 }
 287             }
 288 
 289             // default to boolean if no type is given
 290             if (this.type == null) {




 250                     break;
 251                 case "name":
 252                     if (!arg.startsWith("-")) {
 253                         throw new IllegalArgumentException(arg);
 254                     }
 255                     this.name = arg;
 256                     break;
 257                 case "short_name":
 258                     if (!arg.startsWith("-")) {
 259                         throw new IllegalArgumentException(arg);
 260                     }
 261                     this.shortName = arg;
 262                     break;
 263                 case "desc":
 264                     this.description = arg;
 265                     break;
 266                 case "params":
 267                     this.params = arg;
 268                     break;
 269                 case "type":
 270                     this.type = arg.toLowerCase(Locale.ENGLISH);
 271                     break;
 272                 case "default":
 273                     this.defaultValue = arg;
 274                     break;
 275                 case "dependency":
 276                     this.dependency = arg;
 277                     break;
 278                 case "conflict":
 279                     this.conflict = arg;
 280                     break;
 281                 case "value_next_arg":
 282                     this.valueNextArg = Boolean.parseBoolean(arg);
 283                     break;
 284                 default:
 285                     throw new IllegalArgumentException(keyToken);
 286                 }
 287             }
 288 
 289             // default to boolean if no type is given
 290             if (this.type == null) {