Search in sources :

Example 1 with KitApply

use of pcgen.cdom.enumeration.KitApply in project pcgen by PCGen.

the class ApplyToken method parseNonEmptyToken.

@Override
protected ParseResult parseNonEmptyToken(LoadContext context, Kit kit, String value) {
    try {
        KitApply ka = KitApply.valueOf(value);
        kit.put(ObjectKey.APPLY_MODE, ka);
        return ParseResult.SUCCESS;
    } catch (IllegalArgumentException e) {
        return new ParseResult.Fail(getTokenName() + " encountered unexpected application type: " + value, context);
    }
}
Also used : ParseResult(pcgen.rules.persistence.token.ParseResult) KitApply(pcgen.cdom.enumeration.KitApply)

Aggregations

KitApply (pcgen.cdom.enumeration.KitApply)1 ParseResult (pcgen.rules.persistence.token.ParseResult)1