Package org.apache.sling.contentparser.api

## Class ParserHelper

- java.lang.Object
- - org.apache.sling.contentparser.api.ParserHelper

    @ConsumerType
    public final class ParserHelper
    extends java.lang.Object

### Method Summary

All Methods Static Methods Concrete Methods
`static java.lang.Object` `convertSingleTypeArray​(java.lang.Object[] values)` Converts a multi-value property to a single object.
`static java.util.Calendar` `parseDate​(java.lang.String string)` Attempts to parse a `string` using first the `ISO_8601_MILLISECONDS_DATE_FORMAT` format and then the `ECMA_DATE_FORMAT`.

### Methods inherited from class java.lang.Object

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

### Method Detail

#### parseDate

    public static java.util.Calendar parseDate​(java.lang.String string)

Attempts to parse a `string` using first the `ISO_8601_MILLISECONDS_DATE_FORMAT` format and then the `ECMA_DATE_FORMAT`.

Parameters:
  `string` - the string to parse
Returns:
  a `Calendar` containing the parsed date or `null`, if the parsing failed

#### convertSingleTypeArray

    public static java.lang.Object convertSingleTypeArray​(java.lang.Object[] values)

Converts a multi-value property to a single object.

Parameters:
  `values` - the multi-value property's values
Returns:
  an object representation of the multi-value property
Throws:
  `java.lang.IllegalArgumentException` - when the provided `values` array contains null values, `Map` values, or the values are not of the same type