- Timestamp:
- 07/10/13 22:41:02 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/params/ParamBuilder.java
r97 r99 7 7 import com.framsticks.util.FramsticksException; 8 8 import com.framsticks.util.Misc; 9 import com.framsticks.util.lang.FlagsUtil; 9 10 import com.framsticks.util.lang.Strings; 10 11 … … 66 67 private int extra = 0; 67 68 68 String containedTypeName; 69 protected String containedTypeName; 70 71 protected String eventArgumentTypeName; 69 72 70 73 protected Class<?> storageType; … … 116 119 } 117 120 121 public ParamBuilder containedTypeName(String containedTypeName) { 122 this.containedTypeName = containedTypeName; 123 return this; 124 } 125 118 126 /** 119 127 * @return the resultType … … 160 168 public String getUid() { 161 169 return uid; 170 } 171 172 public ParamBuilder uid(String uid) { 173 this.uid = uid; 174 return this; 162 175 } 163 176 … … 322 335 case 'e': { 323 336 type(EventParam.class); 324 break; 325 } 326 case 'l': { 327 containedTypeName = second; 328 if (third != null) { 329 type(UniqueListParam.class); 330 uid = third; 331 } else { 332 type(ArrayListParam.class); 333 } 334 break; 335 } 336 default:{ 337 log.error("unknown type: " + first); 338 return this; 339 } 340 } 337 eventArgumentTypeName(second); 338 break; 339 } 340 case 'l': { 341 containedTypeName = second; 342 if (third != null) { 343 type(UniqueListParam.class); 344 uid = third; 345 } else { 346 type(ArrayListParam.class); 347 } 348 break; 349 } 350 default: { 351 log.error("unknown type: " + first); 352 return this; 353 } 354 } 355 return this; 356 } 357 358 public ParamBuilder eventArgumentTypeName(String eventArgumentTypeName) { 359 this.eventArgumentTypeName = eventArgumentTypeName; 341 360 return this; 342 361 } … … 438 457 id(paramEntryValues[0]); 439 458 group(Integer.valueOf(paramEntryValues[1])); 440 flags(Flags .read(paramEntryValues[2]));459 flags(FlagsUtil.read(ParamFlags.class, paramEntryValues[2])); 441 460 name(paramEntryValues[3]); 442 461 type(paramEntryValues[4]); … … 464 483 break; 465 484 case FLAGS_FIELD: 466 flags(Flags .read(value));485 flags(FlagsUtil.read(ParamFlags.class, value)); 467 486 break; 468 487 case HELP_FIELD: … … 492 511 } 493 512 513 /** 514 * @return the eventArgumentTypeName 515 */ 516 public String getEventArgumentTypeName() { 517 return eventArgumentTypeName; 518 } 519 494 520 public Class<?> getStorageType() { 495 521 return storageType; 496 }497 498 public ParamBuilder forAccess(AccessInterface access) {499 return name(access.getId()).type("o " + access.getId());500 522 } 501 523
Note: See TracChangeset
for help on using the changeset viewer.