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

Class RaceToken

code/src/java/plugin/lsttokens/choose/RaceToken.java:30–89  ·  view source on GitHub ↗

New chooser plugin, handles Race.

Source from the content-addressed store, hash-verified

28 * New chooser plugin, handles Race.
29 */
30public class RaceToken extends AbstractQualifiedChooseToken<Race>
31{
32
33 private static final Class<Race> RACE_CLASS = Race.class;
34
35 @Override
36 public String getTokenName()
37 {
38 return "RACE";
39 }
40
41 @Override
42 public String getParentToken()
43 {
44 return "CHOOSE";
45 }
46
47 @Override
48 public Class<CDOMObject> getTokenClass()
49 {
50 return CDOMObject.class;
51 }
52
53 @Override
54 protected String getDefaultTitle()
55 {
56 return "Race choice";
57 }
58
59 @Override
60 protected AssociationListKey<Race> getListKey()
61 {
62 return AssociationListKey.getKeyFor(RACE_CLASS, "CHOOSE*RACE");
63 }
64
65 @Override
66 public Race decodeChoice(LoadContext context, String s)
67 {
68 return context.getReferenceContext().silentlyGetConstructedCDOMObject(RACE_CLASS, s);
69 }
70
71 @Override
72 public String encodeChoice(Race choice)
73 {
74 return choice.getKeyName();
75 }
76
77 @Override
78 protected ParseResult parseTokenWithSeparator(LoadContext context, CDOMObject obj, String value)
79 {
80 return super.parseTokenWithSeparator(context, context.getReferenceContext().getManufacturer(RACE_CLASS), obj,
81 value);
82 }
83
84 @Override
85 protected String getPersistentFormat()
86 {
87 return "RACE";

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected