org.ldaptive.io
Class GeneralizedTimeValueTranscoder

java.lang.Object
  extended by org.ldaptive.io.AbstractStringValueTranscoder<Calendar>
      extended by org.ldaptive.io.GeneralizedTimeValueTranscoder
All Implemented Interfaces:
ValueTranscoder<Calendar>

public class GeneralizedTimeValueTranscoder
extends AbstractStringValueTranscoder<Calendar>

Decodes and encodes a generalized time for use in an ldap attribute value. See http://tools.ietf.org/html/rfc4517#section-3.3.13

Version:
$Revision: 2994 $ $Date: 2014-06-03 15:00:45 -0400 (Tue, 03 Jun 2014) $
Author:
Middleware Services

Constructor Summary
GeneralizedTimeValueTranscoder()
           
 
Method Summary
 Calendar decodeStringValue(String value)
          Decodes the supplied ldap attribute value into a custom type.
 String encodeStringValue(Calendar value)
          Encodes the supplied value into an ldap attribute value.
 Class<Calendar> getType()
          Returns the type produced by this value transcoder.
protected  Calendar parseGeneralizedTime(String value)
          Parses the supplied value and sets a calendar with the appropriate fields.
 
Methods inherited from class org.ldaptive.io.AbstractStringValueTranscoder
decodeBinaryValue, encodeBinaryValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneralizedTimeValueTranscoder

public GeneralizedTimeValueTranscoder()
Method Detail

decodeStringValue

public Calendar decodeStringValue(String value)
Decodes the supplied ldap attribute value into a custom type.

Parameters:
value - to decode
Returns:
decoded value

encodeStringValue

public String encodeStringValue(Calendar value)
Encodes the supplied value into an ldap attribute value.

Parameters:
value - to encode
Returns:
encoded value

getType

public Class<Calendar> getType()
Returns the type produced by this value transcoder.

Returns:
type produced by this value transcoder

parseGeneralizedTime

protected Calendar parseGeneralizedTime(String value)
                                 throws ParseException
Parses the supplied value and sets a calendar with the appropriate fields.

Parameters:
value - of generalized time to parse
Returns:
calendar initialized to the correct time
Throws:
ParseException - if the value does not contain correct generalized time syntax


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.