Klasse DateParser
java.lang.Object
org.apache.sling.servlets.post.impl.helper.DateParser
Takes a string representation of a time-date string and tries for parse it
using different formats.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungParses the given source string and returns the respective calendar instance.Calendar[]Parses the given source strings and returns the respective calendar instances.voidRegisters a format string to the list of internally checked ones.
-
Konstruktordetails
-
DateParser
public DateParser()
-
-
Methodendetails
-
register
Registers a format string to the list of internally checked ones. Uses theSimpleDateFormat.- Parameter:
format- format as inSimpleDateFormat- Löst aus:
IllegalArgumentException- if the format is not valid.
-
parse
Parses the given source string and returns the respective calendar instance. If no format matches returnsnull.- Parameter:
source- date time source string- Gibt zurück:
- calendar representation of the source or
null
-
parse
Parses the given source strings and returns the respective calendar instances. If no format matches for any of the sources returnsnull.- Parameter:
sources- date time source strings- Gibt zurück:
- calendar representations of the source or
null
-