@Override protected ParseResult parseNonEmptyToken(LoadContext context, UnitSet us, String value) { try { us.setHeightDisplayPattern(new DecimalFormat(value)); return ParseResult.SUCCESS; } catch (IllegalArgumentException e) { return new ParseResult.Fail( "Invalid Decimal Format in " + getTokenName() + ": " + value + ": " + e.getMessage(), context); } }
@Override public String[] unparse(LoadContext context, UnitSet us) { return new String[] {us.getHeightDisplayPattern().toPattern()}; }