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

Class DeityToken

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

New chooser plugin, handles Deity.

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected