Example usage for org.joda.time Seconds parseSeconds

List of usage examples for org.joda.time Seconds parseSeconds

Introduction

In this page you can find the example usage for org.joda.time Seconds parseSeconds.

Prototype

@FromString
public static Seconds parseSeconds(String periodStr) 

Source Link

Document

Creates a new Seconds by parsing a string in the ISO8601 format 'PTnS'.

Usage

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

License:Apache License

private void handleAsString(String str) {
    if (isBlank(str)) {
        super.setValueInternal(null);
        return;/*from w w w.ja  v  a2  s  .  com*/
    }

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

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