com.wewebu.ow.server.ecmimpl.opencmis.field
Class OwCMISISOSimpleFormatAdapter

java.lang.Object
  extended by java.text.Format
      extended by com.wewebu.ow.server.ecmimpl.opencmis.field.OwCMISISOSimpleFormatAdapter
All Implemented Interfaces:
Serializable, Cloneable

public class OwCMISISOSimpleFormatAdapter
extends Format

ISO 8601 compliant Format adapter for SimpleDateFormat. Adapts Z (Zulu time zone) to simple date formats 0 offset.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.Format
Format.Field
 
Field Summary
protected static String PATTERN_FULL
           
protected static String PATTERN_FULL_ZONE
           
 
Constructor Summary
OwCMISISOSimpleFormatAdapter()
           
OwCMISISOSimpleFormatAdapter(SimpleDateFormat zoneFormat_p, SimpleDateFormat noZoneFormat_p, String currentOffset)
           
OwCMISISOSimpleFormatAdapter(String currentOffset)
           
 
Method Summary
 StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
           
 Object parseObject(String source, ParsePosition pos)
           
protected  Object parseObjectByIdentification(String source, ParsePosition pos)
          Process if default parse does not work like requested.
protected  TimeZone parseTimeZone(String zone)
          Create specific zone
 
Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATTERN_FULL

protected static final String PATTERN_FULL
See Also:
Constant Field Values

PATTERN_FULL_ZONE

protected static final String PATTERN_FULL_ZONE
See Also:
Constant Field Values
Constructor Detail

OwCMISISOSimpleFormatAdapter

public OwCMISISOSimpleFormatAdapter()

OwCMISISOSimpleFormatAdapter

public OwCMISISOSimpleFormatAdapter(String currentOffset)

OwCMISISOSimpleFormatAdapter

public OwCMISISOSimpleFormatAdapter(SimpleDateFormat zoneFormat_p,
                                    SimpleDateFormat noZoneFormat_p,
                                    String currentOffset)
Method Detail

format

public final StringBuffer format(Object obj,
                                 StringBuffer toAppendTo,
                                 FieldPosition pos)
Specified by:
format in class Format

parseObject

public final Object parseObject(String source,
                                ParsePosition pos)
Specified by:
parseObject in class Format

parseObjectByIdentification

protected Object parseObjectByIdentification(String source,
                                             ParsePosition pos)
Process if default parse does not work like requested.

By default use the PATTERN_FULL format without TimeZone, handling time zone with additional logic.

Parameters:
source - String representing ISO date
pos - ParsePostion used by java.text.Format
Returns:
Object (Date) or null if could not parse

parseTimeZone

protected TimeZone parseTimeZone(String zone)
Create specific zone

Parameters:
zone - String extracted time zone
Returns:
TimeZone


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.