public class GeneralizedTimeValueTranscoder extends AbstractStringValueTranscoder<ZonedDateTime>
Modifier and Type | Class and Description |
---|---|
private static class |
GeneralizedTimeValueTranscoder.FractionalPart
Describes the fractional part of a generalized time string.
|
Modifier and Type | Field and Description |
---|---|
private static DateTimeFormatter |
DATE_FORMAT
Date format.
|
private static String |
DAY_PATTERN
Pattern for capturing the day in generalized time.
|
private static String |
FRACTION_PATTERN
Pattern for capturing optional fraction in generalized time.
|
private static String |
HOUR_PATTERN
Pattern for capturing hours in generalized time.
|
private static String |
MIN_PATTERN
Pattern for capturing optional minutes in generalized time.
|
private static String |
MONTH_PATTERN
Pattern for capturing the month in generalized time.
|
private static String |
SECOND_PATTERN
Pattern for capturing optional seconds in generalized time.
|
private static Pattern |
TIME_REGEX
Generalized time format regular expression.
|
private static String |
TIMEZONE_PATTERN
Pattern for capturing timezone in generalized time.
|
private static String |
YEAR_PATTERN
Pattern for capturing the year in generalized time.
|
Constructor and Description |
---|
GeneralizedTimeValueTranscoder() |
Modifier and Type | Method and Description |
---|---|
ZonedDateTime |
decodeStringValue(String value)
Decodes the supplied ldap attribute value into a custom type.
|
String |
encodeStringValue(ZonedDateTime value)
Encodes the supplied value into an ldap attribute value.
|
Class<ZonedDateTime> |
getType()
Returns the type produced by this value transcoder.
|
protected ZonedDateTime |
parseGeneralizedTime(String value)
Parses the supplied value and returns a date time.
|
decodeBinaryValue, encodeBinaryValue
private static final String YEAR_PATTERN
private static final String MONTH_PATTERN
private static final String DAY_PATTERN
private static final String HOUR_PATTERN
private static final String MIN_PATTERN
private static final String SECOND_PATTERN
private static final String FRACTION_PATTERN
private static final String TIMEZONE_PATTERN
private static final Pattern TIME_REGEX
private static final DateTimeFormatter DATE_FORMAT
public ZonedDateTime decodeStringValue(String value)
ValueTranscoder
value
- to decodepublic String encodeStringValue(ZonedDateTime value)
ValueTranscoder
value
- to encodepublic Class<ZonedDateTime> getType()
ValueTranscoder
protected ZonedDateTime parseGeneralizedTime(String value) throws ParseException
value
- of generalized time to parseParseException
- if the value does not contain correct generalized time syntaxCopyright © 2003-2019 Virginia Tech. All Rights Reserved.