Example usage for org.joda.time Minutes parseMinutes

List of usage examples for org.joda.time Minutes parseMinutes

Introduction

In this page you can find the example usage for org.joda.time Minutes parseMinutes.

Prototype

@FromString
public static Minutes parseMinutes(String periodStr) 

Source Link

Document

Creates a new Minutes by parsing a string in the ISO8601 format 'PTnM'.

Usage

From source file:griffon.plugins.jodatime.editors.MinutesPropertyEditor.java

License:Apache License

private void handleAsString(String str) {
    if (isBlank(str)) {
        super.setValueInternal(null);
        return;/* w w w.ja  v a  2  s  . c o m*/
    }

    try {
        super.setValueInternal(parse(Integer.parseInt(str)));
        return;
    } catch (NumberFormatException nfe) {
        // ignore
    }

    try {
        super.setValueInternal(Minutes.parseMinutes(str));
    } catch (IllegalArgumentException e) {
        throw illegalValue(str, Minutes.class, e);
    }
}