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