com.sun.syndication.io.impl
クラス DateParser

java.lang.Object
  上位を拡張 com.sun.syndication.io.impl.DateParser

public class DateParser
extends java.lang.Object

A helper class that parses Dates out of Strings with date time in RFC822 and W3CDateTime formats plus the variants Atom (0.3) and RSS (0.9, 0.91, 0.92, 0.93, 0.94, 1.0 and 2.0) specificators added to those formats.

It uses the JDK java.text.SimpleDateFormat class attemtping the parse using a mask for each one of the possible formats.


メソッドの概要
static java.lang.String formatRFC822(java.util.Date date)
          create a RFC822 representation of a date.
static java.lang.String formatW3CDateTime(java.util.Date date)
          create a W3C Date Time representation of a date.
static java.util.Date parseDate(java.lang.String sDate)
          Parses a Date out of a String with a date in W3C date-time format or in a RFC822 format.
static java.util.Date parseRFC822(java.lang.String sDate)
          Parses a Date out of a String with a date in RFC822 format.
static java.util.Date parseW3CDateTime(java.lang.String sDate)
          Parses a Date out of a String with a date in W3C date-time format.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

parseRFC822

public static java.util.Date parseRFC822(java.lang.String sDate)
Parses a Date out of a String with a date in RFC822 format.

It parsers the following formats:

Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.

パラメータ:
sDate - string to parse for a date.
戻り値:
the Date represented by the given RFC822 string. It returns null if it was not possible to parse the given string into a Date.

parseW3CDateTime

public static java.util.Date parseW3CDateTime(java.lang.String sDate)
Parses a Date out of a String with a date in W3C date-time format.

It parsers the following formats:

Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.

パラメータ:
sDate - string to parse for a date.
戻り値:
the Date represented by the given W3C date-time string. It returns null if it was not possible to parse the given string into a Date.

parseDate

public static java.util.Date parseDate(java.lang.String sDate)
Parses a Date out of a String with a date in W3C date-time format or in a RFC822 format.

パラメータ:
sDate - string to parse for a date.
戻り値:
the Date represented by the given W3C date-time string. It returns null if it was not possible to parse the given string into a Date.

formatRFC822

public static java.lang.String formatRFC822(java.util.Date date)
create a RFC822 representation of a date.

Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.

パラメータ:
date - Date to parse
戻り値:
the RFC822 represented by the given Date It returns null if it was not possible to parse the date.

formatW3CDateTime

public static java.lang.String formatW3CDateTime(java.util.Date date)
create a W3C Date Time representation of a date.

Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.

パラメータ:
date - Date to parse
戻り値:
the W3C Date Time represented by the given Date It returns null if it was not possible to parse the date.