Exemplo n.º 1
0
 @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);
   }
 }
Exemplo n.º 2
0
 @Override
 public String[] unparse(LoadContext context, UnitSet us) {
   return new String[] {us.getHeightDisplayPattern().toPattern()};
 }