private int parseDateFormatStyle(String text, int defaultStyle)
    {
        if (text == null)
        {
            return defaultStyle;
        }

        if (SHORT_STYLE.equalsIgnoreCase(text))
        {
            return DateFormat.SHORT;
        }
        else if (MEDIUM_STYLE.equalsIgnoreCase(text))
        {
            return DateFormat.MEDIUM;
        }
        else if (LONG_STYLE.equalsIgnoreCase(text))
        {
            return DateFormat.LONG;
        }
        else if (FULL_STYLE.equalsIgnoreCase(text))
        {
            return DateFormat.FULL;
        }
        return defaultStyle;
    }
private int parseDateFormatStyle ( String text , int defaultStyle ) { if ( text == null ) { return defaultStyle ; } if ( SHORT_STYLE . equalsIgnoreCase ( text ) ) { return DateFormat . SHORT ; } else if ( MEDIUM_STYLE . equalsIgnoreCase ( text ) ) { return DateFormat . MEDIUM ; } else if ( LONG_STYLE . equalsIgnoreCase ( text ) ) { return DateFormat . LONG ; } else if ( FULL_STYLE . equalsIgnoreCase ( text ) ) { return DateFormat . FULL ; } return defaultStyle ; }
Parses the style of the {@link DateFormat} from a string label.

@param text The string label.
@param defaultStyle The default style.

@return the parsed style or the default style if it's an incorrect style.