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

Class SkillToken

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

New chooser plugin, handles skills.

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected