Package org.apache.sling.servlets.post.impl.helper

# Klasse DateParser

java.lang.Object
org.apache.sling.servlets.post.impl.helper.DateParser

public class DateParser extends Object
Takes a string representation of a time-date string and tries for parse it using different formats.

## Konstruktorübersicht

Konstruktoren
Konstruktor
Beschreibung
`DateParser()`

## Methodenübersicht

Modifizierer und Typ
Methode
Beschreibung
`Calendar`
`parse(String source)`
Parses the given source string and returns the respective calendar instance.
`Calendar[]`
`parse(String[] sources)`
Parses the given source strings and returns the respective calendar instances.
`void`
`register(String format)`
Registers a format string to the list of internally checked ones.

### Von Klasse geerbte Methoden java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Konstruktordetails

### DateParser

public DateParser()

## Methodendetails

### register

public void register(String format)
Registers a format string to the list of internally checked ones. Uses the `SimpleDateFormat`.

Parameter:
  `format` - format as in `SimpleDateFormat`
Löst aus:
  `IllegalArgumentException` - if the format is not valid.

### parse

public Calendar parse(String source)
Parses the given source string and returns the respective calendar instance. If no format matches returns `null`.

Parameter:
  `source` - date time source string
Gibt zurück:
  calendar representation of the source or `null`

### parse

public Calendar[] parse(String[] sources)
Parses the given source strings and returns the respective calendar instances. If no format matches for any of the sources returns `null`.

Parameter:
  `sources` - date time source strings
Gibt zurück:
  calendar representations of the source or `null`