Package org.ldaptive.transcode
Class GeneralizedTimeValueTranscoder
- java.lang.Object
-
- org.ldaptive.transcode.AbstractStringValueTranscoder<java.time.ZonedDateTime>
-
- org.ldaptive.transcode.GeneralizedTimeValueTranscoder
-
- All Implemented Interfaces:
ValueTranscoder<java.time.ZonedDateTime>
public class GeneralizedTimeValueTranscoder extends AbstractStringValueTranscoder<java.time.ZonedDateTime>
Decodes and encodes a generalized time for use in an ldap attribute value. See http://tools.ietf.org/html/rfc4517#section-3.3.13- Author:
- Middleware Services
-
-
Constructor Summary
Constructors Constructor Description GeneralizedTimeValueTranscoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.time.ZonedDateTime
decodeStringValue(java.lang.String value)
Decodes the supplied ldap attribute value into a custom type.java.lang.String
encodeStringValue(java.time.ZonedDateTime value)
Encodes the supplied value into an ldap attribute value.java.lang.Class<java.time.ZonedDateTime>
getType()
Returns the type produced by this value transcoder.protected java.time.ZonedDateTime
parseGeneralizedTime(java.lang.String value)
Parses the supplied value and returns a date time.-
Methods inherited from class org.ldaptive.transcode.AbstractStringValueTranscoder
decodeBinaryValue, encodeBinaryValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ldaptive.transcode.ValueTranscoder
decoder, encoder
-
-
-
-
Method Detail
-
decodeStringValue
public java.time.ZonedDateTime decodeStringValue(java.lang.String value)
Description copied from interface:ValueTranscoder
Decodes the supplied ldap attribute value into a custom type.- Parameters:
value
- to decode- Returns:
- decoded value
-
encodeStringValue
public java.lang.String encodeStringValue(java.time.ZonedDateTime value)
Description copied from interface:ValueTranscoder
Encodes the supplied value into an ldap attribute value.- Parameters:
value
- to encode- Returns:
- encoded value
-
getType
public java.lang.Class<java.time.ZonedDateTime> getType()
Description copied from interface:ValueTranscoder
Returns the type produced by this value transcoder.- Returns:
- type produced by this value transcoder
-
parseGeneralizedTime
protected java.time.ZonedDateTime parseGeneralizedTime(java.lang.String value) throws java.text.ParseException
Parses the supplied value and returns a date time.- Parameters:
value
- of generalized time to parse- Returns:
- date time initialized to the correct time
- Throws:
java.text.ParseException
- if the value does not contain correct generalized time syntax
-
-