List of usage examples for org.joda.time Months parseMonths
@FromString public static Months parseMonths(String periodStr)
Months by parsing a string in the ISO8601 format 'PnM'. From source file:griffon.plugins.jodatime.editors.MonthsPropertyEditor.java
License:Apache License
private void handleAsString(String str) { if (isBlank(str)) { super.setValueInternal(null); return;/*from ww w . j ava 2 s.c om*/ } try { super.setValueInternal(parse(Integer.parseInt(str))); return; } catch (NumberFormatException nfe) { // ignore } try { super.setValueInternal(Months.parseMonths(str)); } catch (IllegalArgumentException e) { throw illegalValue(str, Months.class, e); } }