MCPcopy Create free account
hub / github.com/PCGen/pcgen / addChoices

Method addChoices

code/src/java/pcgen/io/PCGVer2Creator.java:2660–2682  ·  view source on GitHub ↗
(StringBuilder buffer, PersistentTransitionChoice<T> tc)

Source from the content-addressed store, hash-verified

2658 }
2659
2660 private <T> void addChoices(StringBuilder buffer, PersistentTransitionChoice<T> tc)
2661 {
2662 List<Object> assocList = thePC.getAssocList(tc, AssociationListKey.ADD);
2663 if (assocList == null)
2664 {
2665 return;
2666 }
2667 //
2668 // |ADD:[PROMPT:SUBTOKEN|blah|CHOICE:choice1|CHOICE:choice2|CHOICE:choice3...]
2669 //
2670 SelectableSet<?> choices = tc.getChoices();
2671 buffer.append('|').append(IOConstants.TAG_ADDTOKEN).append(':').append('[');
2672 buffer.append(EntityEncoder.encode(choices.getName())).append(':');
2673 buffer.append(EntityEncoder.encode(choices.getLSTformat()));
2674
2675 for (Object assoc : assocList)
2676 {
2677 buffer.append('|').append(IOConstants.TAG_CHOICE).append(':')
2678 .append(EntityEncoder.encode(tc.encodeChoice(tc.castChoice(assoc))));
2679 }
2680
2681 buffer.append(']');
2682 }
2683
2684}

Callers 1

appendAddTokenInfoMethod · 0.95

Calls 8

encodeMethod · 0.95
getChoicesMethod · 0.65
getNameMethod · 0.65
getLSTformatMethod · 0.65
encodeChoiceMethod · 0.65
castChoiceMethod · 0.65
getAssocListMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected